Skip to contentSkip to conversation

dmaengine: fix interrupt clearing for mv_xor

PATCH New Simon Guinot 3 participants 3 messages Sep 17, 2010 – Sep 23, 2010 dmaengine

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: fix interrupt clearing for mv_xor

From: Simon Guinot <[email protected]>

When using simultaneously the two DMA channels on a same engine, some transfers are never completed. For example, an endless lock can occur while writing heavily on a RAID5 array (with async-tx offload support enabled).

Note that this issue can also be reproduced by using the DMA test client.

On a same engine, the interrupt cause register is shared between two DMA channels. This patch make sure that the cause bit is only cleared for the requested channel.

---
 drivers/dma/mv_xor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/dma/mv_xor.c +1 -1
index 86c5ae9..411d5bf 100644
@@ -162,7 +162,7 @@ static int mv_is_err_intr(u32 intr_cause)
 
 static void mv_xor_device_clear_eoc_cause(struct mv_xor_chan *chan)
 {
-	u32 val = (1 << (1 + (chan->idx * 16)));
+	u32 val = ~(1 << (chan->idx * 16));
 	dev_dbg(chan->device->common.dev, "%s, val 0x%08x\n", __func__, val);
 	__raw_writel(val, XOR_INTR_CAUSE(chan));
 }
Signature · 1 line
1.6.3.1
#1 lore raw

PATCH 1/1 dmaengine: fix interrupt clearing for mv_xor

Quoted 25 lines · Simon Guinot

From: Simon Guinot <[email protected]>

When using simultaneously the two DMA channels on a same engine, some transfers are never completed. For example, an endless lock can occur while writing heavily on a RAID5 array (with async-tx offload support enabled).

Note that this issue can also be reproduced by using the DMA test client.

On a same engine, the interrupt cause register is shared between two DMA channels. This patch make sure that the cause bit is only cleared for the requested channel.

---
?drivers/dma/mv_xor.c | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)

drivers/dma/mv_xor.c +0 -0
index 86c5ae9..411d5bf 100644

drivers/dma/mv_xor.c static int mv_is_err_intr(u32 intr_cause) · line 168

Quoted 8 lines
drivers/dma/mv_xor.c +1 -1
@@ -162,7 +162,7 @@ static int mv_is_err_intr(u32 intr_cause)
 
 ?static void mv_xor_device_clear_eoc_cause(struct mv_xor_chan *chan)
 ?{
- ? ? ? u32 val = (1 << (1 + (chan->idx * 16)));
+ ? ? ? u32 val = ~(1 << (chan->idx * 16));
 ? ? ? ?dev_dbg(chan->device->common.dev, "%s, val 0x%08x\n", __func__, val);
 ? ? ? ?__raw_writel(val, XOR_INTR_CAUSE(chan));
 ?}

The patch looks fine, it clears the "End Of Descriptor" interrupt that set by mv_chan_unmask_interrupts, and it clears that interrupt by writing 0 only to that one.
saeed

Quoted 4 lines

--
1.6.3.1

Applied
#2 lore raw

PATCH 1/1 dmaengine: fix interrupt clearing for mv_xor

Quoted 27 lines · saeed bishara
Quoted 26 lines · Simon Guinot

From: Simon Guinot <[email protected]>

When using simultaneously the two DMA channels on a same engine, some transfers are never completed. For example, an endless lock can occur while writing heavily on a RAID5 array (with async-tx offload support enabled).

Note that this issue can also be reproduced by using the DMA test client.

On a same engine, the interrupt cause register is shared between two DMA channels. This patch make sure that the cause bit is only cleared for the requested channel.

---
?drivers/dma/mv_xor.c | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)

drivers/dma/mv_xor.c +0 -0
index 86c5ae9..411d5bf 100644
@@ -162,7 +162,7 @@ static int mv_is_err_intr(u32 intr_cause)
 
Quoted 11 lines

drivers/dma/mv_xor.c static int mv_is_err_intr(u32 intr_cause) · line 168

Quoted 7 lines
drivers/dma/mv_xor.c +1 -1
 ?static void mv_xor_device_clear_eoc_cause(struct mv_xor_chan *chan)
 ?{
- ? ? ? u32 val = (1 << (1 + (chan->idx * 16)));
+ ? ? ? u32 val = ~(1 << (chan->idx * 16));
 ? ? ? ?dev_dbg(chan->device->common.dev, "%s, val 0x%08x\n", __func__, val);
 ? ? ? ?__raw_writel(val, XOR_INTR_CAUSE(chan));
 ?}

The patch looks fine, it clears the "End Of Descriptor" interrupt that set by mv_chan_unmask_interrupts, and it clears that interrupt by writing 0 only to that one.
saeed

Thanks, applied with your acked-by.