Re: [PATCH] mmc: mmci: Allow MMCI to request channels withinformation acquired from DT

From: Russell King - ARM Linux
Date: Thu Apr 18 2013 - 04:16:18 EST


On Thu, Apr 18, 2013 at 09:02:38AM +0100, Lee Jones wrote:
> @@ -321,19 +323,21 @@ static void mmci_dma_setup(struct mmci_host *host)
> * attempt to use it bidirectionally, however if it is
> * is specified but cannot be located, DMA will be disabled.
> */
> - if (plat->dma_rx_param) {
> - host->dma_rx_channel = dma_request_channel(mask,
> - plat->dma_filter,
> - plat->dma_rx_param);
> + if (plat->dma_rx_param || np) {
> + host->dma_rx_channel = dma_request_slave_channel_compat(mask,
> + plat->dma_filter,
> + plat->dma_rx_param,
> + &dev->dev, "rx");
> /* E.g if no DMA hardware is present */
> if (!host->dma_rx_channel)
> dev_err(mmc_dev(host->mmc), "no RX DMA channel\n");

I don't think this is right - I think Arnd has been leading you up the
garden path saying that this can be simplified. Why?

If you look at what this code does, the DMA channels are optional. If
they're not provided, then you don't get an error or a warning printk from
the code. However, after your conversion, if you use DT and avoid giving
the DMA information (which you have to avoid on the majority of ARM
platforms) then "np" will be non-NULL, and
dma_request_slave_channel_compat() will return NULL, causing the error
and/or warning to be printed.

So, we really need to know whether the DMA channel information has been
provided in DT in the upper level "if" statement, and _not_ use
dma_request_slave_channel_compat().
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/