Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1678417

Re: [PATCH v2 1/2] acpi: thermal: update thermal_zone after enable the driver.

From Zhang Rui <rui.zhang@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/2] acpi: thermal: update thermal_zone after enable the driver.
Date 2017-06-30 04:50 +0200
Message-ID <tXUam-7TK-21@gated-at.bofh.it> (permalink)
References <tXKXn-1AK-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 2017-06-29 at 18:50 +0200, Enric Balletbo i Serra wrote:
> Use thermal_set_mode instead of just set the tz_enable variable when
> enabling the ACPI thermal driver. The purpose of this change is
> trigger
> a thermal_zone_device_update when driver switches from disabled to
> enabled mode so thermal_zone data is up-to-date.
> 
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
> This patch is new from v1 [1]
> 
> [1] https://patchwork.kernel.org/patch/9804229/
> 
>  drivers/acpi/thermal.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
> index 1d0417b..9949458 100644
> --- a/drivers/acpi/thermal.c
> +++ b/drivers/acpi/thermal.c
> @@ -930,7 +930,9 @@ static int
> acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
>  	if (ACPI_FAILURE(status))
>  		return -ENODEV;
>  
> -	tz->tz_enabled = 1;
> +	result = thermal_set_mode(tz->thermal_zone,
> THERMAL_DEVICE_ENABLED);
> +	if (result)
> +		return result;

thermal core is responsible for checking the thermal zone "mode", and
set the polling properly, right after thermal_zone_device_being
registered.

Thus we need to do nothing, but just make sure tz->tz_enabled is set
properly before registering the zone.

thanks,
rui
>  
>  	dev_info(&tz->device->dev, "registered as thermal_zone%d\n",
>  		 tz->thermal_zone->id);

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH v2 1/2] acpi: thermal: update thermal_zone after enable the driver. Enric Balletbo i Serra <enric.balletbo@collabora.com> - 2017-06-29 19:00 +0200
  [PATCH v2 2/2] thermal: core: Allow to disable polling when disabling thermal zone. Enric Balletbo i Serra <enric.balletbo@collabora.com> - 2017-06-29 19:00 +0200
    Re: [PATCH v2 2/2] thermal: core: Allow to disable polling when  disabling thermal zone. Zhang Rui <rui.zhang@intel.com> - 2017-06-30 07:10 +0200
      Re: [PATCH v2 2/2] thermal: core: Allow to disable polling when  disabling thermal zone. Enric Balletbo Serra <eballetbo@gmail.com> - 2017-06-30 10:20 +0200
        Re: [PATCH v2 2/2] thermal: core: Allow to disable polling when  disabling thermal zone. Zhang Rui <rui.zhang@intel.com> - 2017-07-01 05:10 +0200
  Re: [PATCH v2 1/2] acpi: thermal: update thermal_zone after enable  the driver. Zhang Rui <rui.zhang@intel.com> - 2017-06-30 04:50 +0200

csiph-web