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. > + set_bit(TX_BUSY, &dws->dma_chan_busy); > + > + return ret; ... > - if (!xfer->rx_buf) > - return NULL; This seems not related. -- With Best Regards, Andy Shevchenko