Bug 1304035

Summary: iio-sensor-proxy can't read accelerometer or light sensor with linux kernel 4.3.4 or 4.3.5
Product: [Fedora] Fedora Reporter: Hashem Nasarat <hnasarat>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 23CC: bnocera, gansalmon, hashem, hnasarat, itamar, jonathan, kernel-maint, madhu.chinakonda, mchehab
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-26 16:41:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Hashem Nasarat 2016-02-02 17:46:09 UTC
Description of problem:
iio-sensor-proxy doesn't read from the accelerometer or light sensor under newer kernels in F23. With 4.2.3 I could rotate my thinkpad yoga 12 and the X display would rotate, and the light sensor would cause the brightness setting to change.



Version-Release number of selected component (if applicable):
kernel-4.2.3-300.fc23.x86_64 - working 
kernel-4.3.4-300.fc23.x86_64 - not working 
kernel-4.3.5-300.fc23.x86_64 - not working


How reproducible:
very?


Steps to Reproduce:
0. boot with 4.3.4 or 4.3.5 (from updates-testing)
1. sudo systemctl stop iio-sensor-proxy
2. sudo G_MESSAGES_DEBUG=all /sbin/iio-sensor-proxy
3. observe that "DEBUG: No new data available" is printed

Actual results:
nonworking output in newer kernel:
** (process:3452): DEBUG: Found als at /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200041.7.auto/iio:device5
** (process:3452): DEBUG: Found device /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200041.7.auto/iio:device5 of type ambient light sensor at IIO Buffer Light sensor
** (process:3452): DEBUG: Found accel_3d at /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200073.2.auto/iio:device2
** (process:3452): DEBUG: Found device /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200073.2.auto/iio:device2 of type accelerometer at IIO Buffer accelerometer
** (process:3452): DEBUG: Found magn_3d at /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200083.4.auto/iio:device1
** (process:3452): DEBUG: Found device /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200083.4.auto/iio:device1 of type compass at IIO Buffer Compass
** (process:3452): DEBUG: Found associated trigger at /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200073.2.auto/trigger2
** (process:3452): DEBUG: Got type for in_accel_x: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:3452): DEBUG: Got type for in_accel_y: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:3452): DEBUG: Got type for in_accel_z: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:3452): DEBUG: Built channel array for in_accel_x: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:3452): DEBUG: Built channel array for in_accel_y: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:3452): DEBUG: Built channel array for in_accel_z: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:3452): DEBUG: Found associated trigger at /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200041.7.auto/trigger5
** (process:3452): DEBUG: Got type for in_intensity_both: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:3452): DEBUG: Built channel array for in_intensity_both: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:3452): DEBUG: Found associated trigger at /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200083.4.auto/trigger1
** (process:3452): DEBUG: Got type for in_magn_x: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:3452): DEBUG: Got type for in_magn_y: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:3452): DEBUG: Got type for in_magn_z: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:3452): DEBUG: Got type for in_rot_from_north_magnetic_tilt_comp: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:3452): DEBUG: Built channel array for in_magn_x: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:3452): DEBUG: Built channel array for in_magn_y: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:3452): DEBUG: Built channel array for in_magn_z: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:3452): DEBUG: Built channel array for in_rot_from_north_magnetic_tilt_comp: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:3452): DEBUG: Handling driver refcounting method 'ClaimLight' for ambient light sensor device
** (process:3452): DEBUG: Handling driver refcounting method 'ClaimLight' for ambient light sensor device
** (process:3452): DEBUG: Handling driver refcounting method 'ClaimAccelerometer' for accelerometer device
** (process:3452): DEBUG: Handling driver refcounting method 'ClaimAccelerometer' for accelerometer device
** (process:3452): DEBUG: No new data available
** (process:3452): DEBUG: No new data available

Expected results:
rotation and brightness control works
(working output in newer kernel below)

Additional info:
This is a brand new F23 install.

Comment 1 Hashem Nasarat 2016-02-02 23:01:04 UTC
Here's the working output with the older kernel:

** (process:20219): DEBUG: Found als at /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200041.7.auto/iio:device5
** (process:20219): DEBUG: Found device /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200041.7.auto/iio:device5 of type ambient light sensor at IIO Buffer Light sensor
** (process:20219): DEBUG: Found accel_3d at /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200073.2.auto/iio:device0
** (process:20219): DEBUG: Found device /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200073.2.auto/iio:device0 of type accelerometer at IIO Buffer accelerometer
** (process:20219): DEBUG: Found magn_3d at /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200083.4.auto/iio:device3
** (process:20219): DEBUG: Found device /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200083.4.auto/iio:device3 of type compass at IIO Buffer Compass
** (process:20219): DEBUG: Found associated trigger at /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200073.2.auto/trigger0
** (process:20219): DEBUG: Got type for in_accel_x: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:20219): DEBUG: Got type for in_accel_y: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:20219): DEBUG: Got type for in_accel_z: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:20219): DEBUG: Built channel array for in_accel_x: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:20219): DEBUG: Built channel array for in_accel_y: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:20219): DEBUG: Built channel array for in_accel_z: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:20219): DEBUG: Found associated trigger at /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200041.7.auto/trigger5
** (process:20219): DEBUG: Got type for in_intensity_both: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:20219): DEBUG: Built channel array for in_intensity_both: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:20219): DEBUG: Found associated trigger at /sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.7/3-1.7:1.0/0003:0483:91D1.0001/HID-SENSOR-200083.4.auto/trigger3
** (process:20219): DEBUG: Got type for in_magn_x: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:20219): DEBUG: Got type for in_magn_y: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:20219): DEBUG: Got type for in_magn_z: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:20219): DEBUG: Got type for in_rot_from_north_magnetic_tilt_comp: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:20219): DEBUG: Built channel array for in_magn_x: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:20219): DEBUG: Built channel array for in_magn_y: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:20219): DEBUG: Built channel array for in_magn_z: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:20219): DEBUG: Built channel array for in_rot_from_north_magnetic_tilt_comp: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:20219): DEBUG: Handling driver refcounting method 'ClaimLight' for ambient light sensor device
** (process:20219): DEBUG: Handling driver refcounting method 'ClaimLight' for ambient light sensor device
** (process:20219): DEBUG: Handling driver refcounting method 'ClaimAccelerometer' for accelerometer device
** (process:20219): DEBUG: Handling driver refcounting method 'ClaimAccelerometer' for accelerometer device
** (process:20219): DEBUG: Read from IIO: 14.000000
** (process:20219): DEBUG: Light level sent by driver (quirk applied): 14.000000 (unit: lux)
** (process:20219): DEBUG: Emitted light changed: from 0.000000 to 14.000000
** (process:20219): DEBUG: Read from IIO: 47000, -1028000, -299000
** (process:20219): DEBUG: Accel sent by driver (quirk applied): 0, 9, -2
** (process:20219): DEBUG: Emitted orientation changed: from undefined to normal
** (process:20219): DEBUG: No new data available
** (process:20219): DEBUG: Read from IIO: 45000, -1021000, -275000
** (process:20219): DEBUG: Accel sent by driver (quirk applied): 0, 9, -2
** (process:20219): DEBUG: No new data available
** (process:20219): DEBUG: Read from IIO: 33000, -1020000, -260000
** (process:20219): DEBUG: Accel sent by driver (quirk applied): 0, 9, -2

Comment 2 Hashem Nasarat 2016-02-02 23:06:59 UTC
Only difference are the device numbers and that the latter actually receives data at the end of the logs.

Comment 3 Hashem Nasarat 2016-02-08 02:46:05 UTC
Upstream bug https://bugzilla.kernel.org/show_bug.cgi?id=109501

Comment 4 Laura Abbott 2016-09-23 19:21:15 UTC
*********** MASS BUG UPDATE **************
 
We apologize for the inconvenience.  There is a large number of bugs to go through and several of them have gone stale.  Due to this, we are doing a mass bug update across all of the Fedora 23 kernel bugs.
 
Fedora 23 has now been rebased to 4.7.4-100.fc23.  Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel.
 
If you have moved on to Fedora 24 or 25, and are still experiencing this issue, please change the version to Fedora 24 or 25.
 
If you experience different issues, please open a new bug report for those.

Comment 5 Laura Abbott 2016-10-26 16:41:43 UTC
*********** MASS BUG UPDATE **************
This bug is being closed with INSUFFICIENT_DATA as there has not been a response in 4 weeks. If you are still experiencing this issue, please reopen and attach the relevant data from the latest kernel you are running and any data that might have been requested previously.