lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <91641867-0dd9-46ab-90b7-1d687f3f4408@arm.com>
Date: Mon, 21 Oct 2024 23:31:44 +0100
From: Lukasz Luba <lukasz.luba@....com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: LKML <linux-kernel@...r.kernel.org>, Linux PM <linux-pm@...r.kernel.org>,
 Daniel Lezcano <daniel.lezcano@...aro.org>, Zhang Rui <rui.zhang@...el.com>,
 Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Subject: Re: [PATCH v2 07/12] thermal: core: Mark thermal zones as exiting
 before unregistration



On 10/4/24 20:26, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> 
> In analogy with a previous change in the thermal zone registration code
> path, to ensure that __thermal_zone_device_update() will return early
> for thermal zones that are going away, introduce a thermal zone state
> flag representing the "exit" state and set it while deleting the thermal
> zone from thermal_tz_list.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
> 
> This is a new iteration of
> 
> https://lore.kernel.org/linux-pm/1997536.PYKUYFuaPT@rjwysocki.net/
> 
> v1 -> v2: Rebase.
> 
> ---
>   drivers/thermal/thermal_core.c |    3 +++
>   drivers/thermal/thermal_core.h |    1 +
>   2 files changed, 4 insertions(+)
> 
> Index: linux-pm/drivers/thermal/thermal_core.c
> ===================================================================
> --- linux-pm.orig/drivers/thermal/thermal_core.c
> +++ linux-pm/drivers/thermal/thermal_core.c
> @@ -1613,7 +1613,10 @@ void thermal_zone_device_unregister(stru
>   	}
>   
>   	mutex_lock(&tz->lock);
> +
> +	tz->state |= TZ_STATE_FLAG_EXIT;
>   	list_del(&tz->node);
> +
>   	mutex_unlock(&tz->lock);
>   
>   	/* Unbind all cdevs associated with 'this' thermal zone */
> Index: linux-pm/drivers/thermal/thermal_core.h
> ===================================================================
> --- linux-pm.orig/drivers/thermal/thermal_core.h
> +++ linux-pm/drivers/thermal/thermal_core.h
> @@ -64,6 +64,7 @@ struct thermal_governor {
>   #define	TZ_STATE_FLAG_SUSPENDED	BIT(0)
>   #define	TZ_STATE_FLAG_RESUMING	BIT(1)
>   #define	TZ_STATE_FLAG_INIT	BIT(2)
> +#define	TZ_STATE_FLAG_EXIT	BIT(3)
>   
>   #define TZ_STATE_READY		0
>   
> 
> 
> 

Reviewed-by: Lukasz Luba <lukasz.luba@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ