Hey,
TLDR:
# first bad commit: [50ba22479c324c0d9dc8134d519dcba92d83a8a7] Merge
back earlier ACPI PM material for v4.3.
hid-sensor-hub devices only start sending events through the IIO
trigger after a suspend/resume cycle.
Other IIO drivers don't seem to exhibit those problems.
The long version:
As some of you know, I maintain iio-sensor-proxy[1], which tries to
read sensor values for a number of sensor types (accelerometer, ambient
light, compass) for a number of drivers (IIO, input, hwmon).
I've had a lot of bug reports some time after creating the project[2],
with HID sensor hub devices, which are the most common type of compound
sensor device types in laptops and more expensive tablets.
The problem seems to be that IIO devices don't send any events about
new data, even though there is new data available. A suspend/resume
cycle corrects this. (Some people have also had some luck making sure
the iio-sensor-proxy didn't try to poke at the device this early after
the kernel loaded the driver, I cannot easily test this).
The problem wasn't there when I started the project (July 2014) and has
appeared since. I finally got access to a type of device which I can
use to replicate the problem. I used the ColorHugALS[3] as a test
device (which uses hid-sensor-hub and is a USB device).
Testing:
Tested on a Lenovo X1 Carbon from 2014 (the one with the horrible touch
function keys).
1) Apply the attached patch to iio-sensor-proxy, compile and install it
in place of the OS-provided one. Running "monitor-sensor" will just
wait for ALS events for 10 seconds, and can be used for "git bisect
run".
2) I used Fedora kernels to pin down which "dot-o" version of the
kernel first showed the problem. The problems started occurring between
4.2 and 4.3. I also verified this with "linus" kernel trees to make
sure a Fedora patch didn't cause the problem.
3) The kernel configuration is Fedora's "4.2.0-1" kernel config, with
"make localmodconfig" run on it, to cut down on compile time
4) For every commit that bisect told me to inspect, I compiled a new
kernel with "make rpm", installed it, warm rebooted, and ran "monitor-
sensor".
I ran the bisection 3 times, and always ended up on a merge commit.
I've attached the bisect logs for 2 of those runs.
I'd happily provide iio-sensor-proxy patches if someone only has access
to a hid-sensor-hub accelerometer.
Cheers
[1]: https://github.com/hadess/iio-sensor-proxy
[2]: https://github.com/hadess/iio-sensor-proxy/issues?utf8=%E2%9C%93&q=is:issue%20label:"driver%20bug"%20
[3]: http://www.hughski.com/colorhugals.html