Re: [PATCH v3 3/6] spi: spi-fsl-dspi: Stub out DMA functions

From: James Clark
Date: Wed Jun 25 2025 - 06:19:33 EST




On 25/06/2025 11:00 am, Arnd Bergmann wrote:
On Wed, Jun 25, 2025, at 11:19, James Clark wrote:
On 24/06/2025 6:16 pm, Arnd Bergmann wrote:
On Tue, Jun 24, 2025, at 18:29, Frank Li wrote:

It would also be simpler to enforce this in Kconfig if we only
care about users that use the DMA support.

But most of the devices supported by the driver don't do any DMA. That
was the reason to stub them out rather than add the Kconfig depends.

Ah right. So even when running on SoCs that have a DMA engine,
you can end up not using it?


Yes

In this case you could have an extra Kconfig symbol to configure
DMA support for this driver and use that in the source code:

config SPI_FSL_DSPI_DMA
bool "Use DMA engine for offloading Freescale DSPI transfers"
depends on SPI_FSL_DSPI && DMA_ENGINE
help
....


Arnd

Wouldn't that allow someone to break it by disabling (or not enabling) that option? The driver won't fall back to the other modes if DMA isn't configured, it just won't work. In this case it seems like it's better to depend directly on DMA_ENGINE because that fixes the randconfig issues, which is the whole reason for the discussion.

Would someone really want an option to disable compilation of two functions if their DSPI device is one that doesn't use DMA? Seems like this option would always be on anyway.