Bug 1301961 - Screen orientation and ambient light sensors do not work after suspend
Screen orientation and ambient light sensors do not work after suspend
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Kernel Maintainer List
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2016-01-26 07:48 EST by Rodrigo Kassick
Modified: 2017-02-20 13:46 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-10-26 12:52:22 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
dmesg output (78.50 KB, text/plain)
2016-01-26 07:48 EST, Rodrigo Kassick
no flags Details

  None (edit)
Description Rodrigo Kassick 2016-01-26 07:48:28 EST
Created attachment 1118471 [details]
dmesg output

The HID sensors for screen orientation and ambient light stop working after returning from suspension with kernels 4.3.3-{300, 301}.

The issue was not present on 4.2.8-300

Hardware: Dell Inspiron 15 series 7000 (I15-7558-A20), Core I7 (i7-5500U)

Kernel 4.3.3-{300, 301}

How reproducible:

Steps to Reproduce:
1. Boot the system, log in -- ambient light sensor and screen orientation work fine
2. Suspend
3. Resume

Actual results: The screen does not adjust brightness automatically, neighter screen orientation is adjusted if I turn the notebook around. monitor-sensor outputs nothing.

Expected results:
Ambient light and screen orientation sensors remain working after resume

Additional info:

- If I rmmod/modprobe hid_sensors_{rotation, incl_3d, gyro, etc.} I get a "unbalanced pm_runtime_enable" message on dmesg, and sensors remain non-functional:

     [  557.769724] hid_sensor_rotation HID-SENSOR-20008a.6.auto: Unbalanced pm_runtime_enable!
     [  562.624474] hid_sensor_incl_3d HID-SENSOR-200086.5.auto: Unbalanced pm_runtime_enable!

- I tried rmmod'ing the hid_sensors before suspension and bringing them back during resume, to no avail.
Comment 1 Rodrigo Kassick 2016-01-26 08:11:37 EST
Still present with kernel 4.3.4-300 (updates-testing)

here's the output of monitor-sensor. Notice that on suspention, the sensors disappear, reappear on resume and then they don't "sense" anything else:
▶ monitor-sensor  
** Message: Light changed: 2768.000000 (lux)
** Message: Light changed: 2763.000000 (lux)
** Message: Light changed: 2778.000000 (lux)
** Message: Light changed: 2816.000000 (lux)
** Message: Light changed: 2554.000000 (lux)
** Message: Accelerometer orientation changed: right-up
** Message: Light changed: 2315.000000 (lux)
** Message: Light changed: 2322.000000 (lux)
** Message: Light changed: 2310.000000 (lux)
** Message: Light changed: 2744.000000 (lux)
** Message: Accelerometer orientation changed: normal
** Message: Light changed: 2869.000000 (lux)
** Message: Light changed: 2832.000000 (lux)
** Message: Light changed: 2795.000000 (lux)
** Message: Light changed: 2756.000000 (lux)
** Message: Light changed: 2738.000000 (lux)
** Message: Light changed: 2755.000000 (lux)
** Message: Light changed: 2795.000000 (lux)
** Message: Light changed: 2818.000000 (lux)
** Message: Light changed: 2800.000000 (lux)
** Message: Light changed: 2820.000000 (lux)
** Message: Light sensor disappeared
** Message: Accelerometer disappeared
** Message: Accelerometer appeared
** Message: Accelerometer orientation changed: undefined
** Message: Light sensor appeared
** Message: Light changed: 0.000000 (lux)
Comment 2 Rodrigo Kassick 2016-02-17 12:24:12 EST
Seems like it's fixed on mainline (4.5.0-0.rc4.git0.1.vanilla.knurd.1.fc23.x86_64)
Comment 3 Josh Boyer 2016-02-18 11:04:48 EST
There's nothing that has changed in the IIO based hid drivers themselves between 4.3 and 4.5-rc4.  Looking briefly, the only thing I've found that might have fixed this is commit 64bebefcf3195baed3d15dc377e15d1e7121036a:

commit 64bebefcf3195baed3d15dc377e15d1e7121036a
Author: Fu, Zhonghui <zhonghui.fu@linux.intel.com>
Date:   Thu Sep 24 14:06:31 2015 +0800

    HID: enable hid device to suspend/resume asynchronously

If that is indeed the solution here, then I don't believe there's much we can do from a 4.3 standpoint.  That commit itself is tiny, but it depends on the power management infrastructure to provide the support.  That is likely too large to backport.
Comment 4 Laura Abbott 2016-09-23 15:40:33 EDT
*********** 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 12:52:22 EDT
*********** 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.
Comment 6 Rodrigo Kassick 2017-02-20 13:46:29 EST
This bug is no longer present with up-to-date kernels in F24 and F25

Note You need to log in before you can comment on or make changes to this bug.