From: Jonathan Cameron <jic23@kernel.org>
To: Nuno Sa <nuno.sa@analog.com>
Cc: <linux-iio@vger.kernel.org>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH 1/3] iio: imu: adis: ensure proper DMA alignment
Date: Sun, 21 Jan 2024 16:12:00 +0000 [thread overview]
Message-ID: <20240121161201.1d5c5e7f@jic23-huawei> (raw)
In-Reply-To: <20240117-adis-improv-v1-1-7f90e9fad200@analog.com>
On Wed, 17 Jan 2024 14:10:49 +0100
Nuno Sa <nuno.sa@analog.com> wrote:
> Aligning the buffer to the L1 cache is not sufficient in some platforms
> as they might have larger cacheline sizes for caches after L1 and thus,
> we can't guarantee DMA safety.
>
> That was the whole reason to introduce IIO_DMA_MINALIGN in [1]. Do the same
> for the sigma_delta ADCs.
>
> [1]: https://lore.kernel.org/linux-iio/20220508175712.647246-2-jic23@kernel.org/
>
> Fixes: ccd2b52f4ac6 ("staging:iio: Add common ADIS library")
> Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Guess I didn't look in the main headers :(
Anyhow good to clean this straggler up. I'll apply it to the fixes-togreg
branch of iio.git and mark it for stable.
I 'think' the definition of IIO_DMA_MINALIGN long got picked up by stable.
Jonathan
> ---
> include/linux/iio/imu/adis.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/iio/imu/adis.h b/include/linux/iio/imu/adis.h
> index dc9ea299e088..8898966bc0f0 100644
> --- a/include/linux/iio/imu/adis.h
> +++ b/include/linux/iio/imu/adis.h
> @@ -11,6 +11,7 @@
>
> #include <linux/spi/spi.h>
> #include <linux/interrupt.h>
> +#include <linux/iio/iio.h>
> #include <linux/iio/types.h>
>
> #define ADIS_WRITE_REG(reg) ((0x80 | (reg)))
> @@ -131,7 +132,7 @@ struct adis {
> unsigned long irq_flag;
> void *buffer;
>
> - u8 tx[10] ____cacheline_aligned;
> + u8 tx[10] __aligned(IIO_DMA_MINALIGN);
> u8 rx[4];
> };
>
>
next prev parent reply other threads:[~2024-01-21 16:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 13:10 [PATCH 0/3] iio: imu: adis: misc fixes/improvements Nuno Sa
2024-01-17 13:10 ` [PATCH 1/3] iio: imu: adis: ensure proper DMA alignment Nuno Sa
2024-01-21 16:12 ` Jonathan Cameron [this message]
2024-01-22 8:28 ` Nuno Sá
2024-01-17 13:10 ` [PATCH 2/3] iio: imu: adis16475: make use of irq_get_trigger_type() Nuno Sa
2024-01-17 13:10 ` [PATCH 3/3] iio: imu: adis16480: " Nuno Sa
2024-01-21 16:15 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240121161201.1d5c5e7f@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox