Skip to contentSkip to conversation

dma: shdma: add checking the DMAOR_AE in sh_dmae_err

PATCH Superseded Yoshihiro Shimoda 2 participants 3 messages Feb 9, 2011

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dma: shdma: add checking the DMAOR_AE in sh_dmae_err

The irq numbers of tranfer end and address error are assigned same number on some CPU. So the sh_dmae_err() should check the AE flag in DMAOR.

---
 drivers/dma/shdma.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/dma/shdma.c +6 -1
index 28720d3..588b92f 100644
@@ -865,7 +865,12 @@ static unsigned int sh_dmae_reset(struct sh_dmae_device *shdev)
 
 static irqreturn_t sh_dmae_err(int irq, void *data)
 {
-	return IRQ_RETVAL(sh_dmae_reset(data));
+	struct sh_dmae_device *shdev = (struct sh_dmae_device *)data;
+
+	if (dmaor_read(shdev) & DMAOR_AE)
+		return IRQ_RETVAL(sh_dmae_reset(data));
+	else
+		return IRQ_NONE;
 }
 
 static void dmae_do_tasklet(unsigned long data)
Signature · 1 line
1.7.1
#1 lore raw
Quoted 3 lines · Yoshihiro Shimoda

The irq numbers of tranfer end and address error are assigned same number on some CPU. So the sh_dmae_err() should check the AE flag in DMAOR.

Looks ok, but..

drivers/dma/shdma.c static unsigned int sh_dmae_reset(struct sh_dmae_device *shdev) · line 869

Quoted 5 lines

static irqreturn_t sh_dmae_err(int irq, void *data) {

drivers/dma/shdma.c +2 -1
-	return IRQ_RETVAL(sh_dmae_reset(data));
+	struct sh_dmae_device *shdev = (struct sh_dmae_device *)data;
+

Please do not ever cast void pointers, it's completely pointless and just means someone else has to go and tidy up the patch manually.

#2 lore raw
In reply to Yoshihiro Shimoda

Hi Paul,

Quoted 6 lines · Paul Mundt
Quoted 3 lines · Yoshihiro Shimoda

The irq numbers of tranfer end and address error are assigned same number on some CPU. So the sh_dmae_err() should check the AE flag in DMAOR.

Looks ok, but..

Quoted 7 lines

drivers/dma/shdma.c static unsigned int sh_dmae_reset(struct sh_dmae_device *shdev) · line 869

Quoted 5 lines

static irqreturn_t sh_dmae_err(int irq, void *data) {

drivers/dma/shdma.c +2 -1
-	return IRQ_RETVAL(sh_dmae_reset(data));
+	struct sh_dmae_device *shdev = (struct sh_dmae_device *)data;
+

Please do not ever cast void pointers, it's completely pointless and just means someone else has to go and tidy up the patch manually.

Thank you very much for your prompt review.
I understood it. I will send the modified patch soon.

Thanks,
Yoshihiro Shimoda