summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc2/hcd.c
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2021-07-16 07:01:27 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-21 09:50:27 +0200
commitc4a0f7a6ab5417eb6105b0e1d7e6e67f6ef7d4e5 (patch)
treec76e19bf4a054c1bcb733d599a8f38c8b8a73b65 /drivers/usb/dwc2/hcd.c
parentusb: renesas_usbhs: Fix superfluous irqs happen after usb_pkt_pop() (diff)
downloadlinux-c4a0f7a6ab5417eb6105b0e1d7e6e67f6ef7d4e5.tar.xz
linux-c4a0f7a6ab5417eb6105b0e1d7e6e67f6ef7d4e5.zip
usb: dwc2: Skip clock gating on Samsung SoCs
Commit 0112b7ce68ea ("usb: dwc2: Update dwc2_handle_usb_suspend_intr function.") changed the way the driver handles power down modes in a such way that it uses clock gating when no other power down mode is available. This however doesn't work well on the DWC2 implementation used on the Samsung SoCs. When a clock gating is enabled, system hangs. It looks that the proper clock gating requires some additional glue code in the shared USB2 PHY and/or Samsung glue code for the DWC2. To restore driver operation on the Samsung SoCs simply skip enabling clock gating mode until one finds what is really needed to make it working reliably. Fixes: 0112b7ce68ea ("usb: dwc2: Update dwc2_handle_usb_suspend_intr function.") Cc: stable <stable@vger.kernel.org> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Link: https://lore.kernel.org/r/20210716050127.4406-1-m.szyprowski@samsung.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/dwc2/hcd.c')
-rw-r--r--drivers/usb/dwc2/hcd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index 035d4911a3c3..2a7828971d05 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -3338,7 +3338,8 @@ int dwc2_port_suspend(struct dwc2_hsotg *hsotg, u16 windex)
* If not hibernation nor partial power down are supported,
* clock gating is used to save power.
*/
- dwc2_host_enter_clock_gating(hsotg);
+ if (!hsotg->params.no_clock_gating)
+ dwc2_host_enter_clock_gating(hsotg);
break;
}
@@ -4402,7 +4403,8 @@ static int _dwc2_hcd_suspend(struct usb_hcd *hcd)
* If not hibernation nor partial power down are supported,
* clock gating is used to save power.
*/
- dwc2_host_enter_clock_gating(hsotg);
+ if (!hsotg->params.no_clock_gating)
+ dwc2_host_enter_clock_gating(hsotg);
/* After entering suspend, hardware is not accessible */
clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);