USB: ehci-msm-hsic: Allow enabling only SUSPEND SOF workaround

There can be SOFs underway after suspending the port
(setting susp bit) which leads to phy lockup or unexpected
device disconnections on some platforms. Fix for this is to halt
the controller before setting port suspend bit to avoid such issues.
There are similar SOF related PHY issues for RESET and RESUME.
There already exists a platform_data or DT parameter:
'phy_sof_workaround' which enables all these SOF related workarounds.
But, some hardwares have RESET and RESUME SOF issues fixed but only
SUSPEND SOF issues is present. For these add pdata and DT parameter
to enable only SUSPEND SOF workaround.

CRs-fixed: 510136
Change-Id: I57d7fb11616e96b606f9f0c80bf3222fca27bb5d
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: Amit Blay <ablay@codeaurora.org>
USB: ehci-msm-hsic: Allow enabling only RESET SOF workaround

There are similar SOF related PHY issues for SUSPEND and RESUME.
There already exists a platform_data or DT parameter:
'phy_sof_workaround' which enables all these SOF related workarounds.
But, some hardwares have only RESET SOF issues is present. For these
add pdata and DT parameter to enable only RESET SOF workaround.

Change-Id: I87d0626fd6da19e9e77b62833627caba97106086
CRs-fixed: 548153
Signed-off-by: Amit Blay <ablay@codeaurora.org>
ARM: dts: msm: Enable PHY SOF workarounds for MDM9625

Enable the SUSPEND SOF, and RESET SOF workarounds.

Change-Id: I05b25be1b807862116cc54bac47f1fc9d398bcc7
CRs-fixed: 548153
Signed-off-by: Amit Blay <ablay@codeaurora.org>
msm: ehci-hsic: Add support to disable internal clock gating

EHCI cores on latest MSMs have internal clock gating enabled
by default. Stability issues (random enumeration failures)
have been observed with some CORES where clock gating feature
doesn't work as expected. Provide a DT parameter that can be
used to disabled clock gating in hardware.

CRs-fixed: 538509
Change-Id: I1fcac505e4a240367e3a685b5e8c78f52fbb2f6a
Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: Amit Blay <ablay@codeaurora.org>
ARM: dts: msm: Disable HSIC controller clock gating for MDM9625

Clock gating is by default enabled in HSIC controller.
This is resulting in stability issues during enumeration.
Hence, disable clock gating in the HSIC controller.

Change-Id: Id7b68d83da43a6050be509a489c6aa601bf87f72
CRs-fixed: 538509
Signed-off-by: Amit Blay <ablay@codeaurora.org>
diag: Check correct status variable to send log mask

Diag driver was incorrectly checking the message mask status to
send the log mask control packet to the peripherals. This patch
checks the correct status variable to send the log mask to the
peripherals.

Change-Id: I6733c930e66cabc77c6cfe62b9aa7cd48b9fe13d
CRs-Fixed: 542074
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Merge "diag: Check correct status variable to send log mask"
msm: ipa: wwan: rate limit error message

Vote for A2 power collapse is deferred if any of the UL
desc FIFOs are non-empty when last TX packet is completed.
An error message is logged for each such occurance. This
can be seen quite frequently for some SW path use cases
like WLAN UL or RNDIS UL and is impacting throughput. The
real cause of why the FIFOs are non-empty needs to be
looked into separately.

Change-Id: I02484e11f5edcda4d7ac2c8b212655f08f6c9067
Signed-off-by: Ravi Gummadidala <rgummadi@codeaurora.org>
Signed-off-by: Devendra Patel <cdevenp@codeaurora.org>
Merge "msm: ipa: wwan: rate limit error message"
usb_bam: Solve the deadlock on WWAN wakeup during suspend

On MAC-ECM suspend a crash is occurring when embedded
call is waking up the whole system.
This happens due to deadlock of resource manager dependencies.
This solution tries to address it from the USB point of view, removing the
dependency  between the CONS and PROD on remote wakeup.

Change-Id: I86c21d848d9890e01d60207f8dfca489ddf697e7
Signed-off-by: Lena Salman <esalman@codeaurora.org>
Merge "usb_bam: Solve the deadlock on WWAN wakeup during suspend"
msm: ipa: handle IPA RM timer destruction correctly

Previously, the operation did not account for the fact
that the timer could be active i.e. on one of the timer
lists pending expiry. Later when timer expired, the timer
context was invalid leading to a crash.

Change-Id: Ic39abcabc3d34f96156e2dea36c3b0a77b4846dd
Signed-off-by: Ravi Gummadidala <rgummadi@codeaurora.org>
Merge "msm: ipa: handle IPA RM timer destruction correctly"
usb: gadget: ci13xxx: ensure exit from lpm on software connect/disconnect

In case the USB gadget controller is in low power mode (lpm) due
to bus suspend, the controller may not be accessible, however
the gadget framework still allow software disconnect and connect using the
pullup operation. This may results with a crash when we try to access
the controller.

Therefore we must resume the controller and exit lpm before do any
write/read operations to the controller registers.
Write helper function to accomplish that and use it upon pullup operation.

CRs-Fixed: 550217
Change-Id: I2c827b241880b1ea9db1c0bd870b16ea9f0b9ca5
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
msm: acpuclock-9625: Use 300MHz for cpu power collapse

If acpu power collapse is taking a long time, it will result in
a USB device compliance test failure due to not satisfy the USB
spec. Therefore, increase the power collapse frequency to address
this issue.

In addition, prepare and enable the always on source gpll0 for
the 300MHz so that the source is always prepared during power
collapse.

Change-Id: Ic67529fde291da7c15035cb6aef1dcf0e178d9a6
Signed-off-by: Tianyi Gou <tgou@codeaurora.org>
Merge "usb: gadget: ci13xxx: ensure exit from lpm on software connect/disconnect"
Merge "msm: acpuclock-9625: Use 300MHz for cpu power collapse"
Merge "USB: ehci-msm-hsic: Allow enabling only SUSPEND SOF workaround"
Merge "USB: ehci-msm-hsic: Allow enabling only RESET SOF workaround"
Merge "ARM: dts: msm: Enable PHY SOF workarounds for MDM9625"