Commit 732f35c
usb: host: tegra: Prevent host controller crash when OTG port is used
When a USB device is connected to the OTG port, the tegra_xhci_id_work()
routine transitions the PHY to host mode and calls xhci_hub_control()
with the SetPortFeature command to enable port power.
In certain cases, the XHCI controller may be in a low-power state
when this operation occurs. If xhci_hub_control() is invoked while
the controller is suspended, the PORTSC register may return 0xFFFFFFFF,
indicating a read failure. This causes xhci_hc_died() to be triggered,
leading to host controller shutdown.
Example backtrace:
[ 105.445736] Workqueue: events tegra_xhci_id_work
[ 105.445747] dump_backtrace+0x0/0x1e8
[ 105.445759] xhci_hc_died.part.48+0x40/0x270
[ 105.445769] tegra_xhci_set_port_power+0xc0/0x240
[ 105.445774] tegra_xhci_id_work+0x130/0x240
To prevent this, ensure the controller is fully resumed before
interacting with hardware registers by calling pm_runtime_get_sync()
prior to the host mode transition and xhci_hub_control().
Fixes: f836e78 ("usb: xhci-tegra: Add OTG support")
Cc: stable <[email protected]>
Signed-off-by: Jim Lin <[email protected]>
Signed-off-by: Wayne Chang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 241e2ce commit 732f35c
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1364 | 1364 | | |
1365 | 1365 | | |
1366 | 1366 | | |
| 1367 | + | |
1367 | 1368 | | |
1368 | 1369 | | |
1369 | 1370 | | |
| |||
1393 | 1394 | | |
1394 | 1395 | | |
1395 | 1396 | | |
| 1397 | + | |
1396 | 1398 | | |
1397 | 1399 | | |
1398 | 1400 | | |
1399 | 1401 | | |
1400 | 1402 | | |
1401 | 1403 | | |
1402 | 1404 | | |
| 1405 | + | |
1403 | 1406 | | |
1404 | 1407 | | |
1405 | 1408 | | |
| |||
0 commit comments