diff mbox series

[v1,2/2] spi: pxa2xx: Update DMA mapping and using logic in the documentation

Message ID 20231207221426.3259806-3-andriy.shevchenko@linux.intel.com
State Superseded
Headers show
Series spi: pxa2xx: Update documentation | expand

Commit Message

Andy Shevchenko Dec. 7, 2023, 10:13 p.m. UTC
Update DMA mapping and using logic in the documentation to follow what
the code does.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 Documentation/spi/pxa2xx.rst | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

Comments

Andy Shevchenko Dec. 8, 2023, 4:12 p.m. UTC | #1
On Fri, Dec 08, 2023 at 12:13:40AM +0200, Andy Shevchenko wrote:
> Update DMA mapping and using logic in the documentation to follow what
> the code does.

...

> -  if !enable_dma then
> -	always use PIO transfers
> +  if spi_message.len > 65536 then
> +        if spi_message.is_dma_mapped or rx_dma_buf != 0 or tx_dma_buf != 0 then
> +              reject premapped transfers

Here seems inconsistent indentation. I'll fix it in the next version.
Mark, should I resend patch 1 as well?
Mark Brown Dec. 8, 2023, 4:16 p.m. UTC | #2
On Fri, Dec 08, 2023 at 06:12:05PM +0200, Andy Shevchenko wrote:

> Here seems inconsistent indentation. I'll fix it in the next version.
> Mark, should I resend patch 1 as well?

Yes, please.
diff mbox series

Patch

diff --git a/Documentation/spi/pxa2xx.rst b/Documentation/spi/pxa2xx.rst
index b66702724ccf..61c7b9dd833b 100644
--- a/Documentation/spi/pxa2xx.rst
+++ b/Documentation/spi/pxa2xx.rst
@@ -193,17 +193,14 @@  mode supports both coherent and stream based DMA mappings.
 The following logic is used to determine the type of I/O to be used on
 a per "spi_transfer" basis::
 
-  if !enable_dma then
-	always use PIO transfers
+  if spi_message.len > 65536 then
+        if spi_message.is_dma_mapped or rx_dma_buf != 0 or tx_dma_buf != 0 then
+              reject premapped transfers
 
-  if spi_message.len > 8191 then
 	print "rate limited" warning
 	use PIO transfers
 
-  if spi_message.is_dma_mapped and rx_dma_buf != 0 and tx_dma_buf != 0 then
-	use coherent DMA mode
-
-  if rx_buf and tx_buf are aligned on 8 byte boundary then
+  if enable_dma and the size is in the range [DMA burst size..65536] then
 	use streaming DMA mode
 
   otherwise