linux/drivers/usb/dwc2
Tomas Marek 4f7908ebaf usb: dwc2: drd: fix clock gating on USB role switch
commit 2c6b6afa59 upstream.

The dwc2_handle_usb_suspend_intr() function disables gadget clocks in USB
peripheral mode when no other power-down mode is available (introduced by
commit 0112b7ce68 ("usb: dwc2: Update dwc2_handle_usb_suspend_intr function.")).
However, the dwc2_drd_role_sw_set() USB role update handler attempts to
read DWC2 registers if the USB role has changed while the USB is in suspend
mode (when the clocks are gated). This causes the system to hang.

Release the gadget clocks before handling the USB role update.

Fixes: 0112b7ce68 ("usb: dwc2: Update dwc2_handle_usb_suspend_intr function.")
Cc: stable@vger.kernel.org
Signed-off-by: Tomas Marek <tomas.marek@elrest.cz>
Link: https://lore.kernel.org/r/20240906055025.25057-1-tomas.marek@elrest.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2024-10-04 16:29:50 +02:00
..
core.c usb: dwc2: Remove redundant license text 2022-09-22 15:52:29 +02:00
core.h usb: dwc2: gadget: LPM flow fix 2024-04-03 15:29:00 +02:00
core_intr.c usb: dwc2: gadget: LPM flow fix 2024-04-03 15:29:00 +02:00
debug.h USB: dwc2: Use the correct style for SPDX License Identifier 2020-05-05 10:58:50 +03:00
debugfs.c usb: dwc2: add otg_rev and otg_caps information for gadget driver 2021-10-25 09:20:26 +02:00
drd.c usb: dwc2: drd: fix clock gating on USB role switch 2024-10-04 16:29:50 +02:00
gadget.c usb: dwc2: gadget: LPM flow fix 2024-04-03 15:29:00 +02:00
hcd.c usb: dwc2: gadget: Fix exiting from clock gating 2024-04-03 15:29:00 +02:00
hcd.h usb: dwc2: Remove redundant license text 2022-09-22 15:52:29 +02:00
hcd_ddma.c usb: dwc2: host: Fix dereference issue in DDMA completion flow. 2024-04-27 17:11:40 +02:00
hcd_intr.c USB: dwc2: write HCINT with INTMASK applied 2023-12-03 07:33:10 +01:00
hcd_queue.c usb: dwc2: Fix spelling mistake "schduler" -> "scheduler" 2023-03-29 09:02:14 +02:00
hw.h usb: dwc2: host: Fix ISOC flow in DDMA mode 2024-04-03 15:29:00 +02:00
Kconfig usb: dwc2: override PHY input signals with usb role switch support 2020-10-02 13:29:13 +03:00
Makefile usb: dwc2: override PHY input signals with usb role switch support 2020-10-02 13:29:13 +03:00
params.c usb: dwc2: add pci_device_id driver_data parse support 2023-08-22 14:49:12 +02:00
pci.c usb: dwc2: add pci_device_id driver_data parse support 2023-08-22 14:49:12 +02:00
platform.c usb: dwc2: gadget: Fix exiting from clock gating 2024-04-03 15:29:00 +02:00