diff options
| author | Andreas Kempe <andreas.kempe@actia.se> | 2026-07-02 10:41:23 +0000 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2026-07-03 19:34:47 +0100 |
| commit | aede83625ff5d9539508582036df30c809d51058 (patch) | |
| tree | 83da599f90fb00017592495c7ce6413371eec8eb /rust/zerocopy/rustdoc/git@git.tavy.me:linux-stable.git | |
| parent | fd354554af1d2b33232ca6c8a3d79ed82413d715 (diff) | |
iio: imu: st_lsm6dsx: deselect shub page before reading whoami
As part of driver initialization, e.g. st_lsm6dsx_init_shub() selects
the shub register page using st_lsm6dsx_set_page(). Selecting the shub
register page shadows the regular register space so whoami, among other
registers, is no longer accessible.
In applications where the IMU is permanently powered separately from the
processor, there is a window where a reset of the CPU leaves the IMU in
the shub register page. Once this occurs, any subsequent probe attempt
fails because of the register shadowing.
Using the ism330dlc, the error typically looks like
st_lsm6dsx_i2c 3-006a: unsupported whoami [10]
with the unknown whoami read from a reserved register in the shub page.
The reset register is also shadowed by the page select, preventing a
reset from recovering the chip.
Unconditionally clear the shub page before the whoami readout to ensure
normal register access and allow the initialization to proceed.
Place the fix in st_lsm6dsx_check_whoami() before the whoami check
because hw->settings, which st_lsm6dsx_set_page() relies on, is first
assigned in that function.
Placing the fix in a more logical place than the whoami check would
require a bigger restructuring of the code.
Fixes: c91c1c844ebd ("iio: imu: st_lsm6dsx: add i2c embedded controller support")
Signed-off-by: Andreas Kempe <andreas.kempe@actia.se>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'rust/zerocopy/rustdoc/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
