Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1525838
| From | Caesar Wang <sasukewxt@163.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/3] thermal: handle get_temp() errors properly |
| Date | 2016-11-19 04:30 +0100 |
| Message-ID | <sF4vL-7Oh-3@gated-at.bofh.it> (permalink) |
| References | <sF1ex-5tN-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Brian,
在 2016年11月19日 07:52, Brian Norris 写道:
> If using CONFIG_THERMAL_EMULATION, there's a corner case where we might
> get an error from the zone's get_temp() callback, but we'll ignore that
> and keep using its value. Let's just error out properly instead.
>
> Signed-off-by: Brian Norris <briannorris@chromium.org>
Tested-by: Caesar Wang <wxt@rock-chips.com>
[ 8.111296] thermal thermal_zone4: power_allocator: sustainable_power
will be estimated
[ 8.119420] thermal_zone_get_temp:537 the ret=-19, no such device,
look like the A/D value had no ready yet.
..
Anyway, this patch is useful for improving thermal.
-Caesar
> ---
> drivers/thermal/thermal_core.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 911fd964c742..0fa497f10d25 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -494,6 +494,8 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp)
> mutex_lock(&tz->lock);
>
> ret = tz->ops->get_temp(tz, temp);
> + if (ret)
> + goto exit_unlock;
>
> if (IS_ENABLED(CONFIG_THERMAL_EMULATION) && tz->emul_temperature) {
> for (count = 0; count < tz->trips; count++) {
> @@ -514,6 +516,7 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp)
> *temp = tz->emul_temperature;
> }
>
> +exit_unlock:
> mutex_unlock(&tz->lock);
> exit:
> return ret;
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/3] thermal: handle get_temp() errors properly Brian Norris <briannorris@chromium.org> - 2016-11-19 01:00 +0100
[PATCH 2/3] thermal: rockchip: improve conversion error messages Brian Norris <briannorris@chromium.org> - 2016-11-19 01:00 +0100
Re: [PATCH 2/3] thermal: rockchip: improve conversion error messages Caesar Wang <wxt@rock-chips.com> - 2016-11-19 05:00 +0100
Re: [PATCH 2/3] thermal: rockchip: improve conversion error messages Caesar Wang <wxt@rock-chips.com> - 2016-11-19 05:00 +0100
Re: [PATCH 2/3] thermal: rockchip: improve conversion error messages Caesar Wang <caesar.upstream@gmail.com> - 2016-11-22 03:00 +0100
Re: [PATCH 2/3] thermal: rockchip: improve conversion error messages Brian Norris <briannorris@chromium.org> - 2016-11-22 03:20 +0100
Re: [PATCH 2/3] thermal: rockchip: improve conversion error messages Caesar Wang <caesar.upstream@gmail.com> - 2016-11-22 03:40 +0100
Re: [PATCH 2/3] thermal: rockchip: improve conversion error messages Brian Norris <briannorris@chromium.org> - 2016-11-22 04:50 +0100
Re: [PATCH 2/3] thermal: rockchip: improve conversion error messages Zhang Rui <rui.zhang@intel.com> - 2016-11-22 09:00 +0100
Re: [PATCH 2/3] thermal: rockchip: improve conversion error messages Caesar Wang <caesar.upstream@gmail.com> - 2016-11-22 13:50 +0100
Re: [PATCH 1/3] thermal: handle get_temp() errors properly Caesar Wang <sasukewxt@163.com> - 2016-11-19 04:30 +0100
Re: [PATCH 1/3] thermal: handle get_temp() errors properly Eduardo Valentin <edubezval@gmail.com> - 2016-11-19 04:50 +0100
Re: [PATCH 1/3] thermal: handle get_temp() errors properly Brian Norris <briannorris@chromium.org> - 2016-11-19 06:40 +0100
Re: [PATCH 1/3] thermal: handle get_temp() errors properly Zhang Rui <rui.zhang@intel.com> - 2016-11-22 09:00 +0100
Re: [PATCH 1/3] thermal: handle get_temp() errors properly Eduardo Valentin <edubezval@gmail.com> - 2016-11-22 12:10 +0100
Re: [PATCH 1/3] thermal: handle get_temp() errors properly Brian Norris <briannorris@chromium.org> - 2016-11-22 23:40 +0100
csiph-web