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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f999ddef22580427dcb0205a9f7ba97f227c56a3.camel@gmail.com>
Date: Thu, 16 Oct 2025 10:11:42 +0100
From: Nuno Sá <noname.nuno@...il.com>
To: David Lechner <dlechner@...libre.com>, Mark Brown <broonie@...nel.org>, 
 Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
 Conor Dooley <conor+dt@...nel.org>,  Marcelo Schmitt
 <marcelo.schmitt@...log.com>, Michael Hennerich
 <michael.hennerich@...log.com>, Nuno Sá	
 <nuno.sa@...log.com>, Jonathan Cameron <jic23@...nel.org>, Andy Shevchenko	
 <andy@...nel.org>
Cc: Sean Anderson <sean.anderson@...ux.dev>, linux-spi@...r.kernel.org, 
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-iio@...r.kernel.org
Subject: Re: [PATCH 4/6] spi: axi-spi-engine: support
 SPI_MULTI_BUS_MODE_STRIPE

On Wed, 2025-10-15 at 11:29 -0500, David Lechner wrote:
> On 10/15/25 5:30 AM, Nuno Sá wrote:
> > On Tue, 2025-10-14 at 17:02 -0500, David Lechner wrote:
> > > Add support for SPI_MULTI_BUS_MODE_STRIPE to the AXI SPI engine driver.
> > > 
> 
> ...
> 
> > > +
> > > +		if (xfer->rx_buf || xfer->offload_flags &
> > > SPI_OFFLOAD_XFER_RX_STREAM ||
> > > +		    xfer->tx_buf || xfer->offload_flags &
> > > SPI_OFFLOAD_XFER_TX_STREAM) {
> > 
> > I'm a bit confused by this condition. It looks like setting priv-
> > >multi_bus_mode
> > (and the other fields) only matters for msg->offload but the above will be
> > true
> > for regular rx/tx messages, right? Or am i missing something?
> 
> You are correct.
> 
> > 
> > If so, I wonder why doing this for all transfers if we only care about
> > multi_bus_mode for offload messages. I guess you want to validate
> > xfer->multi_bus_mode?
> 
> Yes, this is important to validate it since we don't support all possible
> modes.
> The mode still applies to the individual xfer even when not using SPI
> offloading.
> 
> > I would then just take the switch() out of the condition
> > (I mean trying to setup a no data xfer with an invalid bus_mode should also
> > be
> > seen as invalid IMO) and then use the offload conditions (or maybe simply
> > msg-
> > > offload?) for the multi_bus_mode handling. To me, it makes the intent more
> > clear.
> 
> It the validation only matters for xfers that send or receive data. I guess
> it doesn't hurt to check the mode in non-data xfers (e.g. ones with just a
> delay)
> but since we needed the condition anyway for the accumulator, it made sense to
> me to put it inside the conditional.

Sure, but note that I did said that I would tread xfers that do not send/receive
data and have an invalid mode as an error (the flag should not be there anyways)
and that's why I was suggesting taking the validation out of the condition. No
strong feelings though so fine to keep it this way.

- Nuno Sá

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ