From patchwork Sun Sep 15 23:53:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 11146217 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8186014E5 for ; Sun, 15 Sep 2019 23:53:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6A52E20665 for ; Sun, 15 Sep 2019 23:53:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727273AbfIOXxT (ORCPT ); Sun, 15 Sep 2019 19:53:19 -0400 Received: from muru.com ([72.249.23.125]:33052 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727109AbfIOXxS (ORCPT ); Sun, 15 Sep 2019 19:53:18 -0400 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id BA4B480BB; Sun, 15 Sep 2019 23:53:49 +0000 (UTC) From: Tony Lindgren To: Bin Liu Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH] usb: musb: Cancel delayed work on host controller rmmod Date: Sun, 15 Sep 2019 16:53:15 -0700 Message-Id: <20190915235315.54749-1-tony@atomide.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org If we rmmod the musb host controller with gadgets configured, musb_gadget_stop() gets called. We need to also flush the delayed work. Fixes: 2bff3916fda9 ("usb: musb: Fix PM for hub disconnect") Signed-off-by: Tony Lindgren --- drivers/usb/musb/musb_gadget.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -1910,6 +1910,7 @@ static int musb_gadget_stop(struct usb_gadget *g) /* Force check of devctl register for PM runtime */ schedule_delayed_work(&musb->irq_work, 0); + flush_delayed_work(&musb->irq_work); pm_runtime_mark_last_busy(musb->controller); pm_runtime_put_autosuspend(musb->controller);