From: Andy Gross <agross@codeaurora.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Vinod Koul <vinod.koul@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
dmaengine@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org
Subject: Re: [Patch v4 1/2] dmaengine: add Qualcomm BAM dma driver
Date: Tue, 4 Feb 2014 13:24:26 -0600 [thread overview]
Message-ID: <20140204192426.GA16943@qualcomm.com> (raw)
In-Reply-To: <52F0D5E1.3040409@metafoo.de>
On Tue, Feb 04, 2014 at 12:58:25PM +0100, Lars-Peter Clausen wrote:
> On 02/04/2014 12:04 AM, Andy Gross wrote:
> [...]
> >+static int bam_dma_remove(struct platform_device *pdev)
> >+{
> >+ struct bam_device *bdev = platform_get_drvdata(pdev);
> >+ u32 i;
> >+
> >+ dma_async_device_unregister(&bdev->common);
> >+ of_dma_controller_free(pdev->dev.of_node);
>
> The controller should first be removed from the of lookup table,
> then free the device.
>
Ah right, had this reversed.
> >+
> >+ /* mask all interrupts for this execution environment */
> >+ writel_relaxed(0, bdev->regs + BAM_IRQ_SRCS_MSK_EE(bdev->ee));
>
> You still need to free the interrupt to make this race free,
> especially on a multi-processor system. free_irq() acts as a
> synchronization point that makes sure that interrupt handler has
> finished running and that no new interrupt handlers are being run
> after this point. Just masking the interrupt in the control register
> does not provide these guarantees.
ok i'll just add in a devm_free_irq(). The only good thing then about using the
devm_request_irq is the cleanup on error paths in the probe.
> >+
> >+ for (i = 0; i < bdev->num_channels; i++) {
> >+ bam_dma_terminate_all(&bdev->channels[i]);
> >+ tasklet_kill(&bdev->channels[i].vc.task);
> >+ }
> >+
> >+ tasklet_kill(&bdev->task);
> >+
> >+ clk_disable_unprepare(bdev->bamclk);
> >+
> >+ return 0;
> >+}
> [...]
>
--
sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
next prev parent reply other threads:[~2014-02-04 19:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-03 23:04 [Patch v4 0/2] Add Qualcomm BAM dmaengine driver Andy Gross
2014-02-03 23:04 ` [Patch v4 1/2] dmaengine: add Qualcomm BAM dma driver Andy Gross
2014-02-04 11:58 ` Lars-Peter Clausen
2014-02-04 19:24 ` Andy Gross [this message]
2014-02-03 23:04 ` [Patch v4 2/2] dmaengine: qcom_bam_dma: Add device tree binding Andy Gross
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=20140204192426.GA16943@qualcomm.com \
--to=agross@codeaurora.org \
--cc=dan.j.williams@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vinod.koul@intel.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;
as well as URLs for NNTP newsgroup(s).