From: sashiko-bot@kernel.org
To: "Kanak Shilledar" <kanak.shilledar@axis.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v4 3/5] iio: imu: inv_icm42607: Add support for ICM-42370-P
Date: Thu, 17 Sep 2026 13:49:56 +0000 [thread overview]
Message-ID: <20260917134957.273611F00899@smtp.kernel.org> (raw)
In-Reply-To: <20260917-b4-inv_icm42370p-v4-3-fd9373f123c9@axis.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] iio: inv_icm42607: writing reserved values to gyro registers on accel-only device
--
commit cafef20bbc68d8f84bfd67491344163a59e13b31
Author: Kanak Shilledar <kanak.shilledar@axis.com>
iio: imu: inv_icm42607: Add support for ICM-42370-P
Add support for the Invensense ICM-42370-P MEMS MotionTracking 3-axis
accelerometer with built-in temperature sensor. This device is almost
identical to the existing Invensense ICM-42607-P IMU, but lacks
gyroscope.
> diff --git a/drivers/iio/imu/inv_icm42607/inv_icm42607_core.c b/drivers/iio/imu/inv_icm42607/inv_icm42607_core.c
> index 190e998f7b8ef..114e7afcda391 100644
> --- a/drivers/iio/imu/inv_icm42607/inv_icm42607_core.c
> +++ b/drivers/iio/imu/inv_icm42607/inv_icm42607_core.c
> @@ -92,10 +92,27 @@ static const struct inv_icm42607_conf inv_icm42607_default_conf = {
> },
> };
>
> +static const struct inv_icm42607_conf inv_icm42370_default_conf = {
> + .accel = {
> + .mode = INV_ICM42607_SENSOR_MODE_OFF,
> + .fs = INV_ICM42607_ACCEL_FS_4G,
> + .odr = INV_ICM42607_ODR_100HZ,
> + .filter = INV_ICM42607_FILTER_BW_25HZ,
> + },
> +};
[Severity: Medium]
Does this uninitialized gyro configuration write reserved values to the device?
Because the gyro field is not initialized, its subfields default to 0.
During probe, inv_icm42607_setup() calls inv_icm42607_set_init_conf(),
which unconditionally writes the gyro configuration without checking
st->hw->has_gyro:
drivers/iio/imu/inv_icm42607/inv_icm42607_core.c:inv_icm42607_set_init_conf() {
...
val = FIELD_PREP(INV_ICM42607_GYRO_CONFIG0_FS_SEL_MASK, conf->gyro.fs);
val |= FIELD_PREP(INV_ICM42607_GYRO_CONFIG0_ODR_MASK, conf->gyro.odr);
ret = regmap_write(st->map, INV_ICM42607_REG_GYRO_CONFIG0, val);
...
}
Writing 0 to the ODR field (which is reserved for values 0-4) could cause
hardware faults or undefined behavior.
Could we add a has_gyro check in inv_icm42607_set_init_conf() or initialize
the gyro field properly to avoid this regression?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260917-b4-inv_icm42370p-v4-0-fd9373f123c9@axis.com?part=3
next prev parent reply other threads:[~2026-09-17 13:50 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 13:38 [PATCH v4 0/5] Add support for InvenSense ICM-42370-P accelerometer Kanak Shilledar
2026-09-17 13:38 ` [PATCH v4 1/5] dt-bindings: Add InvenSense ICM-42370-p accelerometer Kanak Shilledar
2026-09-20 13:52 ` Marcelo Schmitt
2026-09-28 8:55 ` Kanak Shilledar
2026-09-28 17:56 ` Rob Herring
2026-09-29 15:15 ` Marcelo Schmitt
2026-09-28 17:58 ` Rob Herring
2026-09-17 13:38 ` [PATCH v4 2/5] iio: imu: inv_icm42607: Simplify IIO channel macros Kanak Shilledar
2026-09-20 13:55 ` Marcelo Schmitt
2026-09-20 23:29 ` Jonathan Cameron
2026-09-17 13:38 ` [PATCH v4 3/5] iio: imu: inv_icm42607: Add support for ICM-42370-P Kanak Shilledar
2026-09-17 13:49 ` sashiko-bot [this message]
2026-09-20 14:03 ` Marcelo Schmitt
2026-09-20 23:33 ` Jonathan Cameron
2026-09-17 13:38 ` [PATCH v4 4/5] iio: imu: inv_icm42607: Implement MREGx register access Kanak Shilledar
2026-09-17 13:51 ` sashiko-bot
2026-09-20 14:09 ` Marcelo Schmitt
2026-09-20 23:51 ` Jonathan Cameron
2026-09-17 13:38 ` [PATCH v4 5/5] iio: imu: inv_icm42607: Add accelerometer calibbias support Kanak Shilledar
2026-09-17 13:50 ` sashiko-bot
2026-09-20 23:55 ` 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=20260917134957.273611F00899@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kanak.shilledar@axis.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.