[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200731124646.2bngx5mgtwrgctzi@mobilestation>
Date: Fri, 31 Jul 2020 15:46:46 +0300
From: Serge Semin <Sergey.Semin@...kalelectronics.ru>
To: Andy Shevchenko <andy.shevchenko@...il.com>
CC: Serge Semin <fancer.lancer@...il.com>,
Mark Brown <broonie@...nel.org>,
Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
Georgy Vlasov <Georgy.Vlasov@...kalelectronics.ru>,
Ramil Zaripov <Ramil.Zaripov@...kalelectronics.ru>,
Pavel Parkhomenko <Pavel.Parkhomenko@...kalelectronics.ru>,
Peter Ujfalusi <peter.ujfalusi@...com>,
Feng Tang <feng.tang@...el.com>, Vinod Koul <vkoul@...nel.org>,
<linux-spi@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4/8] spi: dw-dma: Move DMA transfers submission to the
channels prep methods
On Fri, Jul 31, 2020 at 12:15:28PM +0300, Andy Shevchenko wrote:
> On Fri, Jul 31, 2020 at 10:59:49AM +0300, Serge Semin wrote:
> > Indeed we can freely move the dmaengine_submit() method invocation and the
> > Tx and Rx busy flag setting into the DMA Tx/Rx prepare methods. By doing
> > so first we implement another preparation before adding the one-by-one DMA
> > SG entries transmission, second we now have the dma_async_tx_descriptor
> > descriptor used locally only in the new DMA transfers submitition methods,
> > which makes the code less complex with no passing around the DMA Tx
> > descriptors, third we make the generic transfer method more readable, where
> > now the functionality of submission, execution and wait procedures is
> > transparently split up instead of having a preparation, intermixed
> > submission/execution and wait procedures. While at it we also add the
> > dmaengine_submit() return value test. It has been unnecessary for
> > DW DMAC, but should be done to support the generic DMA interface.
> >
> > Note since the DMA channels preparation methods are now responsible for
> > the DMA transactions submission, we also rename them to
> > dw_spi_dma_submit_{tx,rx}().
>
> ...
>
> > + cookie = dmaengine_submit(txdesc);
> > + ret = dma_submit_error(cookie);
> > + if (!ret)
>
> Use traditional pattern
> if (ret)
> return ret;
>
> Same for below.
Ok.
>
> > + set_bit(TX_BUSY, &dws->dma_chan_busy);
> > +
> > + return ret;
>
> ...
>
> > - if (!xfer->rx_buf)
> > - return NULL;
>
> This seems not related.
I moved it to the upper level for the methods better maintainability.
-Sergey
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
Powered by blists - more mailing lists