Skip to contentSkip to conversation

dmaengine fixes for 2.6.36-rc7

GIT Dan Williams 1 participant 1 message Sep 30, 2010 dmaengine

lore
Share & tools
lore
#0 lore raw

Hi Linus, please pull from:

git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx.git fixes

...to receive some small fixes to drivers/dma/. The mv_xor fix is tagged for -stable. Full changelog below.

Thanks,
Dan

Dan Carpenter (1):
dma/shdma: move dereference below the NULL check

Mathieu Lacage (1):
missing inline keyword for static function in linux/dmaengine.h

Simon Guinot (1):
dmaengine: fix interrupt clearing for mv_xor

 drivers/dma/mv_xor.c      |    2 +-
 drivers/dma/shdma.c       |    3 ++-
 include/linux/dmaengine.h |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

commit cc60f8878eab892c03d06b10f389232b9b66bd83

Author: Simon Guinot <[email protected]>
Date:   Fri Sep 17 23:33:51 2010 +0200

dmaengine: fix interrupt clearing for mv_xor

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.

commit d3f3cf859db17cc5f8156c5bfcd032413e44483b

Author: Mathieu Lacage <[email protected]>
Date:   Sat Aug 14 15:02:44 2010 +0200

missing inline keyword for static function in linux/dmaengine.h

Add a missing inline keyword for static function in linux/dmaengine.h to avoid duplicate symbol definitions.

commit 9f9ff20d46c6728b092f34b6a642e1e81ab5e254

Author: Dan Carpenter <[email protected]>
Date:   Sat Aug 14 11:01:45 2010 +0200

dma/shdma: move dereference below the NULL check

"param" can be NULL here, so only dereference it after the check.

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));
 }
drivers/dma/shdma.c +2 -1
index fb64cf3..eb6b54d 100644
@@ -580,7 +580,6 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg(
 
 	sh_chan = to_sh_chan(chan);
 	param = chan->private;
-	slave_addr = param->config->addr;
 
 	/* Someone calling slave DMA on a public channel? */
 	if (!param || !sg_len) {
@@ -589,6 +588,8 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg(
 		return NULL;
 	}
 
+	slave_addr = param->config->addr;
+
 	/*
 	 * if (param != NULL), this is a successfully requested slave channel,
 	 * therefore param->config != NULL too.
include/linux/dmaengine.h +1 -1
index c61d4ca..e210649 100644
@@ -548,7 +548,7 @@ static inline bool dma_dev_has_pq_continue(struct dma_device *dma)
 	return (dma->max_pq & DMA_HAS_PQ_CONTINUE) == DMA_HAS_PQ_CONTINUE;
 }
 
-static unsigned short dma_dev_to_maxpq(struct dma_device *dma)
+static inline unsigned short dma_dev_to_maxpq(struct dma_device *dma)
 {
 	return dma->max_pq & ~DMA_HAS_PQ_CONTINUE;
 }