From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754341AbbGWRTl (ORCPT ); Thu, 23 Jul 2015 13:19:41 -0400 Received: from mga09.intel.com ([134.134.136.24]:61402 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752577AbbGWRTj (ORCPT ); Thu, 23 Jul 2015 13:19:39 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,532,1432623600"; d="scan'208";a="753230127" Date: Thu, 23 Jul 2015 22:51:10 +0530 From: Vinod Koul To: Alex Smith Cc: Julia Lawall , Zubair.Kakakhel@imgtec.com, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: question about drivers/dma/dma-jz4780.c Message-ID: <20150723172110.GB29916@localhost> References: <55ACAEC5.7090000@imgtec.com> <20150721041558.GE23525@localhost> <55AFA7F9.20600@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55AFA7F9.20600@imgtec.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 22, 2015 at 03:26:01PM +0100, Alex Smith wrote: > >>>I think the explicit devm_free_irq() here is unnecessary, as when remove is > >>>called there should be no remaining users of the DMA controller and therefore > >>>no chance of an IRQ occurring between the controller being unregistered and an > >>>implicit IRQ release afterwards. > >Are you ensuring that device can no longer sent interrupts and all instances > >of tasklet running or either completed are terminated and no further tasklet > >can be spawned? > > Hi Vinod, > > If I understand correctly, when remove() is called, there should be > no more users of the DMA controller, enforced by the module > reference count. > > Wouldn't that guarantee that there are no more transactions running > and therefore no chance of an interrupt from the controller or a > tasklet still running? That will only guarantee no new requests are recieved, but you may have tasklet already scheduled or irq sent from HW how do you prevent that? -- ~Vinod