Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
On Thu, 2017-04-06 at 04:58 +, Song, Hongyan wrote: > Hi Srinivas, > I have checked the patch dose not meets my requirement for ISH. > With this patch sensor properties still losing after resume from S3. What is your test case? I want to try. Thanks, Srinivas > > BR > Song Hongyan > > -Original Message- > From: Srinivas Pandruvada [mailto:srinivas.pandruv...@linux.intel.com > ] > Sent: Wednesday, April 5, 2017 11:36 PM > To: r...@researchut.com; Song, Hongyan <hongyan.s...@intel.com>; > linux-iio <linux-...@vger.kernel.org> > Cc: sta...@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get > poll value function order to avoid sensor properties losing after > resume from S3 > > Hi Hongyan, > > Can you check if the patch meets your requirement/needs for ISH? > > Thanks, > Srinivas > > On Wed, 2017-04-05 at 16:21 +0530, Ritesh Raj Sarraf wrote: > > > > On Tue, 2017-04-04 at 17:44 -0700, Srinivas Pandruvada wrote: > > > > > > > > > Hi Ritesh, > > > > > > Does the attached patch helps? > > Thank you Srinivas. I tested your patch on top of 4.10.8 and it is > > working perfect. > > > > Ritesh > >
Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
On Thu, 2017-04-06 at 04:58 +, Song, Hongyan wrote: > Hi Srinivas, > I have checked the patch dose not meets my requirement for ISH. > With this patch sensor properties still losing after resume from S3. What is your test case? I want to try. Thanks, Srinivas > > BR > Song Hongyan > > -Original Message- > From: Srinivas Pandruvada [mailto:srinivas.pandruv...@linux.intel.com > ] > Sent: Wednesday, April 5, 2017 11:36 PM > To: r...@researchut.com; Song, Hongyan ; > linux-iio > Cc: sta...@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get > poll value function order to avoid sensor properties losing after > resume from S3 > > Hi Hongyan, > > Can you check if the patch meets your requirement/needs for ISH? > > Thanks, > Srinivas > > On Wed, 2017-04-05 at 16:21 +0530, Ritesh Raj Sarraf wrote: > > > > On Tue, 2017-04-04 at 17:44 -0700, Srinivas Pandruvada wrote: > > > > > > > > > Hi Ritesh, > > > > > > Does the attached patch helps? > > Thank you Srinivas. I tested your patch on top of 4.10.8 and it is > > working perfect. > > > > Ritesh > >
RE: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
Hi Srinivas, I have checked the patch dose not meets my requirement for ISH. With this patch sensor properties still losing after resume from S3. BR Song Hongyan -Original Message- From: Srinivas Pandruvada [mailto:srinivas.pandruv...@linux.intel.com] Sent: Wednesday, April 5, 2017 11:36 PM To: r...@researchut.com; Song, Hongyan <hongyan.s...@intel.com>; linux-iio <linux-...@vger.kernel.org> Cc: sta...@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3 Hi Hongyan, Can you check if the patch meets your requirement/needs for ISH? Thanks, Srinivas On Wed, 2017-04-05 at 16:21 +0530, Ritesh Raj Sarraf wrote: > On Tue, 2017-04-04 at 17:44 -0700, Srinivas Pandruvada wrote: > > > > Hi Ritesh, > > > > Does the attached patch helps? > > Thank you Srinivas. I tested your patch on top of 4.10.8 and it is > working perfect. > > Ritesh >
RE: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
Hi Srinivas, I have checked the patch dose not meets my requirement for ISH. With this patch sensor properties still losing after resume from S3. BR Song Hongyan -Original Message- From: Srinivas Pandruvada [mailto:srinivas.pandruv...@linux.intel.com] Sent: Wednesday, April 5, 2017 11:36 PM To: r...@researchut.com; Song, Hongyan ; linux-iio Cc: sta...@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3 Hi Hongyan, Can you check if the patch meets your requirement/needs for ISH? Thanks, Srinivas On Wed, 2017-04-05 at 16:21 +0530, Ritesh Raj Sarraf wrote: > On Tue, 2017-04-04 at 17:44 -0700, Srinivas Pandruvada wrote: > > > > Hi Ritesh, > > > > Does the attached patch helps? > > Thank you Srinivas. I tested your patch on top of 4.10.8 and it is > working perfect. > > Ritesh >
Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
Hi Hongyan, Can you check if the patch meets your requirement/needs for ISH? Thanks, Srinivas On Wed, 2017-04-05 at 16:21 +0530, Ritesh Raj Sarraf wrote: > On Tue, 2017-04-04 at 17:44 -0700, Srinivas Pandruvada wrote: > > > > Hi Ritesh, > > > > Does the attached patch helps? > > Thank you Srinivas. I tested your patch on top of 4.10.8 and it is > working > perfect. > > Ritesh >
Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
Hi Hongyan, Can you check if the patch meets your requirement/needs for ISH? Thanks, Srinivas On Wed, 2017-04-05 at 16:21 +0530, Ritesh Raj Sarraf wrote: > On Tue, 2017-04-04 at 17:44 -0700, Srinivas Pandruvada wrote: > > > > Hi Ritesh, > > > > Does the attached patch helps? > > Thank you Srinivas. I tested your patch on top of 4.10.8 and it is > working > perfect. > > Ritesh >
Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
On Tue, 2017-04-04 at 17:44 -0700, Srinivas Pandruvada wrote: > Hi Ritesh, > > Does the attached patch helps? Thank you Srinivas. I tested your patch on top of 4.10.8 and it is working perfect. Ritesh -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com "Necessity is the mother of invention." signature.asc Description: This is a digitally signed message part
Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
On Tue, 2017-04-04 at 17:44 -0700, Srinivas Pandruvada wrote: > Hi Ritesh, > > Does the attached patch helps? Thank you Srinivas. I tested your patch on top of 4.10.8 and it is working perfect. Ritesh -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com "Necessity is the mother of invention." signature.asc Description: This is a digitally signed message part
RE: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
Hi Ritesh, I do not have the environment so should not have a try but I think Srinivas's patch should be Ok for your platform. Please have a try. Thanks a lot! BR Song Hongyan -Original Message- From: Ritesh Raj Sarraf [mailto:r...@researchut.com] Sent: Tuesday, April 4, 2017 3:14 AM To: Srinivas Pandruvada <srinivas.pandruv...@linux.intel.com>; Song, Hongyan <hongyan.s...@intel.com>; linux-iio <linux-...@vger.kernel.org> Cc: sta...@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3 Adding Stable, LKML and IIO MLs. Hello Hongyan, Do you have any feedback ? With the bisected commit reverted, I've been successfully running the machine without any issues. Ritesh On Sat, 2017-04-01 at 08:14 -0700, Srinivas Pandruvada wrote: > Hello Hongyan, > > Can you check the findings of Ritesh? > > Thanks, > Srinivas > > On Sat, 2017-04-01 at 14:07 +0530, Ritesh Raj Sarraf wrote: > > Hello Srinivas, > > > > With the Linux 4.10.7 release, I have encountered a regression > > introduced on my Lenovo Yoga 2 13, for the ITE Rotation Sensor. > > > > > > rrs@learner:~$ lsusb > > Bus 001 Device 002: ID 8087:8000 Intel Corp. Bus 001 Device 001: ID > > 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID > > 1d6b:0003 Linux Foundation 3.0 root hub Bus 002 Device 006: ID > > 048d:8350 Integrated Technology Express, Inc. > > Bus 002 Device 005: ID 0bda:b728 Realtek Semiconductor Corp. Bus 002 > > Device 004: ID 04f2:b40f Chicony Electronics Co., Ltd Bus 002 Device > > 003: ID 04f3:0303 Elan Microelectronics Corp. > > Bus 002 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 > > Card Reader Controller Bus 002 Device 001: ID 1d6b:0002 Linux > > Foundation 2.0 root hub > > 2017-04-01 / 14:04:49 ♒♒♒ ☺ > > > > > > The ITE sensors do not feed any data on the 4.10.7 kernel. Reverting > > back to > > 4.10.5, everything works back. > > > > > > After a git bisect, the culprit reported is: > > > > Bisecting: 0 revisions left to test after this (roughly 0 steps) > > [6c2aab07d12436af1cd8d9ac1d117a442cc91eec] iio: hid-sensor-trigger: > > Change get > > poll value function order to avoid sensor properties losing after > > resume from S3 > > 1 > > > > Can you please review my findings to confirm that it really is a > > regression bug > > ? > > > > > > Thanks, > > Ritesh > > -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com "Necessity is the mother of invention."
RE: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
Hi Ritesh, I do not have the environment so should not have a try but I think Srinivas's patch should be Ok for your platform. Please have a try. Thanks a lot! BR Song Hongyan -Original Message- From: Ritesh Raj Sarraf [mailto:r...@researchut.com] Sent: Tuesday, April 4, 2017 3:14 AM To: Srinivas Pandruvada ; Song, Hongyan ; linux-iio Cc: sta...@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3 Adding Stable, LKML and IIO MLs. Hello Hongyan, Do you have any feedback ? With the bisected commit reverted, I've been successfully running the machine without any issues. Ritesh On Sat, 2017-04-01 at 08:14 -0700, Srinivas Pandruvada wrote: > Hello Hongyan, > > Can you check the findings of Ritesh? > > Thanks, > Srinivas > > On Sat, 2017-04-01 at 14:07 +0530, Ritesh Raj Sarraf wrote: > > Hello Srinivas, > > > > With the Linux 4.10.7 release, I have encountered a regression > > introduced on my Lenovo Yoga 2 13, for the ITE Rotation Sensor. > > > > > > rrs@learner:~$ lsusb > > Bus 001 Device 002: ID 8087:8000 Intel Corp. Bus 001 Device 001: ID > > 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID > > 1d6b:0003 Linux Foundation 3.0 root hub Bus 002 Device 006: ID > > 048d:8350 Integrated Technology Express, Inc. > > Bus 002 Device 005: ID 0bda:b728 Realtek Semiconductor Corp. Bus 002 > > Device 004: ID 04f2:b40f Chicony Electronics Co., Ltd Bus 002 Device > > 003: ID 04f3:0303 Elan Microelectronics Corp. > > Bus 002 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 > > Card Reader Controller Bus 002 Device 001: ID 1d6b:0002 Linux > > Foundation 2.0 root hub > > 2017-04-01 / 14:04:49 ♒♒♒ ☺ > > > > > > The ITE sensors do not feed any data on the 4.10.7 kernel. Reverting > > back to > > 4.10.5, everything works back. > > > > > > After a git bisect, the culprit reported is: > > > > Bisecting: 0 revisions left to test after this (roughly 0 steps) > > [6c2aab07d12436af1cd8d9ac1d117a442cc91eec] iio: hid-sensor-trigger: > > Change get > > poll value function order to avoid sensor properties losing after > > resume from S3 > > 1 > > > > Can you please review my findings to confirm that it really is a > > regression bug > > ? > > > > > > Thanks, > > Ritesh > > -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com "Necessity is the mother of invention."
RE: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
Hi All, Sorry for the late response, for I am on Qingming Festival for the last 3 days. I noticed Ritesh has tried a USB sensor, I do not have that kind of sensor at hand and have not tried it yet. My patch worked well for ISH but I am not sure whether it is fine for USB sensor. Sorry for not much information can provide. I will try to see if I can find one device and try. BR Song Hongyan -Original Message- From: Srinivas Pandruvada [mailto:srinivas.pandruv...@linux.intel.com] Sent: Wednesday, April 5, 2017 8:45 AM To: r...@researchut.com; Song, Hongyan <hongyan.s...@intel.com>; linux-iio <linux-...@vger.kernel.org> Cc: sta...@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3 Hi Ritesh, Does the attached patch helps? Thanks, Srinivas On Tue, 2017-04-04 at 00:44 +0530, Ritesh Raj Sarraf wrote: > Adding Stable, LKML and IIO MLs. > > Hello Hongyan, > > Do you have any feedback ? With the bisected commit reverted, I've > been successfully running the machine without any issues. > > Ritesh > > > On Sat, 2017-04-01 at 08:14 -0700, Srinivas Pandruvada wrote: > > Hello Hongyan, > > > > Can you check the findings of Ritesh? > > > > Thanks, > > Srinivas > > > > On Sat, 2017-04-01 at 14:07 +0530, Ritesh Raj Sarraf wrote: > > > Hello Srinivas, > > > > > > With the Linux 4.10.7 release, I have encountered a regression > > > introduced on my Lenovo Yoga 2 13, for the ITE Rotation Sensor. > > > > > > > > > rrs@learner:~$ lsusb > > > Bus 001 Device 002: ID 8087:8000 Intel Corp. Bus 001 Device 001: > > > ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID > > > 1d6b:0003 Linux Foundation 3.0 root hub Bus 002 Device 006: ID > > > 048d:8350 Integrated Technology Express, Inc. > > > Bus 002 Device 005: ID 0bda:b728 Realtek Semiconductor Corp. Bus > > > 002 Device 004: ID 04f2:b40f Chicony Electronics Co., Ltd Bus 002 > > > Device 003: ID 04f3:0303 Elan Microelectronics Corp. > > > Bus 002 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. > > > RTS5129 > > > Card Reader > > > Controller > > > Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > > > 2017-04-01 / 14:04:49 ♒♒♒ ☺ > > > > > > > > > The ITE sensors do not feed any data on the 4.10.7 kernel. > > > Reverting > > > back to > > > 4.10.5, everything works back. > > > > > > > > > After a git bisect, the culprit reported is: > > > > > > Bisecting: 0 revisions left to test after this (roughly 0 steps) > > > [6c2aab07d12436af1cd8d9ac1d117a442cc91eec] iio: hid-sensor- > > > trigger: > > > Change get > > > poll value function order to avoid sensor properties losing after > > > resume from S3 > > > 1 > > > > > > Can you please review my findings to confirm that it really is a > > > regression bug ? > > > > > > > > > Thanks, > > > Ritesh > > >
RE: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
Hi All, Sorry for the late response, for I am on Qingming Festival for the last 3 days. I noticed Ritesh has tried a USB sensor, I do not have that kind of sensor at hand and have not tried it yet. My patch worked well for ISH but I am not sure whether it is fine for USB sensor. Sorry for not much information can provide. I will try to see if I can find one device and try. BR Song Hongyan -Original Message- From: Srinivas Pandruvada [mailto:srinivas.pandruv...@linux.intel.com] Sent: Wednesday, April 5, 2017 8:45 AM To: r...@researchut.com; Song, Hongyan ; linux-iio Cc: sta...@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3 Hi Ritesh, Does the attached patch helps? Thanks, Srinivas On Tue, 2017-04-04 at 00:44 +0530, Ritesh Raj Sarraf wrote: > Adding Stable, LKML and IIO MLs. > > Hello Hongyan, > > Do you have any feedback ? With the bisected commit reverted, I've > been successfully running the machine without any issues. > > Ritesh > > > On Sat, 2017-04-01 at 08:14 -0700, Srinivas Pandruvada wrote: > > Hello Hongyan, > > > > Can you check the findings of Ritesh? > > > > Thanks, > > Srinivas > > > > On Sat, 2017-04-01 at 14:07 +0530, Ritesh Raj Sarraf wrote: > > > Hello Srinivas, > > > > > > With the Linux 4.10.7 release, I have encountered a regression > > > introduced on my Lenovo Yoga 2 13, for the ITE Rotation Sensor. > > > > > > > > > rrs@learner:~$ lsusb > > > Bus 001 Device 002: ID 8087:8000 Intel Corp. Bus 001 Device 001: > > > ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID > > > 1d6b:0003 Linux Foundation 3.0 root hub Bus 002 Device 006: ID > > > 048d:8350 Integrated Technology Express, Inc. > > > Bus 002 Device 005: ID 0bda:b728 Realtek Semiconductor Corp. Bus > > > 002 Device 004: ID 04f2:b40f Chicony Electronics Co., Ltd Bus 002 > > > Device 003: ID 04f3:0303 Elan Microelectronics Corp. > > > Bus 002 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. > > > RTS5129 > > > Card Reader > > > Controller > > > Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > > > 2017-04-01 / 14:04:49 ♒♒♒ ☺ > > > > > > > > > The ITE sensors do not feed any data on the 4.10.7 kernel. > > > Reverting > > > back to > > > 4.10.5, everything works back. > > > > > > > > > After a git bisect, the culprit reported is: > > > > > > Bisecting: 0 revisions left to test after this (roughly 0 steps) > > > [6c2aab07d12436af1cd8d9ac1d117a442cc91eec] iio: hid-sensor- > > > trigger: > > > Change get > > > poll value function order to avoid sensor properties losing after > > > resume from S3 > > > 1 > > > > > > Can you please review my findings to confirm that it really is a > > > regression bug ? > > > > > > > > > Thanks, > > > Ritesh > > >
Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
Hi Ritesh, Does the attached patch helps? Thanks, Srinivas On Tue, 2017-04-04 at 00:44 +0530, Ritesh Raj Sarraf wrote: > Adding Stable, LKML and IIO MLs. > > Hello Hongyan, > > Do you have any feedback ? With the bisected commit reverted, I've > been > successfully running the machine without any issues. > > Ritesh > > > On Sat, 2017-04-01 at 08:14 -0700, Srinivas Pandruvada wrote: > > Hello Hongyan, > > > > Can you check the findings of Ritesh? > > > > Thanks, > > Srinivas > > > > On Sat, 2017-04-01 at 14:07 +0530, Ritesh Raj Sarraf wrote: > > > Hello Srinivas, > > > > > > With the Linux 4.10.7 release, I have encountered a regression > > > introduced on my > > > Lenovo Yoga 2 13, for the ITE Rotation Sensor. > > > > > > > > > rrs@learner:~$ lsusb > > > Bus 001 Device 002: ID 8087:8000 Intel Corp. > > > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > > > Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub > > > Bus 002 Device 006: ID 048d:8350 Integrated Technology Express, > > > Inc. > > > Bus 002 Device 005: ID 0bda:b728 Realtek Semiconductor Corp. > > > Bus 002 Device 004: ID 04f2:b40f Chicony Electronics Co., Ltd > > > Bus 002 Device 003: ID 04f3:0303 Elan Microelectronics Corp. > > > Bus 002 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. > > > RTS5129 > > > Card Reader > > > Controller > > > Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > > > 2017-04-01 / 14:04:49 ♒♒♒ ☺ > > > > > > > > > The ITE sensors do not feed any data on the 4.10.7 kernel. > > > Reverting > > > back to > > > 4.10.5, everything works back. > > > > > > > > > After a git bisect, the culprit reported is: > > > > > > Bisecting: 0 revisions left to test after this (roughly 0 steps) > > > [6c2aab07d12436af1cd8d9ac1d117a442cc91eec] iio: hid-sensor- > > > trigger: > > > Change get > > > poll value function order to avoid sensor properties losing after > > > resume from S3 > > > 1 > > > > > > Can you please review my findings to confirm that it really is a > > > regression bug > > > ? > > > > > > > > > Thanks, > > > Ritesh > > > From 81a55bd9e6dfb4aec15da37a3a3ff8213d788f62 Mon Sep 17 00:00:00 2001 From: Srinivas PandruvadaDate: Tue, 4 Apr 2017 16:50:59 -0700 Subject: [PATCH] iio: hid-sensor: Store restore poll and hysteresis Instead of relying on HW for restoring poll and hysteresis, store in driver and restore on resume. Signed-off-by: Srinivas Pandruvada --- .../iio/common/hid-sensors/hid-sensor-attributes.c | 17 + drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 20 +--- include/linux/hid-sensor-hub.h | 2 ++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c index 7afdac42..aa8cacf 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c @@ -221,6 +221,14 @@ int hid_sensor_write_samp_freq_value(struct hid_sensor_common *st, if (ret < 0 || value < 0) ret = -EINVAL; + ret = sensor_hub_get_feature(st->hsdev, + st->poll.report_id, + st->poll.index, sizeof(value), ); + if (ret < 0 || value < 0) + return -EINVAL; + + st->poll_interval = value; + return ret; } EXPORT_SYMBOL(hid_sensor_write_samp_freq_value); @@ -266,6 +274,15 @@ int hid_sensor_write_raw_hyst_value(struct hid_sensor_common *st, if (ret < 0 || value < 0) ret = -EINVAL; + ret = sensor_hub_get_feature(st->hsdev, + st->sensitivity.report_id, + st->sensitivity.index, sizeof(value), + ); + if (ret < 0 || value < 0) + return -EINVAL; + + st->raw_hystersis = value; + return ret; } EXPORT_SYMBOL(hid_sensor_write_raw_hyst_value); diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c index ecf592d..be7011e 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c @@ -51,6 +51,8 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state) st->report_state.report_id, st->report_state.index, HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM); + + poll_value = hid_sensor_read_poll_value(st); } else { int val; @@ -87,9 +89,7 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state) sensor_hub_get_feature(st->hsdev, st->power_state.report_id, st->power_state.index, sizeof(state_val), _val); - if (state) - poll_value = hid_sensor_read_poll_value(st); - if (poll_value > 0) + if (state && poll_value) msleep_interruptible(poll_value * 2); return 0; @@ -127,6 +127,20 @@ static void hid_sensor_set_power_work(struct work_struct *work) struct hid_sensor_common *attrb = container_of(work,
Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
Hi Ritesh, Does the attached patch helps? Thanks, Srinivas On Tue, 2017-04-04 at 00:44 +0530, Ritesh Raj Sarraf wrote: > Adding Stable, LKML and IIO MLs. > > Hello Hongyan, > > Do you have any feedback ? With the bisected commit reverted, I've > been > successfully running the machine without any issues. > > Ritesh > > > On Sat, 2017-04-01 at 08:14 -0700, Srinivas Pandruvada wrote: > > Hello Hongyan, > > > > Can you check the findings of Ritesh? > > > > Thanks, > > Srinivas > > > > On Sat, 2017-04-01 at 14:07 +0530, Ritesh Raj Sarraf wrote: > > > Hello Srinivas, > > > > > > With the Linux 4.10.7 release, I have encountered a regression > > > introduced on my > > > Lenovo Yoga 2 13, for the ITE Rotation Sensor. > > > > > > > > > rrs@learner:~$ lsusb > > > Bus 001 Device 002: ID 8087:8000 Intel Corp. > > > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > > > Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub > > > Bus 002 Device 006: ID 048d:8350 Integrated Technology Express, > > > Inc. > > > Bus 002 Device 005: ID 0bda:b728 Realtek Semiconductor Corp. > > > Bus 002 Device 004: ID 04f2:b40f Chicony Electronics Co., Ltd > > > Bus 002 Device 003: ID 04f3:0303 Elan Microelectronics Corp. > > > Bus 002 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. > > > RTS5129 > > > Card Reader > > > Controller > > > Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > > > 2017-04-01 / 14:04:49 ♒♒♒ ☺ > > > > > > > > > The ITE sensors do not feed any data on the 4.10.7 kernel. > > > Reverting > > > back to > > > 4.10.5, everything works back. > > > > > > > > > After a git bisect, the culprit reported is: > > > > > > Bisecting: 0 revisions left to test after this (roughly 0 steps) > > > [6c2aab07d12436af1cd8d9ac1d117a442cc91eec] iio: hid-sensor- > > > trigger: > > > Change get > > > poll value function order to avoid sensor properties losing after > > > resume from S3 > > > 1 > > > > > > Can you please review my findings to confirm that it really is a > > > regression bug > > > ? > > > > > > > > > Thanks, > > > Ritesh > > > From 81a55bd9e6dfb4aec15da37a3a3ff8213d788f62 Mon Sep 17 00:00:00 2001 From: Srinivas Pandruvada Date: Tue, 4 Apr 2017 16:50:59 -0700 Subject: [PATCH] iio: hid-sensor: Store restore poll and hysteresis Instead of relying on HW for restoring poll and hysteresis, store in driver and restore on resume. Signed-off-by: Srinivas Pandruvada --- .../iio/common/hid-sensors/hid-sensor-attributes.c | 17 + drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 20 +--- include/linux/hid-sensor-hub.h | 2 ++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c index 7afdac42..aa8cacf 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c @@ -221,6 +221,14 @@ int hid_sensor_write_samp_freq_value(struct hid_sensor_common *st, if (ret < 0 || value < 0) ret = -EINVAL; + ret = sensor_hub_get_feature(st->hsdev, + st->poll.report_id, + st->poll.index, sizeof(value), ); + if (ret < 0 || value < 0) + return -EINVAL; + + st->poll_interval = value; + return ret; } EXPORT_SYMBOL(hid_sensor_write_samp_freq_value); @@ -266,6 +274,15 @@ int hid_sensor_write_raw_hyst_value(struct hid_sensor_common *st, if (ret < 0 || value < 0) ret = -EINVAL; + ret = sensor_hub_get_feature(st->hsdev, + st->sensitivity.report_id, + st->sensitivity.index, sizeof(value), + ); + if (ret < 0 || value < 0) + return -EINVAL; + + st->raw_hystersis = value; + return ret; } EXPORT_SYMBOL(hid_sensor_write_raw_hyst_value); diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c index ecf592d..be7011e 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c @@ -51,6 +51,8 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state) st->report_state.report_id, st->report_state.index, HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM); + + poll_value = hid_sensor_read_poll_value(st); } else { int val; @@ -87,9 +89,7 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state) sensor_hub_get_feature(st->hsdev, st->power_state.report_id, st->power_state.index, sizeof(state_val), _val); - if (state) - poll_value = hid_sensor_read_poll_value(st); - if (poll_value > 0) + if (state && poll_value) msleep_interruptible(poll_value * 2); return 0; @@ -127,6 +127,20 @@ static void hid_sensor_set_power_work(struct work_struct *work) struct hid_sensor_common *attrb = container_of(work, struct hid_sensor_common, work); + + if
Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
Adding Stable, LKML and IIO MLs. Hello Hongyan, Do you have any feedback ? With the bisected commit reverted, I've been successfully running the machine without any issues. Ritesh On Sat, 2017-04-01 at 08:14 -0700, Srinivas Pandruvada wrote: > Hello Hongyan, > > Can you check the findings of Ritesh? > > Thanks, > Srinivas > > On Sat, 2017-04-01 at 14:07 +0530, Ritesh Raj Sarraf wrote: > > Hello Srinivas, > > > > With the Linux 4.10.7 release, I have encountered a regression > > introduced on my > > Lenovo Yoga 2 13, for the ITE Rotation Sensor. > > > > > > rrs@learner:~$ lsusb > > Bus 001 Device 002: ID 8087:8000 Intel Corp. > > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > > Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub > > Bus 002 Device 006: ID 048d:8350 Integrated Technology Express, Inc. > > Bus 002 Device 005: ID 0bda:b728 Realtek Semiconductor Corp. > > Bus 002 Device 004: ID 04f2:b40f Chicony Electronics Co., Ltd > > Bus 002 Device 003: ID 04f3:0303 Elan Microelectronics Corp. > > Bus 002 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 > > Card Reader > > Controller > > Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > > 2017-04-01 / 14:04:49 ♒♒♒ ☺ > > > > > > The ITE sensors do not feed any data on the 4.10.7 kernel. Reverting > > back to > > 4.10.5, everything works back. > > > > > > After a git bisect, the culprit reported is: > > > > Bisecting: 0 revisions left to test after this (roughly 0 steps) > > [6c2aab07d12436af1cd8d9ac1d117a442cc91eec] iio: hid-sensor-trigger: > > Change get > > poll value function order to avoid sensor properties losing after > > resume from S3 > > 1 > > > > Can you please review my findings to confirm that it really is a > > regression bug > > ? > > > > > > Thanks, > > Ritesh > > -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com "Necessity is the mother of invention." signature.asc Description: This is a digitally signed message part
Re: [STABLE REGRESSION] iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
Adding Stable, LKML and IIO MLs. Hello Hongyan, Do you have any feedback ? With the bisected commit reverted, I've been successfully running the machine without any issues. Ritesh On Sat, 2017-04-01 at 08:14 -0700, Srinivas Pandruvada wrote: > Hello Hongyan, > > Can you check the findings of Ritesh? > > Thanks, > Srinivas > > On Sat, 2017-04-01 at 14:07 +0530, Ritesh Raj Sarraf wrote: > > Hello Srinivas, > > > > With the Linux 4.10.7 release, I have encountered a regression > > introduced on my > > Lenovo Yoga 2 13, for the ITE Rotation Sensor. > > > > > > rrs@learner:~$ lsusb > > Bus 001 Device 002: ID 8087:8000 Intel Corp. > > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > > Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub > > Bus 002 Device 006: ID 048d:8350 Integrated Technology Express, Inc. > > Bus 002 Device 005: ID 0bda:b728 Realtek Semiconductor Corp. > > Bus 002 Device 004: ID 04f2:b40f Chicony Electronics Co., Ltd > > Bus 002 Device 003: ID 04f3:0303 Elan Microelectronics Corp. > > Bus 002 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 > > Card Reader > > Controller > > Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > > 2017-04-01 / 14:04:49 ♒♒♒ ☺ > > > > > > The ITE sensors do not feed any data on the 4.10.7 kernel. Reverting > > back to > > 4.10.5, everything works back. > > > > > > After a git bisect, the culprit reported is: > > > > Bisecting: 0 revisions left to test after this (roughly 0 steps) > > [6c2aab07d12436af1cd8d9ac1d117a442cc91eec] iio: hid-sensor-trigger: > > Change get > > poll value function order to avoid sensor properties losing after > > resume from S3 > > 1 > > > > Can you please review my findings to confirm that it really is a > > regression bug > > ? > > > > > > Thanks, > > Ritesh > > -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com "Necessity is the mother of invention." signature.asc Description: This is a digitally signed message part