summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/pinctrl-u300.c
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2017-08-12 16:09:21 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-08-30 08:21:53 (GMT)
commit23caaf2f216c2120e72705d7b297ce95724c97ae (patch)
tree947043ab4962dab702b8149997bf59c4cdc298d2 /drivers/pinctrl/pinctrl-u300.c
parentb150ee066af7dac804f92a44452bb2b862a6bc15 (diff)
downloadlinux-23caaf2f216c2120e72705d7b297ce95724c97ae.tar.xz
iio: hid-sensor-trigger: Fix the race with user space powering up sensors
commit f1664eaacec31035450132c46ed2915fd2b2049a upstream. It has been reported for a while that with iio-sensor-proxy service the rotation only works after one suspend/resume cycle. This required a wait in the systemd unit file to avoid race. I found a Yoga 900 where I could reproduce this. The problem scenerio is: - During sensor driver init, enable run time PM and also set a auto-suspend for 3 seconds. This result in one runtime resume. But there is a check to avoid a powerup in this sequence, but rpm is active - User space iio-sensor-proxy tries to power up the sensor. Since rpm is active it will simply return. But sensors were not actually powered up in the prior sequence, so actaully the sensors will not work - After 3 seconds the auto suspend kicks If we add a wait in systemd service file to fire iio-sensor-proxy after 3 seconds, then now everything will work as the runtime resume will actually powerup the sensor as this is a user request. To avoid this: - Remove the check to match user requested state, this will cause a brief powerup, but if the iio-sensor-proxy starts immediately it will still work as the sensors are ON. - Also move the autosuspend delay to place when user requested turn off of sensors, like after user finished raw read or buffer disable Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Tested-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-u300.c')
0 files changed, 0 insertions, 0 deletions