Re: [PATCH 29/30] spi: s3c64xx: move to generic dmaengine API

From: Mark Brown
Date: Thu Apr 18 2013 - 12:46:52 EST


On Wed, Apr 17, 2013 at 10:05:35PM +0200, Arnd Bergmann wrote:
> On Thursday 11 April 2013, Arnd Bergmann wrote:

> > + use_dma = 0;
> > + if (sdd->rx_dma.ch && sdd->tx_dma.ch &&
> > + (xfer->len > ((FIFO_LVL_MASK(sdd) >> 1) + 1)))
> > use_dma = 1;

> Can you try just reverting this hunk? It's actually not required and
> comes from an earlier version of the patch. I assumed it was harmless,
> but it's the only think I see that should actually make a difference
> in my patch for the case of !CONFIG_SAMSUNG_DMADEV.

That's not it, the checks are now needed - otherwise we get a null
pointer dereference in prepare_dma() instead. What's actually gone
wrong is that your ifdefs are for SAMSUNG_DMADEV instead of S3C_DMA
so s3c64xx is trying to use dmaengine. The driver doesn't actually
check to see if it failed to get the channels so it then tries to do the
transfer with a missing channel which unsurprisingly fails.

Attachment: signature.asc
Description: Digital signature