From: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
Cc: "Andy Shevchenko" <andy.shevchenko@gmail.com>,
"Michael Hennerich" <michael.hennerich@analog.com>,
"Nuno Sá" <nuno.sa@analog.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] iio: adc: ad7944: Add support for "3-wire mode"
Date: Sat, 23 Mar 2024 18:20:41 +0000 [thread overview]
Message-ID: <20240323182041.5e1ef0bb@jic23-huawei> (raw)
In-Reply-To: <CAMknhBFNnePpn5j=f-RXJCw11=4TTORhG0mt+FqazLQwvHBtPQ@mail.gmail.com>
On Mon, 18 Mar 2024 09:33:44 -0500
David Lechner <dlechner@baylibre.com> wrote:
> On Sun, Mar 17, 2024 at 3:23 AM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> >
> > On Sun, Mar 17, 2024 at 1:10 AM David Lechner <dlechner@baylibre.com> wrote:
> > > On Sat, Mar 16, 2024 at 2:57 PM Andy Shevchenko
> > > <andy.shevchenko@gmail.com> wrote:
> > > > Thu, Mar 14, 2024 at 12:43:38PM -0500, David Lechner kirjoitti:
> >
>
> ...
>
> > > > > + case AD7944_SPI_MODE_SINGLE:
> > > > > + ret = ad7944_3wire_cs_mode_conversion(adc, &indio_dev->channels[0]);
> > > > > + if (ret)
> > > > > + goto out;
> > > > > +
> > > > > + break;
> > > > > + default:
> > > > > + /* not supported */
> > > >
> > > > No error code set?
> > >
> > > This is in an interrupt handler, so I didn't think there was anything
> > > we can do with an error.
> >
> > return IRQ_NONE?
> >
>
> Wouldn't this just cause the interrupt handler to trigger again
> immediately resulting in very high CPU load? I don't see any other IIO
> ADC drivers using the generic triggered buffer returning anything
> other than IRQ_HANDLED and I always assumed this was the reason.
>
To me, this is a long running 'open question' of what to do on error
in an interrupt. I my mind at least there isn't a good solution so we tend
to just paper over it.
IRQ_NONE indicates it wasn't our interrupt - so if we check a status
register and none of the interrupt bits are set, then it is either
a shared interrupt in which case someone else will handle it, or it
is spurious and we want the spurious interrupt handler to deal with it.
If we get an error talking tot he device during an interrupt handler
the question is do we want to trigger again? If it's a level interrupt
and we haven't cleared it we will anyway, but for edge interrupts we've
handled it as well as we can perhaps.
Anyhow, it's all a bit unclear so given we don't expect to get these
errors I tend to more prefer IRQ_HANDLED but if someone argues
strongly for IRQ_NONE I don't push back too hard.
If anyone has clear guidance on this then please link to it!
Jonathan
next prev parent reply other threads:[~2024-03-23 18:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-14 17:43 [PATCH v2] iio: adc: ad7944: Add support for "3-wire mode" David Lechner
2024-03-16 14:11 ` Jonathan Cameron
2024-03-16 19:57 ` Andy Shevchenko
2024-03-16 23:10 ` David Lechner
2024-03-17 8:23 ` Andy Shevchenko
2024-03-18 14:33 ` David Lechner
2024-03-23 18:20 ` Jonathan Cameron [this message]
2024-03-18 12:40 ` Jonathan Cameron
2024-03-18 13:09 ` Andy Shevchenko
2024-03-18 14:17 ` David Lechner
2024-03-18 16:25 ` Andy Shevchenko
2024-03-18 14:29 ` Jonathan Cameron
2024-03-19 18:42 ` Arnaldo Carvalho de Melo
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=20240323182041.5e1ef0bb@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy.shevchenko@gmail.com \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.hennerich@analog.com \
--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