Fixes for stop monitoring disabled devices series
Subsystems (8)
cover Fixes for stop monitoring disabled devices series
This short series contains fixes for "Stop monitoring disabled devices" series https://www.spinics.net/lists/arm-kernel/msg817861.html
Invocation of thermal_zone_device_is_enabled() in acpi/thermal is now redundant, because thermal_zone_device_update() now is capable of handling disabled devices.
In imx's ->get_temp() the lock must not be taken, otherwise a deadlock happens. The decision whether explicitly running a measurement cycle is needed is taken based on driver's local irq_enabled variable.
Finally, thermal_zone_device_is_enabled() is made available to the core only, as there are no driver users of it.
Andrzej Pietrasiewicz (3):
acpi: thermal: Don't call thermal_zone_device_is_enabled()
thermal: imx: Use driver's local data to decide whether to run a
measurement
thermal: Make thermal_zone_device_is_enabled() available to core only
drivers/acpi/thermal.c | 3 --- drivers/thermal/imx_thermal.c | 7 ++++--- drivers/thermal/thermal_core.c | 1 - drivers/thermal/thermal_core.h | 2 ++ include/linux/thermal.h | 5 ----- 5 files changed, 6 insertions(+), 12 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/3 acpi: thermal: Don't call thermal_zone_device_is_enabled()
thermal_zone_device_update() can now handle disabled thermal zones, so the check here is not needed.
--- drivers/acpi/thermal.c | 3 --- 1 file changed, 3 deletions(-)
drivers/acpi/thermal.c +0 -3
@@ -499,9 +499,6 @@ static void acpi_thermal_check(void *data) {struct acpi_thermal *tz = data; -if (!thermal_zone_device_is_enabled (tz->thermal_zone)) -return ; -thermal_zone_device_update (tz->thermal_zone,THERMAL_EVENT_UNSPECIFIED ); }
Signature · 1 line
2.17.1
PATCH 2/3 thermal: imx: Use driver's local data to decide whether to run a measurement
In reply to Andrzej PietrasiewiczUse driver's local data to evaluate the need to run or not to run a measurement.
--- drivers/thermal/imx_thermal.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/thermal/imx_thermal.c +4 -3
@@ -252,10 +252,11 @@ static int imx_get_temp(struct thermal_zone_device *tz, int *temp)const struct thermal_soc_data *soc_data = data->socdata;struct regmap *map = data->tempmon;unsigned int n_meas; -bool wait; +bool wait, run_measurement;u32 val; -if (thermal_zone_device_is_enabled (tz)) { + run_measurement = !data->irq_enabled; +if (!run_measurement) {/* Check if a measurement is currently in progress */ regmap_read (map, soc_data->temp_data, &val); wait = !(val & soc_data->temp_valid_mask);
@@ -282,7 +283,7 @@ static int imx_get_temp(struct thermal_zone_device *tz, int *temp)regmap_read (map, soc_data->temp_data, &val); -if (!thermal_zone_device_is_enabled (tz)) { +if (run_measurement) {regmap_write (map, soc_data->sensor_ctrl +REG_CLR , soc_data->measure_temp_mask); regmap_write(map, soc_data->sensor_ctrl + REG_SET,
Signature · 1 line
2.17.1
PATCH 3/3 thermal: Make thermal_zone_device_is_enabled() available to core only
In reply to Andrzej PietrasiewiczThis function is not needed by drivers.
--- drivers/thermal/thermal_core.c | 1 - drivers/thermal/thermal_core.h | 2 ++ include/linux/thermal.h | 5 ----- 3 files changed, 2 insertions(+), 6 deletions(-)
drivers/thermal/thermal_core.c +0 -1
@@ -519,7 +519,6 @@ int thermal_zone_device_is_enabled(struct thermal_zone_device *tz)return mode ==THERMAL_DEVICE_ENABLED ; } -EXPORT_SYMBOL_GPL (thermal_zone_device_is_enabled);void thermal_zone_device_update (struct thermal_zone_device *tz,enum thermal_notify_event event)
drivers/thermal/thermal_core.h +2 -0
@@ -166,4 +166,6 @@ of_thermal_get_trip_points(struct thermal_zone_device *tz) }#endif +int thermal_zone_device_is_enabled (struct thermal_zone_device *tz); +#endif /* __THERMAL_CORE_H__ */
include/linux/thermal.h +0 -5
@@ -418,7 +418,6 @@ void thermal_cdev_update(struct thermal_cooling_device *);void thermal_notify_framework (struct thermal_zone_device *,int );int thermal_zone_device_enable (struct thermal_zone_device *tz);int thermal_zone_device_disable (struct thermal_zone_device *tz); -int thermal_zone_device_is_enabled (struct thermal_zone_device *tz);#else static inline struct thermal_zone_device *thermal_zone_device_register( const char *type, int trips, int mask, void *devdata,
@@ -472,10 +471,6 @@ static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)static inline int thermal_zone_device_disable (struct thermal_zone_device *tz) {return -ENODEV ; } - -static inline int -thermal_zone_device_is_enabled (struct thermal_zone_device *tz) -{return -ENODEV ; }#endif /* CONFIG_THERMAL */ #endif /* __THERMAL_H__ */
Signature · 1 line
2.17.1
Quoted 20 lines · Andrzej Pietrasiewicz
This short series contains fixes for "Stop monitoring disabled devices" series https://www.spinics.net/lists/arm-kernel/msg817861.html
Invocation of
thermal_zone_device_is_enabled()in acpi/thermal is now redundant, becausethermal_zone_device_update()now is capable of handling disabled devices.In imx's ->get_temp() the lock must not be taken, otherwise a deadlock happens. The decision whether explicitly running a measurement cycle is needed is taken based on driver's local
irq_enabledvariable.Finally,
thermal_zone_device_is_enabled()is made available to the core only, as there are no driver users of it.Andrzej Pietrasiewicz (3):
acpi: thermal: Don't callthermal_zone_device_is_enabled()
thermal: imx: Use driver's local data to decide whether to run a
measurement
thermal: Makethermal_zone_device_is_enabled()available to core only
Quoted 6 lines
drivers/acpi/thermal.c | 3 --- drivers/thermal/imx_thermal.c | 7 ++++--- drivers/thermal/thermal_core.c | 1 - drivers/thermal/thermal_core.h | 2 ++ include/linux/thermal.h | 5 ----- 5 files changed, 6 insertions(+), 12 deletions(-)
Is this series easily merge-able with the other series?
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Hi,
W dniu 03.07.2020 o 13:06, Daniel Lezcano pisze:
Quoted 21 lines · Andrzej Pietrasiewicz
Quoted 20 lines
This short series contains fixes for "Stop monitoring disabled devices" series https://www.spinics.net/lists/arm-kernel/msg817861.html
Invocation of
thermal_zone_device_is_enabled()in acpi/thermal is now redundant, becausethermal_zone_device_update()now is capable of handling disabled devices.In imx's ->get_temp() the lock must not be taken, otherwise a deadlock happens. The decision whether explicitly running a measurement cycle is needed is taken based on driver's local
irq_enabledvariable.Finally,
thermal_zone_device_is_enabled()is made available to the core only, as there are no driver users of it.Andrzej Pietrasiewicz (3):
acpi: thermal: Don't callthermal_zone_device_is_enabled()
thermal: imx: Use driver's local data to decide whether to run a
measurement
thermal: Makethermal_zone_device_is_enabled()available to core only
Quoted 9 lines
Quoted 6 lines
drivers/acpi/thermal.c | 3 --- drivers/thermal/imx_thermal.c | 7 ++++--- drivers/thermal/thermal_core.c | 1 - drivers/thermal/thermal_core.h | 2 ++ include/linux/thermal.h | 5 ----- 5 files changed, 6 insertions(+), 12 deletions(-)Is this series easily merge-able with the other series?
So-so.
Some simple conflicts needed to be resolved.
I have created a branch for you to look at and decide how far off it is from the original and whether the original Acked-by/Reviewed-by can be retained.
Note that I might have lost some portions of code during conflict resolution. It seems to me I haven't but you know.
The branch:
https://gitlab.collabora.com/andrzej.p/kernel-tests/-/tree/thermal-dont-poll-disabled-for-daniel
The code compiles at each stage on x86_64 + COMPILE_TEST.
Andrzej
Quoted 42 lines · Andrzej Pietrasiewicz
Hi,
W dniu 03.07.2020 o 13:06, Daniel Lezcano pisze:
Quoted 21 lines · Andrzej Pietrasiewicz
Quoted 20 lines
This short series contains fixes for "Stop monitoring disabled devices" series https://www.spinics.net/lists/arm-kernel/msg817861.html
Invocation of
thermal_zone_device_is_enabled()in acpi/thermal is now redundant, becausethermal_zone_device_update()now is capable of handling disabled devices.In imx's ->get_temp() the lock must not be taken, otherwise a deadlock happens. The decision whether explicitly running a measurement cycle is needed is taken based on driver's local
irq_enabledvariable.Finally,
thermal_zone_device_is_enabled()is made available to the core only, as there are no driver users of it.Andrzej Pietrasiewicz (3):
acpi: thermal: Don't callthermal_zone_device_is_enabled()
thermal: imx: Use driver's local data to decide whether to run a measurement
thermal: Makethermal_zone_device_is_enabled()available to core onlyQuoted 9 lines
Quoted 6 lines
drivers/acpi/thermal.c | 3 ---
drivers/thermal/imx_thermal.c | 7 ++++---
drivers/thermal/thermal_core.c| 1 -
drivers/thermal/thermal_core.h| 2 ++
include/linux/thermal.h | 5 -----5 files changed, 6 insertions(+), 12 deletions(-)Is this series easily merge-able with the other series?
So-so.
Some simple conflicts needed to be resolved.
I have created a branch for you to look at and decide how far off it is from the original and whether the original Acked-by/Reviewed-by can be retained.
Quoted 7 lines
Note that I might have lost some portions of code during conflict resolution. It seems to me I haven't but you know.
The branch:
https://gitlab.collabora.com/andrzej.p/kernel-tests/-/tree/thermal-dont-poll-disabled-for-daniel
Ok, I propose to keep the these three patches on top of V7.
Rui are you fine with that ?
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Zhang Rui
reviewerQuoted 52 lines · Daniel Lezcano
Quoted 51 lines · Andrzej Pietrasiewicz
Hi,
W dniu 03.07.2020 o 13:06, Daniel Lezcano pisze:
Quoted 30 lines · Andrzej Pietrasiewicz
Quoted 29 lines
This short series contains fixes for "Stop monitoring disabled devices"
series https://www.spinics.net/lists/arm-kernel/msg817861.htmlInvocation of
thermal_zone_device_is_enabled()in acpi/thermal is now
redundant, becausethermal_zone_device_update()now is capable of
handling disabled devices.In imx's ->get_temp() the lock must not be taken, otherwise a deadlock
happens. The decision whether explicitly running a measurement cycle
is needed is taken based on driver's localirq_enabledvariable.Finally,
thermal_zone_device_is_enabled()is made available to the
core only, as there are no driver users of it.Andrzej Pietrasiewicz (3):
acpi: thermal: Don't callthermal_zone_device_is_enabled()
thermal: imx: Use driver's local data to decide whether to
run a
measurement
thermal: Makethermal_zone_device_is_enabled()available to
core onlyQuoted 9 lines
Quoted 6 lines
drivers/acpi/thermal.c | 3 --- drivers/thermal/imx_thermal.c | 7 ++++--- drivers/thermal/thermal_core.c | 1 - drivers/thermal/thermal_core.h | 2 ++ include/linux/thermal.h | 5 ----- 5 files changed, 6 insertions(+), 12 deletions(-)Is this series easily merge-able with the other series?
So-so.
Some simple conflicts needed to be resolved.
I have created a branch for you to look at and decide how far off it is from the original and whether the original Acked-by/Reviewed-by can be retained.
Quoted 7 lines
Quoted 7 lines
Note that I might have lost some portions of code during conflict resolution. It seems to me I haven't but you know.
The branch:
https://gitlab.collabora.com/andrzej.p/kernel-tests/-/tree/thermal-dont-poll-disabled-for-daniel
Quoted 4 lines
Ok, I propose to keep the these three patches on top of V7.
Rui are you fine with that ?
Yes, that works for me.
thanks,
rui