Skip to content

Commit 568262b

Browse files
Sandeep Maheswaramgregkh
authored andcommitted
usb: dwc3: core: Add shutdown callback for dwc3
This patch adds a shutdown callback to USB DWC core driver to ensure that it is properly shutdown in reboot/shutdown path. This is required where SMMU address translation is enabled like on SC7180 SoC and few others. If the hardware is still accessing memory after SMMU translation is disabled as part of SMMU shutdown callback in system reboot or shutdown path, then IOVAs(I/O virtual address) which it was using will go on the bus as the physical addresses which might result in unknown crashes (NoC/interconnect errors). Acked-by: Felipe Balbi <[email protected]> Signed-off-by: Sandeep Maheswaram <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e66bbfb commit 568262b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/usb/dwc3/core.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,6 +1658,11 @@ static int dwc3_remove(struct platform_device *pdev)
16581658
return 0;
16591659
}
16601660

1661+
static void dwc3_shutdown(struct platform_device *pdev)
1662+
{
1663+
dwc3_remove(pdev);
1664+
}
1665+
16611666
#ifdef CONFIG_PM
16621667
static int dwc3_core_init_for_resume(struct dwc3 *dwc)
16631668
{
@@ -1975,6 +1980,7 @@ MODULE_DEVICE_TABLE(acpi, dwc3_acpi_match);
19751980
static struct platform_driver dwc3_driver = {
19761981
.probe = dwc3_probe,
19771982
.remove = dwc3_remove,
1983+
.shutdown = dwc3_shutdown,
19781984
.driver = {
19791985
.name = "dwc3",
19801986
.of_match_table = of_match_ptr(of_dwc3_match),

0 commit comments

Comments
 (0)