From: Merlijn Wajer Date: Tue, 13 Mar 2018 14:48:40 +0000 (-0500) Subject: usb: musb: Fix external abort in musb_remove on omap2430 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1f52b0c642157bafda295c16a4650b4f0c26f4d1;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git usb: musb: Fix external abort in musb_remove on omap2430 commit 94e46a4f2d5eb14059e42f313c098d4854847376 upstream. This fixes an oops on unbind / module unload (on the musb omap2430 platform). musb_remove function now calls musb_platform_exit before disabling runtime pm. Signed-off-by: Merlijn Wajer Signed-off-by: Bin Liu Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 7af7cdf1c812..ff17e94ef465 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -2498,11 +2498,11 @@ static int musb_remove(struct platform_device *pdev) musb_disable_interrupts(musb); musb_writeb(musb->mregs, MUSB_DEVCTL, 0); spin_unlock_irqrestore(&musb->lock, flags); + musb_platform_exit(musb); pm_runtime_dont_use_autosuspend(musb->controller); pm_runtime_put_sync(musb->controller); pm_runtime_disable(musb->controller); - musb_platform_exit(musb); musb_phy_callback = NULL; if (musb->dma_controller) musb_dma_controller_destroy(musb->dma_controller);