FAILED: patch "[PATCH] iio: hid-sensor-attributes: Fix sensor property setting" failed to apply to 4.10-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
bba6d9e47f3ea894e501f94b086a59ffe28241acMon Sep 17 00:00:00 2001
From: Song Hongyan <[email protected]>
Date: Tue, 28 Mar 2017 22:23:55 +0800
Subject: [PATCH] iio: hid-sensor-attributes: Fix sensor property setting
failure.
When system bootup without get sensor property, set sensor property will be fail.
If no get_feature operation done before set_feature, the sensor properties will all be the initialized value, which is not the same with sensor real properties. When set sensor property it will write back to sensor the changed perperty data combines with other sensor properties data, it is not right and may be dangerous.
In order to get all sensor properties, choose to read one of the sensor properties(no matter read any sensor peroperty, driver will get all the peroperties and return the requested one).
drivers/iio/common/hid-sensors/hid-sensor-attributes.c +10 -0
@@ -379,6 +379,8 @@ int hid_sensor_parse_common_attributes(struct hid_sensor_hub_device *hsdev, {struct hid_sensor_hub_attribute_info timestamp; +s32 value; +int ret;hid_sensor_get_reporting_interval (hsdev, usage_id, st);
@@ -417,6 +419,14 @@ int hid_sensor_parse_common_attributes(struct hid_sensor_hub_device *hsdev, st->sensitivity.index, st->sensitivity.report_id, timestamp.index, timestamp.report_id); + ret =sensor_hub_get_feature (hsdev, + st->power_state.report_id, + st->power_state.index,sizeof (value), &value); +if (ret <0 ) +return ret; +if (value <0 ) +return -EINVAL ; +return 0 ; }EXPORT_SYMBOL (hid_sensor_parse_common_attributes);
Song, Hongyan
Acked-by Srinivas PandruvadaHi Srinivas,
Dose this patch do not needed or may cause some issue? Do you know why it is not applied?
BR
Song Hongyan
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Monday, April 10, 2017 3:24 AM
To: Song, Hongyan <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]
Subject: FAILED: patch "[PATCH] iio: hid-sensor-attributes: Fix sensor property setting" failed to apply to 4.10-stable tree
The patch below does not apply to the 4.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
bba6d9e47f3ea894e501f94b086a59ffe28241acMon Sep 17 00:00:00 2001
From: Song Hongyan <[email protected]>
Date: Tue, 28 Mar 2017 22:23:55 +0800
Subject: [PATCH] iio: hid-sensor-attributes: Fix sensor property setting failure.
When system bootup without get sensor property, set sensor property will be fail.
If no get_feature operation done before set_feature, the sensor properties will all be the initialized value, which is not the same with sensor real properties. When set sensor property it will write back to sensor the changed perperty data combines with other sensor properties data, it is not right and may be dangerous.
In order to get all sensor properties, choose to read one of the sensor properties(no matter read any sensor peroperty, driver will get all the peroperties and return the requested one).
drivers/iio/common/hid-sensors/hid-sensor-attributes.c +10 -0
@@ -379,6 +379,8 @@ int hid_sensor_parse_common_attributes(struct hid_sensor_hub_device *hsdev, {struct hid_sensor_hub_attribute_info timestamp; +s32 value; +int ret;hid_sensor_get_reporting_interval (hsdev, usage_id, st);
@@ -417,6 +419,14 @@ int hid_sensor_parse_common_attributes(struct hid_sensor_hub_device *hsdev, st->sensitivity.index, st->sensitivity.report_id, timestamp.index, timestamp.report_id); + ret =sensor_hub_get_feature (hsdev, + st->power_state.report_id, + st->power_state.index,sizeof (value), &value); +if (ret <0 ) +return ret; +if (value <0 ) +return -EINVAL ; +return 0 ; }EXPORT_SYMBOL (hid_sensor_parse_common_attributes);