From patchwork Wed Jul 6 16:35:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 9216669 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1B7A360467 for ; Wed, 6 Jul 2016 16:28:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DD0F27C39 for ; Wed, 6 Jul 2016 16:28:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 020D927C8F; Wed, 6 Jul 2016 16:28:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 965EF27C39 for ; Wed, 6 Jul 2016 16:28:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752482AbcGFQ2q (ORCPT ); Wed, 6 Jul 2016 12:28:46 -0400 Received: from mga09.intel.com ([134.134.136.24]:57174 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751853AbcGFQ2p (ORCPT ); Wed, 6 Jul 2016 12:28:45 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 06 Jul 2016 09:28:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,319,1464678000"; d="scan'208";a="730455922" Received: from vkoul-udesk7.iind.intel.com (HELO localhost) ([10.223.84.143]) by FMSMGA003.fm.intel.com with ESMTP; 06 Jul 2016 09:28:42 -0700 Date: Wed, 6 Jul 2016 22:05:50 +0530 From: Vinod Koul To: okaya@codeaurora.org Cc: dmaengine@vger.kernel.org Subject: Re: [PATCH 29/32] dmaengine: qcom_hidma: kill the tasklets upon exit Message-ID: <20160706163550.GB12591@localhost> References: <1467730478-9696-1-git-send-email-vinod.koul@intel.com> <1467730478-9696-30-git-send-email-vinod.koul@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Jul 06, 2016 at 09:47:50AM +0300, okaya@codeaurora.org wrote: > On 2016-07-05 17:54, Vinod Koul wrote: > >drivers should ensure that tasklets are killed, so that they can't be > >run after driver remove is executed > > > >Signed-off-by: Vinod Koul > >Cc: Sinan Kaya > >--- > > drivers/dma/qcom/hidma.c | 1 + > > 1 file changed, 1 insertion(+) > > > >diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c > >index 41b5c6dee713..b2374cd91e45 100644 > >--- a/drivers/dma/qcom/hidma.c > >+++ b/drivers/dma/qcom/hidma.c > >@@ -708,6 +708,7 @@ static int hidma_remove(struct platform_device > >*pdev) > > pm_runtime_get_sync(dmadev->ddev.dev); > > dma_async_device_unregister(&dmadev->ddev); > > devm_free_irq(dmadev->ddev.dev, dmadev->irq, dmadev->lldev); > >+ tasklet_kill(&dmadev->task); > > hidma_debug_uninit(dmadev); > > hidma_ll_uninit(dmadev->lldev); > > hidma_free(dmadev); > > Acked-by: Sinan Kaya > > Thanks for taking care of this. We also need one more tasklet_kill > for rst_task in hidma_ll.c Looks like it it two? Am adding this one: Thanks diff --git a/drivers/dma/qcom/hidma_ll.c b/drivers/dma/qcom/hidma_ll.c index f3929001539b..e8323c8e23d5 100644 --- a/drivers/dma/qcom/hidma_ll.c +++ b/drivers/dma/qcom/hidma_ll.c @@ -831,6 +831,8 @@ int hidma_ll_uninit(struct hidma_lldev *lldev) required_bytes = sizeof(struct hidma_tre) * lldev->nr_tres; tasklet_kill(&lldev->task); + tasklet_kill(&lldev->rst_task); + tasklet_kill(&lldev->task); memset(lldev->trepool, 0, required_bytes); lldev->trepool = NULL; lldev->pending_tre_count = 0;