From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"Jean-Baptiste Maneyrol" <jean-baptiste.maneyrol@tdk.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Chris Morgan" <macromorgan@hotmail.com>,
"Luca Weiss" <luca.weiss@fairphone.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, "Conor Dooley" <conor@kernel.org>
Subject: Re: [PATCH v5 2/3] iio: imu: inv_icm42600: log whoami mismatch instead of failing probe
Date: Mon, 24 Aug 2026 11:52:07 +0300 [thread overview]
Message-ID: <aowGN8Ln9QMN6k_D@ashevche-desk.local> (raw)
In-Reply-To: <20260823003320.62192-3-jorijnvdgraaf@catcrafts.net>
On Sun, Aug 23, 2026 at 02:33:19AM +0200, Jorijn van der Graaf wrote:
> A WHOAMI value differing from the one the compatible implies aborts
> probe with -ENODEV, which prevents a register-compatible part described
> with a fallback compatible from probing at all.
>
> The devicetree compatible is authoritative for which part is fitted:
> log the mismatch at info level and continue. The message keeps a
> breadcrumb for anyone seeing an unexpected part change on their device
> versus the devicetree; tmp117 takes the same trade at the same level
> for its fallback matches.
>
> A whoami of 0x00 or 0xff still fails probe: SPI has no transfer-level
> ack, so those values mean nothing answered. Otherwise the probe outcome
> on mismatch changes for all parts the driver supports. The check sits
> before the mismatch comparison; it does not depend on hw->whoami, since
> no supported part uses either value (the WHOAMI values the driver
> defines span 0x40-0x5C). inv_icm45600 carries the same guard nested in
> its mismatch branch.
>
> Tested via a backport to a Fairphone 6 running a 7.1-based kernel: its
> ICM-42630 (WHOAMI 0x0C), described with an icm42631 fallback compatible
> and matched as icm42631, probes with the one informational line, and
> accelerometer, gyroscope and temperature reads work.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
...
> + /*
> + * SPI interface has no ack mechanism.
> + * 0xFF or 0x00 whoami means no response from the device.
> + */
> + if (val == U8_MAX || val == 0)
Not sure if U8_MAX is better or worse than simple 0xff, but either work for me.
> + return dev_err_probe(dev, -ENODEV,
> + "invalid whoami %#04x expected %#04x (%s)\n",
> + val, hw->whoami, hw->name);
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-08-24 8:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-23 0:33 [PATCH v5 0/3] iio: imu: inv_icm42600: add support for icm42630 Jorijn van der Graaf
2026-08-23 0:33 ` [PATCH v5 1/3] iio: imu: inv_icm42600: sort device id tables numerically Jorijn van der Graaf
2026-08-23 0:33 ` [PATCH v5 2/3] iio: imu: inv_icm42600: log whoami mismatch instead of failing probe Jorijn van der Graaf
2026-08-24 8:52 ` Andy Shevchenko [this message]
2026-08-23 0:33 ` [PATCH v5 3/3] dt-bindings: iio: imu: icm42600: add icm42630 Jorijn van der Graaf
2026-08-23 17:42 ` [PATCH v5 0/3] iio: imu: inv_icm42600: add support for icm42630 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=aowGN8Ln9QMN6k_D@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=conor@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jean-baptiste.maneyrol@tdk.com \
--cc=jic23@kernel.org \
--cc=jorijnvdgraaf@catcrafts.net \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.weiss@fairphone.com \
--cc=macromorgan@hotmail.com \
--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