]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: accel: adxl355: Fix alignment for DMA safety
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 8 May 2022 17:55:43 +0000 (18:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:41:24 +0000 (14:41 +0200)
[ Upstream commit 46403dcf3a7cbd24b86f809fd79962f4d6b137c5 ]

 ____cacheline_aligned is insufficient guarantee for non-coherent DMA.
Switch to the updated IIO_DMA_MINALIGN definition.

Fixes: 327a0eaf19d53 ("iio: accel: adxl355: Add triggered buffer support")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Puranjay Mohan <puranjay12@gmail.com>
Acked-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20220508175712.647246-4-jic23@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/accel/adxl355_core.c

index e9c10c8c32f094286770db3f4ee4c287f6f76621..2dfe780d61444776f2f672f952ce15608a5fa55d 100644 (file)
@@ -177,7 +177,7 @@ struct adxl355_data {
                        u8 buf[14];
                        s64 ts;
                } buffer;
-       } ____cacheline_aligned;
+       } __aligned(IIO_DMA_MINALIGN);
 };
 
 static int adxl355_set_op_mode(struct adxl355_data *data,