Skip to content

Commit a24d507

Browse files
macpaul-lin-mtkgregkh
authored andcommitted
usb: host: xhci-mtk: avoid runtime suspend when removing hcd
When runtime suspend was enabled, runtime suspend might happen when xhci is removing hcd. This might cause kernel panic when hcd has been freed but runtime pm suspend related handle need to reference it. Signed-off-by: Macpaul Lin <[email protected]> Reviewed-by: Chunfeng Yun <[email protected]> Cc: [email protected] Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a73d9d9 commit a24d507

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/usb/host/xhci-mtk.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,9 @@ static int xhci_mtk_remove(struct platform_device *dev)
587587
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
588588
struct usb_hcd *shared_hcd = xhci->shared_hcd;
589589

590+
pm_runtime_put_noidle(&dev->dev);
591+
pm_runtime_disable(&dev->dev);
592+
590593
usb_remove_hcd(shared_hcd);
591594
xhci->shared_hcd = NULL;
592595
device_init_wakeup(&dev->dev, false);
@@ -597,8 +600,6 @@ static int xhci_mtk_remove(struct platform_device *dev)
597600
xhci_mtk_sch_exit(mtk);
598601
xhci_mtk_clks_disable(mtk);
599602
xhci_mtk_ldos_disable(mtk);
600-
pm_runtime_put_sync(&dev->dev);
601-
pm_runtime_disable(&dev->dev);
602603

603604
return 0;
604605
}

0 commit comments

Comments
 (0)