Linux IIO development
 help / color / mirror / Atom feed
* [BUG] iio: imu: inv_icm42600: read temperature, Invalid Argument
@ 2025-07-07 14:42 Sean Nyekjaer
  2025-07-07 15:15 ` David Lechner
  2025-07-07 18:13 ` Jean-Baptiste Maneyrol
  0 siblings, 2 replies; 9+ messages in thread
From: Sean Nyekjaer @ 2025-07-07 14:42 UTC (permalink / raw)
  To: Jean-Baptiste Maneyrol, Jonathan Cameron, David Lechner
  Cc: linux-iio, Andy Shevchenko

Hi,

I'm having some weird issues with reading the temperature of the icm42605.
Kernel version: 6.16.0-rc5

# cat /sys/bus/iio/devices/iio:device2/name
icm42605-accel

When reading the temperature I get:
# cat /sys/bus/iio/devices/iio:device2/in_temp_raw
cat: read error: Invalid argument

But if I read from the accelerometer first, I will go better:
# cat /sys/bus/iio/devices/iio:device2/in_accel_x_raw
-378
# cat /sys/bus/iio/devices/iio:device2/in_temp_raw
600

Then after "some" time, I re-read the temperature I recieve
"Invalid argument" again.

I have traced the -EINVAL to inv_icm42600_temp_read() because I receive
INV_ICM42600_DATA_INVALID.

Register dump diff:
--- invalid-read
+++ ok-read
@@ -10,14 +10,14 @@
 0x1a = 0x00000010
 0x1b = 0x00000000
 0x1c = 0x00000000
-0x1d = 0x00000080
-0x1e = 0x00000000
-0x1f = 0x00000080
-0x20 = 0x00000000
-0x21 = 0x00000080
-0x22 = 0x00000000
-0x23 = 0x00000080
-0x24 = 0x00000000
+0x1d = 0x00000002
+0x1e = 0x00000038
+0x1f = 0x000000fe
+0x20 = 0x00000085
+0x21 = 0x000000fe
+0x22 = 0x000000df
+0x23 = 0x000000f8
+0x24 = 0x0000003a
 0x25 = 0x00000080
 0x26 = 0x00000000
 0x27 = 0x00000080
@@ -26,7 +26,7 @@
 0x2a = 0x00000000
 0x2b = 0x00000000
 0x2c = 0x00000000
-0x2d = 0x00000000
+0x2d = 0x00000008
 0x2e = 0x00000000
 0x2f = 0x00000000
 0x30 = 0x000000ff
@@ -59,11 +59,11 @@
 0x4b = 0x00000000
 0x4c = 0x00000032
 0x4d = 0x00000099
-0x4e = 0x00000000
+0x4e = 0x00000002
 0x4f = 0x00000009
 0x50 = 0x00000009
 0x51 = 0x00000016
-0x52 = 0x00000000
+0x52 = 0x00000060
 0x53 = 0x0000000d
 0x54 = 0x00000031
 0x55 = 0x00000000

Will the iio core retry a read? If the -EINVAL is returned,
inv_icm42600_accel_read_raw() is call once more.

One more thing...
When I'm removing the module, the kernel prints this:
inv-icm42600-i2c 1-0068: Runtime PM usage count underflow!

I will continue investigate this
Br,
Sean


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-08-08  8:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-07 14:42 [BUG] iio: imu: inv_icm42600: read temperature, Invalid Argument Sean Nyekjaer
2025-07-07 15:15 ` David Lechner
2025-07-07 18:13 ` Jean-Baptiste Maneyrol
2025-07-08 10:35   ` Jonathan Cameron
2025-07-08 12:21     ` Jean-Baptiste Maneyrol
2025-07-13 13:46       ` Jonathan Cameron
2025-07-14  5:29         ` Sean Nyekjaer
2025-07-27 16:53           ` Jonathan Cameron
2025-08-08  7:28             ` Jean-Baptiste Maneyrol

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox