From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Mike Looijmans <mike.looijmans@topic.nl>
Cc: Jonathan Cameron <jic23@kernel.org>,
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 v3 2/2] iio: adc: ti-ads1298: Add driver
Date: Wed, 14 Feb 2024 14:08:24 +0000 [thread overview]
Message-ID: <20240214140824.00004460@Huawei.com> (raw)
In-Reply-To: <44d0a115-1a8b-496e-bfa9-89caccbee5bc@topic.nl>
On Wed, 14 Feb 2024 07:48:40 +0100
Mike Looijmans <mike.looijmans@topic.nl> wrote:
> On 10-02-2024 17:27, Jonathan Cameron wrote:
> > On Tue, 6 Feb 2024 18:38:29 +0100
> > Mike Looijmans <mike.looijmans@topic.nl> wrote:
> >
> >> On 06-02-2024 17:32, Andy Shevchenko wrote:
> >>> On Tue, Feb 06, 2024 at 04:44:03PM +0100, Mike Looijmans wrote:
> >>>> On 06-02-2024 16:09, Andy Shevchenko wrote:
> >>>>> On Tue, Feb 06, 2024 at 03:47:45PM +0100, Mike Looijmans wrote:
> >>> ...
> >>>
> >>>>> But it's up to you what to do with that.
> >>>>> Maybe Jonathan can advice something different.
> >>>>>
> >>>> The spinlock also protects the call to spi_async().
> >>> I don't get this. Locks usually protect the data and not the code.
> >>> Can you elaborate?
> >>>
> >> Either the DRDY or SPI completion handler will call spi_async(), the
> >> lock assures that it's only called by one.
> >
> > Arguably it's protecting the destination buffer of the spi_async()
> > call. We don't really care if we issue two reads (it's a waste
> > of time and we would store two sets of readings but meh), but we do
> > care about being sure that don't issue a second read into a buffer
> > that we are potentially simultaneously getting data back from.
>
> Indeed, that.
>
> >
> > There are comments where the release is to describe when it can
> > be safely unlocked.
> >
> > I'm not super keen on this whole structure but I don't really have a better
> > idea. Who builds a device where you have no latched way of seeing
> > if there is new data? (some) Hardware folk love to assume they have a RTOS only
> > talking to their device and that no pulse signals will ever be missed.
> >
> > We get to educate them when ever the opportunity arises :)
>
> Even on RTOS this chip was a pain - to get it to work reliably I had to set up
> a DMA controller to run the SPI transactions, which took some smart
> daisy-chaining (I recall having the DMA controller write to its own control
> registers to avoid involving the CPU).
Always fun when that sort of mess is needed!
>
> It's probably possible to trick audio hardware (I2S controller) into grabbing
> the data (my chip doesn't have that) without involving the CPU.
Yeah, sometimes it feels like these ADCs have been designed with that sort
of bus in mind.
>
> As the code is now, I can grab data and display it with the IIO oscilloscope
> over network at 4kHz without losing samples on an A9 at 600Mhz.
Nice.
>
next prev parent reply other threads:[~2024-02-14 14:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.ad72f8ca-a017-42d2-9c07-f17f282264d0@emailsignatures365.codetwo.com>
2024-02-06 6:58 ` [PATCH v3 1/2] dt-bindings: iio: adc: ti-ads1298: Add bindings Mike Looijmans
[not found] ` <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.fd628a1a-a926-426e-a239-bfd8c9858b94@emailsignatures365.codetwo.com>
2024-02-06 6:58 ` [PATCH v3 2/2] iio: adc: ti-ads1298: Add driver Mike Looijmans
2024-02-06 12:57 ` Andy Shevchenko
2024-02-06 13:33 ` Mike Looijmans
2024-02-06 13:50 ` Andy Shevchenko
2024-02-06 14:25 ` Mike Looijmans
2024-02-06 14:47 ` Mike Looijmans
2024-02-06 15:09 ` Andy Shevchenko
2024-02-06 15:44 ` Mike Looijmans
2024-02-06 16:32 ` Andy Shevchenko
2024-02-06 17:38 ` Mike Looijmans
2024-02-10 16:27 ` Jonathan Cameron
2024-02-14 6:48 ` Mike Looijmans
2024-02-14 14:08 ` Jonathan Cameron [this message]
2024-02-06 15:07 ` Andy Shevchenko
2024-02-06 15:28 ` [PATCH v3 1/2] dt-bindings: iio: adc: ti-ads1298: Add bindings Conor Dooley
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=20240214140824.00004460@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bigunclemax@gmail.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jic23@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;
as well as URLs for NNTP newsgroup(s).