Re: [linux-sunxi] Re: [PATCH 5/5] RFC spi: sun4i: add DMA support

From: Michal Suchanek
Date: Sun Jun 05 2016 - 07:28:10 EST

On 2 June 2016 at 16:26, Mark Brown <broonie@xxxxxxxxxx> wrote:
> On Thu, Jun 02, 2016 at 02:14:26PM +0200, Michal Suchanek wrote:
>> On 2 June 2016 at 06:42, Priit Laes <plaes@xxxxxxxxx> wrote:
>> > On Wed, 2016-06-01 at 20:00 +0200, Maxime Ripard wrote:
>> > Actually it non-DMA case works fine if you don't need SPI transfers
>> > larger than SUN4I_FIFO_DEPTH - 1, which is 63 bytes.
>> > This was addressed by this patch, but was never applied:
>> >
>> And the code added in that patch will never run unless you
>> 1) use long spi transfers
>> 2) compile in/load SPI without DMA support
>> There is no reason for doing 2) since we have do DMA support for sunxi.
> Well, presumably such code exists and is being worked on?

Which code are you referring to?

This is a reply to patch which adds DMA support to the SPI driver so
that it can work for arbitrarily long transfers.

So there is code for fully working driver.

>> So that's another code path that needs maintenance and testing and
>> likely will not get it.
> Oh, come on. You might not want to use it yourself but the chances are
> that someone will want to use it just like the situation with all the
> other SPI drivers. It's a perfectly reasonable and sensible feature to
> support upstream.

Is it?

Once we have *one* driver that works for arbitrarily long transfers
and it works out of the box with the board defconfig 99% of people who
will use the SPI driver for anything will use this driver. Any other
variant will go untested.

And for the driver to also work without DMA you have to *tell* it to
probe without DMA because it cannot know you are not going to load a
DMA driver later.

> I really do not understand why there is such a strong desire to have
> these devices be a special snowflake here, the worst that's likely to
> happen here is that you're going to end up having to either remove the
> DMA controller from the DT or load the driver for it neither of which
> seem like the end of the world.

Why would you do that?