diff mbox series

[08/92] iio: accel: sca3000: Fix alignment for DMA safety

Message ID 20220503085935.1533814-9-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:58 a.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

Fixes: 9cc9806e22178 ("iio: accel: Add driver for Murata SCA3300 accelerometer")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Tomas Melin <tomas.melin@vaisala.com>
---
 drivers/iio/accel/sca3300.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tomas Melin May 3, 2022, 10:06 a.m. UTC | #1
Hi,

>[PATCH 08/92] iio: accel: sca3000: Fix alignment for DMA safety
Small typo in commit headline, should be sca3300, otherwise LGTM.


On 03/05/2022 11:58, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> ____cacheline_aligned is insufficient guarantee for non-coherent DMA.
> Switch to the updated IIO_ALIGN definition.
> 
> Fixes: 9cc9806e22178 ("iio: accel: Add driver for Murata SCA3300 accelerometer")
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Tomas Melin <tomas.melin@vaisala.com>

Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>

Thanks,
Tomas


> ---
>  drivers/iio/accel/sca3300.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/accel/sca3300.c b/drivers/iio/accel/sca3300.c
> index f7ef8ecfd34a..0e87746829a4 100644
> --- a/drivers/iio/accel/sca3300.c
> +++ b/drivers/iio/accel/sca3300.c
> @@ -115,7 +115,7 @@ struct sca3300_data {
>  		s16 channels[4];
>  		s64 ts __aligned(sizeof(s64));
>  	} scan;
> -	u8 txbuf[4] ____cacheline_aligned;
> +	u8 txbuf[4] __aligned(IIO_ALIGN);
>  	u8 rxbuf[4];
>  };
>
diff mbox series

Patch

diff --git a/drivers/iio/accel/sca3300.c b/drivers/iio/accel/sca3300.c
index f7ef8ecfd34a..0e87746829a4 100644
--- a/drivers/iio/accel/sca3300.c
+++ b/drivers/iio/accel/sca3300.c
@@ -115,7 +115,7 @@  struct sca3300_data {
 		s16 channels[4];
 		s64 ts __aligned(sizeof(s64));
 	} scan;
-	u8 txbuf[4] ____cacheline_aligned;
+	u8 txbuf[4] __aligned(IIO_ALIGN);
 	u8 rxbuf[4];
 };