Re: [PATCH_V3 2/3] dma: jz4780: add driver for the Ingenic JZ4780 DMA controller

From: Vinod Koul
Date: Wed Mar 18 2015 - 07:23:20 EST


On Tue, Mar 17, 2015 at 06:07:36PM +0000, Zubair Lutfullah Kakakhel wrote:
> >> +static uint32_t jz4780_dma_transfer_size(unsigned long val, int *ord)
> >> +{
> >> + *ord = ffs(val) - 1;
> >> +
> >> + /* 8 byte transfer sizes unsupported so fall back on 4. */
> > okay falling back is not a good idea, same applies for default in
> > jz4780_dma_width(). The slave dma parameters are match with devices, so
> > programming something which you dont support, falling back or using defaults
> > is not a good idea
> How bad of an idea is it and what is a better way?
> I see similar stuff in imx-dma and dma-jz4740.
>
> And my jz4740-mmc driver (I add jz4780 support and use it to test this dma driver mainly)
> falls back on defaults after it requests a larger transfer size.
Well emmc it might work, but consider you did fall back on audio playback,
you will get crapped out audio, or a SPI transfer.

That is why falling back causes issues, so right way would be return error
and have driver fixed for it

--
~Vinod
--
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/