From: Vinod Koul <vinod.koul@intel.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: Alex Smith <alex.smith@imgtec.com>,
Zubair.Kakakhel@imgtec.com, dmaengine@vger.kernel.org,
Vaishali Thakkar <vthakkar1994@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: question about drivers/dma/dma-jz4780.c
Date: Fri, 24 Jul 2015 11:12:26 +0530 [thread overview]
Message-ID: <20150724054226.GO29916@localhost> (raw)
In-Reply-To: <alpine.DEB.2.10.1507231920360.2450@hadrien>
On Thu, Jul 23, 2015 at 07:24:10PM +0200, Julia Lawall wrote:
>
>
> On Thu, 23 Jul 2015, Vinod Koul wrote:
>
> > 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?
>
> More genrally, I have seen another driver with synchronize_irq in the
> remove function (dma/img-mdc-dma.c). Would that be safe enough? On the
> other hand, if one is going to go to the trouble of putting that, maybe
> one would do just as well to drop the devm for irqs and use free_irq in
> place of synchronize_irq instead?
synchronize_irq() will take care of irq but not tasklet right. Also irq can
be triggered again as you haven't disabled that yet.
Is it really worth the trouble going though hoops to ensure your device is
in right state, so might be simpler to free the irq and kill tasklet
Yes for dmaengine drivers I do ask this question which typically ends up in
driver invoking devm_irq_free() in driver's remove callback
IMHO don't think devm irq calls are very useful, they do make stuff complicated
--
~Vinod
next prev parent reply other threads:[~2015-07-24 5:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-19 9:08 question about drivers/dma/dma-jz4780.c Julia Lawall
2015-07-20 8:18 ` Alex Smith
2015-07-20 8:28 ` Julia Lawall
2015-07-21 4:15 ` Vinod Koul
2015-07-22 14:26 ` Alex Smith
2015-07-23 17:21 ` Vinod Koul
2015-07-23 17:24 ` Julia Lawall
2015-07-24 5:42 ` Vinod Koul [this message]
2015-07-24 5:51 ` Julia Lawall
2015-07-24 6:30 ` Vinod Koul
2015-07-24 6:49 ` Julia Lawall
2015-07-24 8:28 ` Alex Smith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150724054226.GO29916@localhost \
--to=vinod.koul@intel.com \
--cc=Zubair.Kakakhel@imgtec.com \
--cc=alex.smith@imgtec.com \
--cc=dmaengine@vger.kernel.org \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=vthakkar1994@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox