Skip to content

Input: Fix insufficent DMA alignment.

Jonathan Cameron linux-input 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9Input: psxpad - Fix padding for DMA safe buffers.drivers/input/joystick/psxpad-spi.c+2 -20 replies
2/9Input: ad714x - Fix padding for DMA safe buffers.drivers/input/misc/ad714x.h+1 -11 reply
3/9Input: ad7887 - Fix padding for DMA safe buffers.drivers/input/touchscreen/ad7877.c+2 -21 reply
4/9Input: ads7846 - Fix padding for DMA safe buffers.drivers/input/touchscreen/ads7846.c+2 -20 replies
5/9Input: cyttsp - Fix padding for DMA safe buffers.drivers/input/touchscreen/cyttsp_core.h+1 -10 replies
6/9Input: surface3 - Fix padding for DMA safe buffers.drivers/input/touchscreen/surface3_spi.c+1 -11 reply
7/9Input: n64joy - Fix DMA buffer alignment.drivers/input/joystick/n64joy.c+3 -34 replies
8/9Input: atmel_captouch - Avoid suspect DMA buffer alignment.drivers/input/misc/atmel_captouch.c+1 -10 replies
9/9Input: elants - Fix suspect DMA buffer alignmentdrivers/input/touchscreen/elants_i2c.c+1 -10 replies

Reviews trailers per patch

2 of 9 patches have a Reviewed-by or Acked-by.

PatchMichael Hennerich
1/9
2/9A-b
3/9A-b
4/9
5/9
6/9
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/9] Input: Fix insufficent DMA alignment.

From: Jonathan Cameron <[email protected]>

This problem was discovered in IIO as a side effect of the discussions about relaxing kmalloc alignment on arm64 and resulted in a series of large patch sets.

https://lore.kernel.org/linux-iio/[email protected]/

Unsurprisingly there are cases of it in other subsystems.

The short version of this is that there are a few known arm64 chips where ___cacheline_aligned enforces 64 byte alignment which is what we typically want for performance optimization as the size of the L1 cache lines. However, further out in the cache hierarchy we have caches with 128 byte lines. Those are the ones that matter for DMA safety.
So we need the larger alignment guarantees of ARCH_KMALLOC_MINALIGN which in this case is 128 bytes.

There is one other use of ____cacheline_aligned in input:
joystick/iforce/iforce-usb.c

Whilst suspicious I'm not sure enough of the requirements of USB to know if they are there for DMA safety or some other constraint.

Jonathan

Cc Daniel Mack <[email protected]>
Cc Michael Hennerich <[email protected]>
Cc Tomohiro Yoshidomi <[email protected]>
Cc Javier Martinez Canillas <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Benjamin Tissoires <[email protected]>
Cc Lauri Kasanen <[email protected]>
Cc Daniel Hung-yu Wu <[email protected]>

Jonathan Cameron (9):
Input: psxpad - Fix padding for DMA safe buffers.
Input: ad714x - Fix padding for DMA safe buffers.
Input: ad7887 - Fix padding for DMA safe buffers.
Input: ads7846 - Fix padding for DMA safe buffers.
Input: cyttsp - Fix padding for DMA safe buffers.
Input: surface3 - Fix padding for DMA safe buffers.
Input: n64joy - Fix DMA buffer alignment.
Input: atmel_captouch - Avoid suspect DMA buffer alignment.
Input: elants - Fix suspect DMA buffer alignment

 drivers/input/joystick/n64joy.c          | 6 +++---
 drivers/input/joystick/psxpad-spi.c      | 4 ++--
 drivers/input/misc/ad714x.h              | 2 +-
 drivers/input/misc/atmel_captouch.c      | 2 +-
 drivers/input/touchscreen/ad7877.c       | 4 ++--
 drivers/input/touchscreen/ads7846.c      | 4 ++--
 drivers/input/touchscreen/cyttsp_core.h  | 2 +-
 drivers/input/touchscreen/elants_i2c.c   | 2 +-
 drivers/input/touchscreen/surface3_spi.c | 2 +-
 9 files changed, 14 insertions(+), 14 deletions(-)
Signature · 1 line
2.38.1