From: "Juha Yrjölä" <juha.yrjola@solidboot.com>
To: linux-omap@vger.kernel.org
Subject: [PATCH] ARM OMAP: Fix race in OMAP2/3 DMA IRQ handling
Date: Wed, 21 Jan 2009 19:24:09 +0200 [thread overview]
Message-ID: <20090121172409.GA23967@mail.solidboot.com> (raw)
CSR must be cleared before invoking the callback.
If the callback function starts a new, fast DMA transfer on the same
channel, the completion status might lost if CSR is cleared after
the callback invocation.
Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
---
arch/arm/plat-omap/dma.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 8e6475d..265351b 100755
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -1898,11 +1898,11 @@ static int omap2_dma_handle_ch(int ch)
status = dma_read(CSR(ch));
}
+ dma_write(status, CSR(ch));
+
if (likely(dma_chan[ch].callback != NULL))
dma_chan[ch].callback(ch, status, dma_chan[ch].data);
- dma_write(status, CSR(ch));
-
return 0;
}
--
1.5.6.5
next reply other threads:[~2009-01-21 17:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-21 17:24 Juha Yrjölä [this message]
2009-01-22 3:51 ` [PATCH] ARM OMAP: Fix race in OMAP2/3 DMA IRQ handling Shilimkar, Santosh
2009-01-22 8:13 ` Juha Yrjola
2009-01-23 1:27 ` Tony Lindgren
2009-01-23 4:35 ` Shilimkar, Santosh
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=20090121172409.GA23967@mail.solidboot.com \
--to=juha.yrjola@solidboot.com \
--cc=linux-omap@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.