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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZzyqMmzMaCHqE+9m@BLRRASHENOY1.amd.com>
Date: Tue, 19 Nov 2024 20:39:38 +0530
From: "Gautham R. Shenoy" <gautham.shenoy@....com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: Linux PM <linux-pm@...r.kernel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	LKML <linux-kernel@...r.kernel.org>,
	x86 Maintainers <x86@...nel.org>,
	Patryk Wlazlyn <patryk.wlazlyn@...ux.intel.com>,
	Artem Bityutskiy <artem.bityutskiy@...ux.intel.com>,
	Mario Limonciello <mario.limonciello@....com>,
	Linux ACPI <linux-acpi@...r.kernel.org>
Subject: Re: [PATCH v2 2/2] cpuidle: Change :enter_dead() driver callback
 return type to void

Hello Rafael,

On Fri, Nov 15, 2024 at 10:00:25PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> 
> After a previous change, cpuidle_play_dead(), which is the only caller
> of idle state :enter_dead() callbacks, ignores their return values, so
> they may as well be void.
> 
> Suggested-by: Peter Zijlstra <peterz@...radead.org>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>

> ---
> 
> v1 -> v2: New patch
> 
> Interestingly enough, the only user of :enter_dead() idle state callbacks
> in the current mainline turns out to be ACPI idle.

For that matter, the only user of cpuidle_play_dead() is the
native_play_dead(). Was that always the case? 

Some of the other architectures select the deepest available idle
state at boot time, and enter that state when a CPU is offlined.

In any case I am ok with this.

Reviewed-by: Gautham R. Shenoy <gautham.shenoy@....com>
--
Thanks and Regards
gautham.
> 
> ---
>  drivers/acpi/processor_idle.c |    7 ++-----
>  include/linux/cpuidle.h       |    2 +-
>  2 files changed, 3 insertions(+), 6 deletions(-)
> 
> Index: linux-pm/include/linux/cpuidle.h
> ===================================================================
> --- linux-pm.orig/include/linux/cpuidle.h
> +++ linux-pm/include/linux/cpuidle.h
> @@ -61,7 +61,7 @@ struct cpuidle_state {
>  			struct cpuidle_driver *drv,
>  			int index);
>  
> -	int (*enter_dead) (struct cpuidle_device *dev, int index);
> +	void (*enter_dead) (struct cpuidle_device *dev, int index);
>  
>  	/*
>  	 * CPUs execute ->enter_s2idle with the local tick or entire timekeeping
> Index: linux-pm/drivers/acpi/processor_idle.c
> ===================================================================
> --- linux-pm.orig/drivers/acpi/processor_idle.c
> +++ linux-pm/drivers/acpi/processor_idle.c
> @@ -578,7 +578,7 @@ static void __cpuidle acpi_idle_do_entry
>   * @dev: the target CPU
>   * @index: the index of suggested state
>   */
> -static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
> +static void acpi_idle_play_dead(struct cpuidle_device *dev, int index)
>  {
>  	struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
>  
> @@ -591,11 +591,8 @@ static int acpi_idle_play_dead(struct cp
>  		else if (cx->entry_method == ACPI_CSTATE_SYSTEMIO) {
>  			io_idle(cx->address);
>  		} else
> -			return -ENODEV;
> +			return;
>  	}
> -
> -	/* Never reached */
> -	return 0;
>  }
>  
>  static __always_inline bool acpi_idle_fallback_to_c1(struct acpi_processor *pr)
> 
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ