2025-05-22 9:25 PM
We observe mutually exclusive behavior in the LSM6DSVX driver:
With interrupts DISABLED:
Can successfully read raw values via sysfs:
cat /sys/bus/iio/devices/iio:deviceX/in_accel_x_raw # Returns valid data
With interrupts ENABLED:
Sysfs reads return 0:
cat /sys/bus/iio/devices/iio:deviceX/in_accel_x_raw # Returns 0
Kernel driver appears functional (interrupts fire in dmesg)
HAL receives flush events but no sensor data
Debugging Performed:
Confirmed IIO buffer configuration:
echo 1 > /sys/bus/iio/devices/iio:deviceX/buffer/enable
Verified no resource conflicts (lsof /dev/iio:device*)
Tested with/without FIFO mode - same behavior
Suspected Root Cause:
Driver may be locking out sysfs reads when interrupts are active, or buffer ownership isn't properly shared between interrupt and sysfs access modes.
Request:
Could you clarify:
Is this expected behavior in the LSM6DSVX driver?
Recommended workaround to allow both interrupt-driven AND sysfs access?
Any known patches or configuration flags to resolve this?
Additional Context:
Kernel: ______
HAL: android.hardware.sensors@2.0 (ST implementation)
Platform: i.MX8MM