Devicetree
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
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
Subject: Re: [PATCH v2 2/4] iio: imu: inv_icm42600: warn on whoami mismatch instead of failing probe
Date: Tue, 28 Jul 2026 17:51:57 +0100	[thread overview]
Message-ID: <20260728-extradite-yanking-42d918637f61@spud> (raw)
In-Reply-To: <20260724202708.128267-3-jorijnvdgraaf@catcrafts.net>

[-- Attachment #1: Type: text/plain, Size: 2193 bytes --]

On Fri, Jul 24, 2026 at 10:27:06PM +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:
> demote the mismatch to a warning and continue, as st_sensors does since
> commit a3c2c5c937ed ("iio: st_sensors: relax WhoAmI check in
> st_sensors_verify_id()"). This changes the probe outcome on mismatch
> for all parts the driver supports.
> 
> 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, warns once and probes, and accelerometer,
> gyroscope and temperature reads work.
> 
> Suggested-by: Conor Dooley <conor@kernel.org>

I don't want this to warn, I want it gone. Fallback use should not
produce a warning.

> Link: https://lore.kernel.org/all/20260722-creature-volley-0f083b904c1d@spud/
> Assisted-by: Claude:claude-fable-5
> Signed-off-by: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>
> ---
> New in v2.
>  drivers/iio/imu/inv_icm42600/inv_icm42600_core.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
> index dc97d8a274e3..f306e3ffca48 100644
> --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
> +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
> @@ -509,11 +509,9 @@ static int inv_icm42600_setup(struct inv_icm42600_state *st,
>  	ret = regmap_read(st->map, INV_ICM42600_REG_WHOAMI, &val);
>  	if (ret)
>  		return ret;
> -	if (val != hw->whoami) {
> -		dev_err(dev, "invalid whoami %#02x expected %#02x (%s)\n",
> -			val, hw->whoami, hw->name);
> -		return -ENODEV;
> -	}
> +	if (val != hw->whoami)
> +		dev_warn(dev, "unexpected whoami %#02x, expected %#02x (%s)\n",
> +			 val, hw->whoami, hw->name);
>  	st->name = hw->name;
>  
>  	/* reset to make sure previous state are not there */
> -- 
> 2.55.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  parent reply	other threads:[~2026-07-28 16:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24 20:27 [PATCH v2 0/4] iio: imu: inv_icm42600: add support for icm42630 Jorijn van der Graaf
2026-07-24 20:27 ` [PATCH v2 1/4] iio: imu: inv_icm42600: sort device id tables numerically Jorijn van der Graaf
2026-07-24 20:27 ` [PATCH v2 2/4] iio: imu: inv_icm42600: warn on whoami mismatch instead of failing probe Jorijn van der Graaf
2026-07-24 20:44   ` sashiko-bot
2026-07-28 16:51   ` Conor Dooley [this message]
2026-07-28 21:20     ` Jonathan Cameron
2026-07-24 20:27 ` [PATCH v2 3/4] dt-bindings: iio: imu: icm42600: add icm42630 Jorijn van der Graaf
2026-07-24 20:27 ` [PATCH v2 4/4] iio: imu: inv_icm42600: add support for icm42630 Jorijn van der Graaf
2026-07-28 16:53   ` Conor Dooley
2026-07-28 21:25     ` Jonathan Cameron
2026-07-27  1:50 ` [PATCH v2 0/4] " 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=20260728-extradite-yanking-42d918637f61@spud \
    --to=conor@kernel.org \
    --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=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