From: Jonathan Cameron <jic23@kernel.org>
To: Mike Looijmans <mike.looijmans@topic.nl>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
devicetree@vger.kernel.org, linux-iio@vger.kernel.org,
Lars-Peter Clausen <lars@metafoo.de>,
Liam Beguin <liambeguin@gmail.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Maksim Kiselev <bigunclemax@gmail.com>,
Marcus Folkesson <marcus.folkesson@gmail.com>,
Marius Cristea <marius.cristea@microchip.com>,
Mark Brown <broonie@kernel.org>,
Niklas Schnelle <schnelle@linux.ibm.com>,
Okan Sahin <okan.sahin@analog.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] iio: adc: ti-ads1298: Add driver
Date: Sat, 10 Feb 2024 16:08:50 +0000 [thread overview]
Message-ID: <20240210160850.7495b410@jic23-huawei> (raw)
In-Reply-To: <7d7ea4e4-fcae-4966-b194-e1d328751b6b@topic.nl>
>
> >
> >>> + spinlock_t irq_busy_lock; /* Handshake between SPI and DRDY irqs */
> >>> + int rdata_xfer_busy;
> >>> +
> >>> + /* Temporary storage for demuxing data after SPI transfer */
> >>> + u32 bounce_buffer[ADS1298_MAX_CHANNELS];
> >>> +
> >>> + /* For synchronous SPI exchanges (read/write registers) */
> >>> + u8 cmd_buffer[ADS1298_SPI_CMD_BUFFER_SIZE] __aligned(IIO_DMA_MINALIGN);
> >>> +
> >>> + /* Buffer used for incoming SPI data */
> >>> + u8 rx_buffer[ADS1298_SPI_RDATA_BUFFER_SIZE];
> > Cacheline aligned?
> > I see the cmd_buffer, but shouldn't this be also aligned?
>
> I understood from Jonathan that that wasn't needed... "My" SPI
> controller is rather dumb and doesn't even have DMA.
>
> Will take a closer look though.
It should be fine. The aim here is to ensure that nothing access data in
the same cacheline from the CPU side whilst DMA is ongoing (and unwanted
write backs of stale data can occur). As long at the handling isn't
very complex, a single marking of the first buffer used for DMA (and
being sure there is nothing other than other DMA buffers after it
the same cacheline (potentially multiple lines) is enough.
So the __aligend(IIO_DMA_MINALIGN) on cmd_buffer should work for allt hese
buffers.
next prev parent reply other threads:[~2024-02-10 16:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-05 13:55 [PATCH v2 2/2] iio: adc: ti-ads1298: Add driver Andy Shevchenko
2024-02-05 15:25 ` Mike Looijmans
2024-02-05 15:32 ` Mark Brown
2024-02-10 16:08 ` Jonathan Cameron [this message]
[not found] <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.6274d473-fd3f-439a-bf61-89eea8028afa@emailsignatures365.codetwo.com>
2024-02-02 10:59 ` [PATCH v2 1/2] dt-bindings: iio: adc: ti-ads1298: Add bindings Mike Looijmans
2024-02-02 10:59 ` [PATCH v2 2/2] iio: adc: ti-ads1298: Add driver Mike Looijmans
2024-02-04 15:54 ` Jonathan Cameron
2024-02-05 8:15 ` Mike Looijmans
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=20240210160850.7495b410@jic23-huawei \
--to=jic23@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bigunclemax@gmail.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=liambeguin@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcus.folkesson@gmail.com \
--cc=marius.cristea@microchip.com \
--cc=mike.looijmans@topic.nl \
--cc=okan.sahin@analog.com \
--cc=schnelle@linux.ibm.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