Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: dac: ad5421: Fix alignment for DMA safety

____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.

Update the comment to include 'may'.

Fixes: 5691b23489db ("staging:iio:dac: Add AD5421 driver")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20220508175712.647246-46-jic23@kernel.org

+2 -2
+2 -2
drivers/iio/dac/ad5421.c
··· 72 72 struct mutex lock; 73 73 74 74 /* 75 - * DMA (thus cache coherency maintenance) requires the 75 + * DMA (thus cache coherency maintenance) may require the 76 76 * transfer buffers to live in their own cache lines. 77 77 */ 78 78 union { 79 79 __be32 d32; 80 80 u8 d8[4]; 81 - } data[2] ____cacheline_aligned; 81 + } data[2] __aligned(IIO_DMA_MINALIGN); 82 82 }; 83 83 84 84 static const struct iio_event_spec ad5421_current_event[] = {