Received: by 10.223.185.116 with SMTP id b49csp52999wrg; Thu, 8 Mar 2018 12:44:57 -0800 (PST) X-Google-Smtp-Source: AG47ELsdnwfwSsnzwRTo3mz551dUX65KHQ4S8BVXbd5kudAk96QnI6SSxhgTMtbuFOShWCtoeiZT X-Received: by 10.98.186.2 with SMTP id k2mr25866183pff.225.1520541897617; Thu, 08 Mar 2018 12:44:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520541897; cv=none; d=google.com; s=arc-20160816; b=MgyMSuAPA4Pjw+jyG56aMkeMxBug1dxkNIROyANlUxiAhe+tsb3uh3Tw3U27h72f8+ qZefgMaPQJ6lPjrPew5AYkVG3DgrRccWEBNciEcgZP4yFfaqAmYLd/vHNqrzKIf981q6 Sz3JXJ4iPPnwxovji2MzD1BaL20FXLrwknQ8iE4CMgFDDG6WSLolsuqoQXuEDdtB3LCv 86ZW3IyFXyzpmBD7KKHAfVHRhpRO7GqdAlfB3fw9O4YbwvzpVwPEThFjAN7FDEWzm48y x0Cpuvs50lgw82gRyT19iBT70jpFzogFc8EBO3/YzK1krGo8erKKxIGv8XxmXp2WQv48 pLZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=rzi0ReGm+j1tDeBVRZGVj8k1aTO0gCnucida1C3JKtE=; b=0qb9buTAm3yUhG3VyUFc3ySZP+wB3jLtG4TC6geRclv53gIlkIO7AL1SOHn02J46R+ 0YK0i+qq+P7W1Po1L+wgfEZiadwBLwMLiri5cK8sqiW8cZdNxsYuckyiuIXS062hImHj ijgOk/mVTFvSepsUftJaO3NEBAV68cb1xAbSR2Uu8MB4Dg5wUNyb6Lz66Xq/AQH+InUw YHkxYV8kIP2mXcxbqzDei2LDNp5vmK3ZI3z2oEoAX9gIMbSZa99O2Jb0tn50wig9GfUX aiQtEwxs2CD+ZU7iLBrkzwMcCI8VZPKRe6rhh+H9ITHnBipZ88TiZDItQUCQG+QpSafF +j+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si16508542pfl.224.2018.03.08.12.44.42; Thu, 08 Mar 2018 12:44:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751246AbeCHUlY (ORCPT + 99 others); Thu, 8 Mar 2018 15:41:24 -0500 Received: from nala.villavu.com ([188.165.243.101]:50909 "EHLO nala.villavu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751225AbeCHUlV (ORCPT ); Thu, 8 Mar 2018 15:41:21 -0500 Received: from a82-161-36-93.adsl.xs4all.nl ([82.161.36.93] helo=chrometwo.fritz.box) by nala.villavu.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1eu2Lm-0001D8-Qv; Thu, 08 Mar 2018 21:41:18 +0100 From: Merlijn Wajer To: b-liu@ti.com Cc: merlijn@wizzup.org, ivo.g.dimitrov.75@gmail.com, linux-omap@vger.kernel.org, Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: musb: Fix external abort in musb_remove Date: Thu, 8 Mar 2018 21:40:47 +0100 Message-Id: <20180308204049.29474-1-merlijn@wizzup.org> X-Mailer: git-send-email 2.16.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This fixes an oops on unbind / module unload. musb_remove function now calls musb_platform_exit before disabling runtime pm. Signed-off-by: Merlijn Wajer --- drivers/usb/musb/musb_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index e2e95071328a..cf90d34f7199 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -2472,13 +2472,14 @@ static int musb_remove(struct platform_device *pdev) musb_platform_disable(musb); spin_lock_irqsave(&musb->lock, flags); musb_disable_interrupts(musb); - musb_writeb(musb->mregs, MUSB_DEVCTL, 0); spin_unlock_irqrestore(&musb->lock, flags); + musb_writeb(musb->mregs, MUSB_DEVCTL, 0); + 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); -- 2.16.2