Messages in this thread | | | Date | Fri, 15 Dec 2023 13:29:21 +0000 | From | Mark Brown <> | Subject | Re: [PATCH SPI for-next 2/3] spi: mchp-pci1xxxx: DMA Read support for copying data into SPI Buf |
| |
On Fri, Dec 15, 2023 at 05:17:47PM +0530, Thangaraj Samynathan wrote:
> + tx_dma_addr = dma_map_single(dev, (void *)xfer->tx_buf, xfer->len, DMA_TO_DEVICE); > + if (dma_mapping_error(NULL, tx_dma_addr)) { > + tx_dma_addr = 0; > + ret = -ENOMEM; > + goto error; > + }
The core can do all the DMA mapping for you if you provide a can_dma() operation, this supports switching between DMA and non-DMA modes per transfer - often you'll get better performance from PIO for smaller lengths due to the overhead of setting up DMA and taking the interrupt on completion. [unhandled content-type:application/pgp-signature] | |