lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <82824032-26d4-42a6-8a92-3e4a410741c5@app.fastmail.com>
Date: Wed, 25 Jun 2025 12:54:02 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "James Clark" <james.clark@...aro.org>, "Frank Li" <Frank.li@....com>
Cc: "Vladimir Oltean" <olteanv@...il.com>, "Mark Brown" <broonie@...nel.org>,
 "Vladimir Oltean" <vladimir.oltean@....com>,
 "Larisa Grigore" <larisa.grigore@....com>, "Christoph Hellwig" <hch@....de>,
 linux-spi@...r.kernel.org, imx@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 3/6] spi: spi-fsl-dspi: Stub out DMA functions

On Wed, Jun 25, 2025, at 12:19, James Clark wrote:
> 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:
>
> 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.

It would be the same as disabling DMA_ENGINE today when running on an
SoC that supports DMA mode in DSPI. Ideally that should fall back
to non-accelerated mode. I see a lot of checks for
trans_mode == DSPI_DMA_MODE, and I it's probably best to change
them to a function call like

static inline bool dsp_dma_mode(struct fsl_dspi *dspi)
{
     if (!IS_ENABLED(CONFIG_DMA_ENGINE)) // or CONFIG_FSL_DSPI_USE_DMA
          return false;

     return dspi->devtype_data->trans_mode == DSPI_DMA_MODE;
}

> 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.

It's probably mainly relevant if they want to completely turn off
CONFIG_DMA_ENGINE, which is substantially bigger. Using a check
for that symbol in the driver is certainly simpler for the user,
as they can't accidentally turn it off the custom symbol.

In theory you may also want to turn off DMA mode for testing,
which is supported by at least the DW_DMA driver.

I see that SPI_TEGRA114 has a dependency on TEGRA20_APB_DMA,
which is yet another variation. This is clearly done for
usability purposes since that SPI driver only ever works with
the specific DMA driver in practice, but it seems worse
conceptually.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ