From: Julia Lawall <julia.lawall@lip6.fr>
To: Alex Smith <alex.smith@imgtec.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
Zubair.Kakakhel@imgtec.com, dmaengine@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: question about drivers/dma/dma-jz4780.c
Date: Mon, 20 Jul 2015 10:28:14 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.10.1507201027560.2408@hadrien> (raw)
In-Reply-To: <55ACAEC5.7090000@imgtec.com>
On Mon, 20 Jul 2015, Alex Smith wrote:
> On 19/07/2015 10:08, Julia Lawall wrote:
> > The file drivers/dma/dma-jz4780.c has a probe function that sets up irqs
> > using devm_request_irq. The probe function then ends with:
> >
> > err_unregister_dev:
> > dma_async_device_unregister(dd);
> >
> > err_disable_clk:
> > clk_disable_unprepare(jzdma->clk);
> > return ret;
> > }
> >
> > The remove function, on the other hand contains:
> >
> > of_dma_controller_free(pdev->dev.of_node);
> > devm_free_irq(&pdev->dev, jzdma->irq, jzdma);
> > dma_async_device_unregister(&jzdma->dma_device);
> >
> > The need for calling devm_free_irq explicitly would be that it needs to
> > occur before dma_async_device_unregister, to eg avoid a reference to a
> > dangling pointer. But devm_free_irq is implicitly called after the call
> > to dma_async_device_unregister at the end of the probe function. Which
> > one is correct?
> >
> > julia
>
> Hi,
>
> 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.
>
> I recently sent a series of fixes for this driver, I will send a new version
> with a patch to remove the unnecessary free.
Great. Thanks.
julia
next prev parent reply other threads:[~2015-07-20 8:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-19 9:08 Julia Lawall
2015-07-20 8:18 ` Alex Smith
2015-07-20 8:28 ` Julia Lawall [this message]
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
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=alpine.DEB.2.10.1507201027560.2408@hadrien \
--to=julia.lawall@lip6.fr \
--cc=Zubair.Kakakhel@imgtec.com \
--cc=alex.smith@imgtec.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®