diff mbox series

[78/92] iio: imu: icm42600: Fix alignment for DMA safety in buffer code.

Message ID 20220503085935.1533814-79-jic23@kernel.org (mailing list archive)
State Superseded
Headers show
Series IIO: Fix alignment of buffers for DMA | expand

Commit Message

Jonathan Cameron May 3, 2022, 8:59 a.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Second fix for this driver due to different introducing patches.

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

Fixes: 7f85e42a6c54 ("iio: imu: inv_icm42600: add buffer support in iio devices")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
---
 drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jean-Baptiste Maneyrol May 3, 2022, 11:55 a.m. UTC | #1
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>


From: Jonathan Cameron <jic23@kernel.org>
Sent: Tuesday, May 3, 2022 10:59
To: linux-iio@vger.kernel.org <linux-iio@vger.kernel.org>
Cc: Akinobu Mita <akinobu.mita@gmail.com>; Alexandru Lazar <alazar@startmail.com>; Alexandru Tachici <alexandru.tachici@analog.com>; Antoniu Miclaus <antoniu.miclaus@analog.com>; Charles-Antoine Couret <charles-antoine.couret@essensium.com>; Cosmin Tanislav <cosmin.tanislav@analog.com>; Cristian Pop <cristian.pop@analog.com>; David Lechner <david@lechnology.com>; Ivan Mikhaylov <i.mikhaylov@yadro.com>; Jacopo Mondi <jacopo+renesas@jmondi.org>; Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>; Lars-Peter Clausen <lars@metafoo.de>; Marcelo Schmitt <marcelo.schmitt1@gmail.com>; Mårten Lindahl <martenli@axis.com>; Matt Ranostay <mranostay@gmail.com>; Michael Hennerich <michael.hennerich@analog.com>; Michael Welling <mwelling@ieee.org>; Mugilraj Dhavachelvan <dmugil2000@gmail.com>; Navin Sankar Velliangiri <navin@linumiz.com>; Nuno Sá <nuno.sa@analog.com>; Paul Cercueil <paul@crapouillou.net>; Phil Reid <preid@electromag.com.au>; Puranjay Mohan <puranjay12@gmail.com>; Ricardo Ribalda <ribalda@kernel.org>; Robert Jones <rjones@gateworks.com>; Rui Miguel Silva <rui.silva@linaro.org>; Sean Nyekjaer <sean.nyekjaer@prevas.dk>; Tomas Melin <tomas.melin@vaisala.com>; Tomislav Denis <tomislav.denis@avl.com>; Uwe Kleine-König <u.kleine-koenig@pengutronix.de>; Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: [PATCH 78/92] iio: imu: icm42600: Fix alignment for DMA safety in buffer code. 
 
[CAUTION] This is EXTERNAL email. Do not click any links or open attachments unless you recognize the sender and know the content is safe.

======================================================================
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Second fix for this driver due to different introducing patches.

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

Fixes: 7f85e42a6c54 ("iio: imu: inv_icm42600: add buffer support in iio devices")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
---
 drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h
index de2a3949dcc7..56545638bfcd 100644
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h
@@ -39,7 +39,7 @@ struct inv_icm42600_fifo {
                 size_t accel;
                 size_t total;
         } nb;
-       uint8_t data[2080] ____cacheline_aligned;
+       uint8_t data[2080] __aligned(IIO_ALIGN);
 };
 
 /* FIFO data packet */
diff mbox series

Patch

diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h
index de2a3949dcc7..56545638bfcd 100644
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h
@@ -39,7 +39,7 @@  struct inv_icm42600_fifo {
 		size_t accel;
 		size_t total;
 	} nb;
-	uint8_t data[2080] ____cacheline_aligned;
+	uint8_t data[2080] __aligned(IIO_ALIGN);
 };
 
 /* FIFO data packet */