Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1401369
| From | Jiada Wang <jiada_wang@mentor.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 10/10] dma: imx-sdma: clear channel0 interrupt bit in irq routine |
| Date | 2016-05-16 10:40 +0200 |
| Message-ID | <rzmee-4Dx-23@gated-at.bofh.it> (permalink) |
| References | <rzmed-4Dx-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
When SDMA channel0 timeouts, even it's disabled in error path,
but sometimes we still see its interrupt bit be asserted,
which causes irq routine be triggered continuously because
no one else clears this bit.
This commit clears channel0 interrupt as well in irq routine,
so that even channel0 timeouts, it won't cause irq storm,
also adds lock to prevent irq routine to clear this bit when
sdma_run_channel0() is busy checking it.
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
---
drivers/dma/imx-sdma.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 8b20bf4..ca1c984 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -768,12 +768,16 @@ static void sdma_tasklet(unsigned long data)
static irqreturn_t sdma_int_handler(int irq, void *dev_id)
{
struct sdma_engine *sdma = dev_id;
- unsigned long stat;
+ unsigned long stat, flags;
+
+ spin_lock_irqsave(&sdma->channel_0_lock, flags);
stat = readl_relaxed(sdma->regs + SDMA_H_INTR);
+ writel_relaxed(stat, sdma->regs + SDMA_H_INTR);
/* not interested in channel 0 interrupts */
stat &= ~1;
- writel_relaxed(stat, sdma->regs + SDMA_H_INTR);
+
+ spin_unlock_irqrestore(&sdma->channel_0_lock, flags);
while (stat) {
int channel = fls(stat) - 1;
--
2.4.5
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v1 00/10] *** imx-sdma: misc fix *** Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:40 +0200 [PATCH 06/10] dma: imx-sdma: add terminate_all support Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:40 +0200 [PATCH 02/10] dma: imx-sdma: don't update BD in isr routine Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:40 +0200 [PATCH 08/10] dma: imx-sdma: abort updating channel when it has been terminated Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:40 +0200 [PATCH 10/10] dma: imx-sdma: clear channel0 interrupt bit in irq routine Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:40 +0200 [PATCH 07/10] dma: imx-sdma: Add synchronization support Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:40 +0200 [PATCH 01/10] dma: imx-sdma: use chn_real_count to report residue for UART Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:50 +0200 [PATCH 05/10] dma: imx-sdma: add flag to indicate SDMA channel state Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:50 +0200 [PATCH 03/10] dma: imx-sdma: clear BD_RROR flag before pass it to sdma script Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:50 +0200 Re: [PATCH v1 00/10] *** imx-sdma: misc fix *** Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> - 2016-05-16 13:10 +0200
csiph-web