Re: [PATCH v5] iio: hid-sensors: use asynchronous resume

Started by Jonathan Cameron on Aug 21, 2016 · 2 messages from 2 authors · Last reply Aug 21, 2016

open the first message on its own page

Message details and related content
On 15/08/16 20:12, Srinivas Pandruvada wrote:
Some platforms power off sensor hubs during S3 suspend, which will require
longer time to resume. This hurts system resume time, so resume
asynchronously.

Signed-off-by: Srinivas Pandruvada <redacted>
Applied to the togreg branch of iio.git - initially pushed out as testing
for the autobuilders to play with it.

Thanks for tidying up the loose ends on this!

Jonathan
quoted hunk
---

Formerly this patch was v4 5/7 for Intel ISH series, which was separated
from the series.

v5:
Added cancel_work_sync


 .../iio/common/hid-sensors/hid-sensor-trigger.c    | 22 +++++++++++++++++++++-
 include/linux/hid-sensor-hub.h                     |  1 +
 2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
index 5b41f9d..5264ed6 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
@@ -122,6 +122,14 @@ int hid_sensor_power_state(struct hid_sensor_common *st, bool state)
 #endif
 }
 
+static void hid_sensor_set_power_work(struct work_struct *work)
+{
+	struct hid_sensor_common *attrb = container_of(work,
+						       struct hid_sensor_common,
+						       work);
+	_hid_sensor_power_state(attrb, true);
+}
+
 static int hid_sensor_data_rdy_trigger_set_state(struct iio_trigger *trig,
 						bool state)
 {
@@ -130,6 +138,7 @@ static int hid_sensor_data_rdy_trigger_set_state(struct iio_trigger *trig,
 
 void hid_sensor_remove_trigger(struct hid_sensor_common *attrb)
 {
+	cancel_work_sync(&attrb->work);
 	iio_trigger_unregister(attrb->trigger);
 	iio_trigger_free(attrb->trigger);
 }

48 more quoted lines

Message details and related content
On Sun, 2016-08-21 at 20:13 +0100, Jonathan Cameron wrote:
On 15/08/16 20:12, Srinivas Pandruvada wrote:
quoted
Some platforms power off sensor hubs during S3 suspend, which will
require
longer time to resume. This hurts system resume time, so resume
asynchronously.

Signed-off-by: Srinivas Pandruvada <<redacted>
.com>
Applied to the togreg branch of iio.git - initially pushed out as
testing
for the autobuilders to play with it.

Thanks for tidying up the loose ends on this!
Thanks you and Jiri for review and taking ISH patches.

-Srinivas

Jonathan
quoted
---

Formerly this patch was v4 5/7 for Intel ISH series, which was
separated
from the series.

v5:
Added cancel_work_sync


 .../iio/common/hid-sensors/hid-sensor-trigger.c    | 22
+++++++++++++++++++++-
 include/linux/hid-sensor-hub.h                     |  1 +
 2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
index 5b41f9d..5264ed6 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
@@ -122,6 +122,14 @@ int hid_sensor_power_state(struct
hid_sensor_common *st, bool state)
 #endif
 }
 
+static void hid_sensor_set_power_work(struct work_struct *work)
+{
+	struct hid_sensor_common *attrb = container_of(work,
+						       struct
hid_sensor_common,
+						       work);
+	_hid_sensor_power_state(attrb, true);
+}
+
 static int hid_sensor_data_rdy_trigger_set_state(struct
iio_trigger *trig,
 						bool state)
 {

65 more quoted lines

Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help