On 29/06/22 09:50, Arnd Bergmann wrote:
On Tue, Jun 28, 2022 at 11:03 PM Michael Schmitz <schmitzmic@xxxxxxxxx> wrote:On 28/06/22 19:03, Geert Uytterhoeven wrote:kmalloc() guarantees alignment to the next power-of-two size or
Hmmm - I think I'll stick a WARN_ONCE() in there so we know whether thisThe driver allocates bounce buffers using kmalloc if it hits anNo idea.
unaligned data buffer - can such buffers still even happen these days?
code path is still being used.
KMALLOC_MIN_ALIGN, whichever is bigger. On m68k this means it
is cacheline aligned.
And all SCSI buffers are allocated using kmalloc? No way at all for user space to pass unaligned data?
(SCSI is a weird beast - I have used a SCSI DAT tape driver many many years ago, which broke all sorts of assumptions about transfer block sizes ... but that might actually have been in the v0.99 days, many rewrites of SCSI midlevel ago).
Just being cautious, as getting any of this tested will be a stretch.