From: Kanak Shilledar <Kanak.Shilledar@axis.com>
To: "joshua.crofts1@gmail.com" <joshua.crofts1@gmail.com>
Cc: "dlechner@baylibre.com" <dlechner@baylibre.com>,
Henrik Grimler <Henrik.Grimler@axis.com>,
"nuno.sa@analog.com" <nuno.sa@analog.com>,
"jean-baptiste.maneyrol@tdk.com" <jean-baptiste.maneyrol@tdk.com>,
"robh@kernel.org" <robh@kernel.org>,
"jic23@kernel.org" <jic23@kernel.org>,
"andy@kernel.org" <andy@kernel.org>,
"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
Kernel <Kernel@axis.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH 2/3] iio: accel: Add support for ICM42370P
Date: Thu, 13 Aug 2026 12:37:45 +0000 [thread overview]
Message-ID: <aba48fde655c2f1c0a10c335dd50a07a8a52fb5d.camel@axis.com> (raw)
In-Reply-To: <ba866b98384dcd827d5a610de9f00386da5824e2.camel@axis.com>
[-- Attachment #1: Type: text/plain, Size: 2550 bytes --]
Hi Joshua!
On Fri, 2026-08-07 at 15:40 +0200, Kanak Shilledar wrote:
> Hi Joshua,
>
> On Fri, 2026-08-07 at 12:09 +0200, Joshua Crofts wrote:
> > [You don't often get email from joshua.crofts1@gmail.com. Learn why
> > this is important at
> > https://aka.ms/LearnAboutSenderIdentification ]
> >
> > On Thu, 6 Aug 2026 14:46:28 +0200
> > Kanak Shilledar <kanak.shilledar@axis.com> wrote:
> >
> > > Add support for the Invensense ICM42370P MEMS MotionTracking 3-
> > > axis
> > > accelerometer with a built-in temperature sensor. Compared to
> > > other
> > > sensors from the same vendor ICM42370 uses a different way of
> > > handling
> > > register banks. Although the device supports I2C, SPI, and I3C,
> > > implement only I2C support. Provide basic support for raw sensor
> > > reads and a sysfs interface for setting the calibration bias.
> > > Keep
> > >
[snip]
> > > +static irqreturn_t inv_icm42370_irq_timestamp(int irq, void
> > > *_data)
> > > +{
> > > + struct inv_icm42370_data *dev_data = _data;
> > > +
> > > + dev_data->timestamp = iio_get_time_ns(dev_data-
> > > >indio_accel);
> > > +
> > > + return IRQ_WAKE_THREAD;
> > > +}
> > > +
> > > +static irqreturn_t inv_icm42370_irq_handler(int irq, void
> > > *_data)
> > > +{
> > > + struct inv_icm42370_data *dev_data = _data;
> > > + unsigned int status;
> > > + int ret;
> > > +
> > > + mutex_lock(&dev_data->lock);
> >
> > Use guard(mutex) from cleanup.h, it eliminates the need to use
> > gotos
> > and
> > labels for cleaning up functions (a lot of examples in IIO for
> > this).
>
> Will convert all instances of mutex operations with a guard(mutex).
>
> > > +
> > > + ret = regmap_read(dev_data->map,
> > > INV_ICM42370_REG_INT_STATUS,
> > > &status);
> > > + if (ret)
> > > + goto out_unlock;
> > > +
> > > +out_unlock:
> > > + mutex_unlock(&dev_data->lock);
> > > + return IRQ_HANDLED;
> >
> > Not sure, but is it okay to always return IRQ_HANDLED, even on
> > regmap
> > failure?
>
> From some reference drivers it seems to be common, but we will
> investigate this.
To conclude this thread, I went through the drivers and there are only
3 return values (c.f. linux/irqreturn.h) and interrupt is caused by the
device which is not shared by any other driver, thus we should mark the
interrupt as handled even on failure.
>
> >
> > >
Thanks and Regards,
Kanak Shilledar
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-08-13 12:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-06 12:46 [PATCH 0/3] Add driver for Invensense ICM42370P accelerometer Kanak Shilledar
2026-08-06 12:46 ` [PATCH 1/3] dt-bindings: Add InvenSense ICM-42370-p accelerometer Kanak Shilledar
2026-08-06 12:53 ` sashiko-bot
2026-08-07 10:16 ` Joshua Crofts
2026-08-07 13:15 ` Kanak Shilledar
2026-08-12 2:59 ` Rob Herring
2026-08-06 12:46 ` [PATCH 2/3] iio: accel: Add support for ICM42370P Kanak Shilledar
2026-08-06 13:02 ` sashiko-bot
2026-08-07 6:51 ` Uwe Kleine-König
2026-08-07 13:11 ` Kanak Shilledar
2026-08-07 10:09 ` Joshua Crofts
2026-08-07 13:41 ` Kanak Shilledar
2026-08-07 14:13 ` Joshua Crofts
2026-08-13 12:37 ` Kanak Shilledar [this message]
2026-08-08 16:06 ` Marcelo Schmitt
2026-08-06 12:46 ` [PATCH 3/3] iio: accel: icm42370: Add FIFO buffer functionality Kanak Shilledar
2026-08-06 13:03 ` sashiko-bot
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=aba48fde655c2f1c0a10c335dd50a07a8a52fb5d.camel@axis.com \
--to=kanak.shilledar@axis.com \
--cc=Henrik.Grimler@axis.com \
--cc=Kernel@axis.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jean-baptiste.maneyrol@tdk.com \
--cc=jic23@kernel.org \
--cc=joshua.crofts1@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
/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