Commit 7838de1
usb: dwc3: core: remove lock of otg mode during gadget suspend/resume to avoid deadlock
When config CONFIG_USB_DWC3_DUAL_ROLE is selected, and trigger system
to enter suspend status with below command:
echo mem > /sys/power/state
There will be a deadlock issue occurring. Detailed invoking path as
below:
dwc3_suspend_common()
spin_lock_irqsave(&dwc->lock, flags); <-- 1st
dwc3_gadget_suspend(dwc);
dwc3_gadget_soft_disconnect(dwc);
spin_lock_irqsave(&dwc->lock, flags); <-- 2nd
This issue is exposed by commit c7ebd81 ("usb: dwc3: gadget: Fix
NULL pointer dereference in dwc3_gadget_suspend") that removes the code
of checking whether dwc->gadget_driver is NULL or not. It causes the
following code is executed and deadlock occurs when trying to get the
spinlock. In fact, the root cause is the commit 5265397("usb: dwc3:
Remove DWC3 locking during gadget suspend/resume") that forgot to remove
the lock of otg mode. So, remove the redundant lock of otg mode during
gadget suspend/resume.
Fixes: 5265397 ("usb: dwc3: Remove DWC3 locking during gadget suspend/resume")
Cc: Xu Yang <[email protected]>
Cc: [email protected]
Signed-off-by: Meng Li <[email protected]>
Acked-by: Thinh Nguyen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent c689426 commit 7838de1
1 file changed
+0
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2250 | 2250 | | |
2251 | 2251 | | |
2252 | 2252 | | |
2253 | | - | |
2254 | 2253 | | |
2255 | 2254 | | |
2256 | 2255 | | |
| |||
2293 | 2292 | | |
2294 | 2293 | | |
2295 | 2294 | | |
2296 | | - | |
2297 | 2295 | | |
2298 | | - | |
2299 | 2296 | | |
2300 | 2297 | | |
2301 | 2298 | | |
| |||
2312 | 2309 | | |
2313 | 2310 | | |
2314 | 2311 | | |
2315 | | - | |
2316 | 2312 | | |
2317 | 2313 | | |
2318 | 2314 | | |
| |||
2366 | 2362 | | |
2367 | 2363 | | |
2368 | 2364 | | |
2369 | | - | |
2370 | 2365 | | |
2371 | | - | |
2372 | 2366 | | |
2373 | 2367 | | |
2374 | 2368 | | |
| |||
0 commit comments