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

iio: dac: ad5592r: 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.

Fixes: 56ca9db862bf ("iio: dac: Add support for the AD5592R/AD5593R ADCs/DACs")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Paul Cercueil <paul@crapouillou.net>
Acked-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20220508175712.647246-49-jic23@kernel.org

+3 -1
+3 -1
drivers/iio/dac/ad5592r-base.h
··· 14 14 #include <linux/mutex.h> 15 15 #include <linux/gpio/driver.h> 16 16 17 + #include <linux/iio/iio.h> 18 + 17 19 struct device; 18 20 struct ad5592r_state; 19 21 ··· 67 65 u8 gpio_in; 68 66 u8 gpio_val; 69 67 70 - __be16 spi_msg ____cacheline_aligned; 68 + __be16 spi_msg __aligned(IIO_DMA_MINALIGN); 71 69 __be16 spi_msg_nop; 72 70 }; 73 71