From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Dan Williams <dan.j.williams@intel.com>,
Vinod Koul <vinod.koul@intel.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org,
Maxime Ripard <maxime.ripard@free-electrons.com>
Subject: [PATCH 2/3] dmaengine: sun6i: Free the interrupt before killing the tasklet
Date: Wed, 30 Jul 2014 10:30:22 +0200 [thread overview]
Message-ID: <1406709023-7650-3-git-send-email-maxime.ripard@free-electrons.com> (raw)
In-Reply-To: <1406709023-7650-1-git-send-email-maxime.ripard@free-electrons.com>
There's still a small window between the call to sun6i_kill_tasklet and the end
of the driver remove function where a spurious interrupt might trigger, and
start using deallocated resources.
Replace the call to synchronize_irq by a free_irq, so that we're sure that we
won't get any further interrupts when we're deallocating resources.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
drivers/dma/sun6i-dma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
index 609c5d8cb947..63a1db38894e 100644
--- a/drivers/dma/sun6i-dma.c
+++ b/drivers/dma/sun6i-dma.c
@@ -836,8 +836,8 @@ static inline void sun6i_kill_tasklet(struct sun6i_dma_dev *sdev)
/* Prevent spurious interrupts from scheduling the tasklet */
atomic_inc(&sdev->tasklet_shutdown);
- /* Make sure all interrupts are handled */
- synchronize_irq(sdev->irq);
+ /* Make sure we won't have any further interrupts */
+ devm_free_irq(sdev->slave.dev, sdev->irq, sdev);
/* Actually prevent the tasklet from being scheduled */
tasklet_kill(&sdev->task);
--
2.0.2
next prev parent reply other threads:[~2014-07-30 8:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-30 8:30 [PATCH 0/3] dmaengine: sun6i: Misc fixes for the dma driver Maxime Ripard
2014-07-30 8:30 ` [PATCH 1/3] dmaengine: sun6i: Remove switch statement from buswidth convertion routine Maxime Ripard
2014-07-30 8:30 ` Maxime Ripard [this message]
2014-07-30 8:30 ` [PATCH 3/3] dmaengine: sun6i: Fix memory leaks Maxime Ripard
2014-07-30 13:44 ` [PATCH 0/3] dmaengine: sun6i: Misc fixes for the dma driver Vinod Koul
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=1406709023-7650-3-git-send-email-maxime.ripard@free-electrons.com \
--to=maxime.ripard@free-electrons.com \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.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
all inboxes | Powered by JetHome®