From patchwork Fri Dec 6 23:08:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 298288 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id A8D6F2C009A for ; Sat, 7 Dec 2013 10:08:20 +1100 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Vp4VK-0000n4-RO; Fri, 06 Dec 2013 23:08:14 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Vp4VA-0000im-Gt for kernel-team@lists.ubuntu.com; Fri, 06 Dec 2013 23:08:04 +0000 Received: from c-67-160-231-162.hsd1.ca.comcast.net ([67.160.231.162] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Vp4V9-0004AB-Tp; Fri, 06 Dec 2013 23:08:04 +0000 Received: from kamal by fourier with local (Exim 4.80) (envelope-from ) id 1Vp4V7-0007TF-Ps; Fri, 06 Dec 2013 15:08:01 -0800 From: Kamal Mostafa To: Sebastian Andrzej Siewior Subject: [3.8.y.z extended stable] Patch "usb: musb: cancel work on removal" has been added to staging queue Date: Fri, 6 Dec 2013 15:08:01 -0800 Message-Id: <1386371281-28685-1-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.8.3.2 X-Extended-Stable: 3.8 Cc: Kamal Mostafa , kernel-team@lists.ubuntu.com, Felipe Balbi X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com This is a note to let you know that I have just added a patch titled usb: musb: cancel work on removal to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree which can be found at: http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.8.y-queue This patch is scheduled to be released in version 3.8.13.14. If you, or anyone else, feels it should not be added to this tree, please reply to this email. For more information about the 3.8.y.z tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Kamal ------ From 85a5e64fa5ad4ca0bf7fb73da0d745fb37947784 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 10 Oct 2013 18:26:59 +0200 Subject: usb: musb: cancel work on removal commit c5340bd14336b902604ab95212a8877de109d9ae upstream. So I captured this: |WARNING: CPU: 0 PID: 2078 at /home/bigeasy/work/new/TI/linux/lib/debugobjects.c:260 debug_print_object+0x94/0xc4() |ODEBUG: free active (active state 0) object type: work_struct hint: musb_irq_work+0x0/0x38 [musb_hdrc] |CPU: 0 PID: 2078 Comm: rmmod Not tainted 3.12.0-rc4+ #338 |[] (unwind_backtrace+0x0/0xf4) from [] (show_stack+0x14/0x1c) |[] (show_stack+0x14/0x1c) from [] (warn_slowpath_common+0x64/0x84) |[] (warn_slowpath_common+0x64/0x84) from [] (warn_slowpath_fmt+0x30/0x40) |[] (warn_slowpath_fmt+0x30/0x40) from [] (debug_print_object+0x94/0xc4) |[] (debug_print_object+0x94/0xc4) from [] (debug_check_no_obj_freed+0x1c0/0x228) |[] (debug_check_no_obj_freed+0x1c0/0x228) from [] (kfree+0xf8/0x228) |[] (kfree+0xf8/0x228) from [] (release_nodes+0x1a8/0x248) |[] (release_nodes+0x1a8/0x248) from [] (__device_release_driver+0x98/0xf0) |[] (__device_release_driver+0x98/0xf0) from [] (device_release_driver+0x24/0x34) |[] (device_release_driver+0x24/0x34) from [] (bus_remove_device+0x148/0x15c) |[] (bus_remove_device+0x148/0x15c) from [] (device_del+0x104/0x1c0) |[] (device_del+0x104/0x1c0) from [] (platform_device_del+0x18/0xac) |[] (platform_device_del+0x18/0xac) from [] (platform_device_unregister+0xc/0x18) |[] (platform_device_unregister+0xc/0x18) from [] (dsps_remove+0x20/0x4c [musb_dsps]) |[] (dsps_remove+0x20/0x4c [musb_dsps]) from [] (platform_drv_remove+0x1c/0x24) |[] (platform_drv_remove+0x1c/0x24) from [] (__device_release_driver+0x90/0xf0) |[] (__device_release_driver+0x90/0xf0) from [] (driver_detach+0xb4/0xb8) |[] (driver_detach+0xb4/0xb8) from [] (bus_remove_driver+0x98/0xec) |[] (bus_remove_driver+0x98/0xec) from [] (SyS_delete_module+0x1e0/0x24c) |[] (SyS_delete_module+0x1e0/0x24c) from [] (ret_fast_syscall+0x0/0x48) |---[ end trace d79045419a3e51ec ]--- The workqueue is only scheduled from the ep0 and never canceled in case the musb is removed before the work has a chance to run. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Felipe Balbi [ kamal: backport to 3.8 (context) ] Signed-off-by: Kamal Mostafa --- drivers/usb/musb/musb_core.c | 1 + 1 file changed, 1 insertion(+) -- 1.8.3.2 diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 60b41cc..85b7a91 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1816,6 +1816,7 @@ static void musb_free(struct musb *musb) disable_irq_wake(musb->nIrq); free_irq(musb->nIrq, musb); } + cancel_work_sync(&musb->irq_work); if (is_dma_capable() && musb->dma_controller) { struct dma_controller *c = musb->dma_controller;