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] [day] [month] [year] [list]
Message-ID: <Z91q17GaHDpJKLIV@finisterre.sirena.org.uk>
Date: Fri, 21 Mar 2025 13:34:15 +0000
From: Mark Brown <broonie@...nel.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: Petr Tesarik <ptesarik@...e.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] regmap: spi: Don't use spi_write_then_read()

On Fri, Mar 21, 2025 at 12:27:01PM +0100, Arnd Bergmann wrote:
> On Fri, Mar 21, 2025, at 00:08, Mark Brown wrote:

> > I think this actually needs to be part of a wider series, but pushing it
> > out there just now since there's the other regmap paths which also use
> > spi_sync() and will need any adjustments anyway.

> I can see some code paths that are potentially broken by this
> patch on its own, e.g.

Yeah, I was pretty sure there were some but hadn't actually gone and
found a specific example yet.

> If your plan is to have _regmap_raw_read() always do its
> own buffering (at least for unaligned buffers on noncoherent
> devices), it will still work.

Either that or having some library that all the buses use (IIRC
at least SoundWire can do DMA), yeah.  We also have I/O that regmap
generates itself as part of cache sync potentially, especially with
rbtree caches.

I remembered what the difference between writes and reads I was thinking
of was BTW - only reads use spi_write_then_read(), writes are already
using spi_sync() directly for gather writes (which are the ones most
likely to use DMA since they'll be for bigger blocks of data, non-gather
writes are usually single register) or otherwise spi_write() which
doesn't bother with a bounce buffer.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ