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: <CAJZ5v0j6HPW8thPNLSRRzZCjSSnr69DWBHn9BBR2+L4tOKD6Fw@mail.gmail.com>
Date: Wed, 14 Jan 2026 20:18:45 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Huisong Li <lihuisong@...wei.com>
Cc: rafael@...nel.org, lenb@...nel.org, linux-acpi@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Sudeep.Holla@....com, linuxarm@...wei.com, 
	jonathan.cameron@...wei.com, zhanjie9@...ilicon.com, zhenglifeng1@...wei.com, 
	yubowen8@...wei.com
Subject: Re: [PATCH 1/3] cpuidle: Add enable_cpuidle() interface

On Tue, Nov 25, 2025 at 8:29 AM Huisong Li <lihuisong@...wei.com> wrote:
>
> The global switch of cpuidle can be turned back on in some case.
> So add enable_cpuidle().

No, this is not going to work.  The "off" switch only affects
initialization AFAICS.

> Signed-off-by: Huisong Li <lihuisong@...wei.com>
> ---
>  drivers/cpuidle/cpuidle.c | 5 ++++-
>  include/linux/cpuidle.h   | 2 ++
>  2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index 56132e843c99..980ddfd3d930 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -48,7 +48,10 @@ void disable_cpuidle(void)
>  {
>         off = 1;
>  }
> -
> +void enable_cpuidle(void)
> +{
> +       off = 0;
> +}
>  bool cpuidle_not_available(struct cpuidle_driver *drv,
>                            struct cpuidle_device *dev)
>  {
> diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
> index a9ee4fe55dcf..94c030748af3 100644
> --- a/include/linux/cpuidle.h
> +++ b/include/linux/cpuidle.h
> @@ -168,6 +168,7 @@ struct cpuidle_driver {
>  };
>
>  #ifdef CONFIG_CPU_IDLE
> +extern void enable_cpuidle(void);
>  extern void disable_cpuidle(void);
>  extern bool cpuidle_not_available(struct cpuidle_driver *drv,
>                                   struct cpuidle_device *dev);
> @@ -203,6 +204,7 @@ extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev)
>  static inline struct cpuidle_device *cpuidle_get_device(void)
>  {return __this_cpu_read(cpuidle_devices); }
>  #else
> +static inline void enable_cpuidle(void) { }
>  static inline void disable_cpuidle(void) { }
>  static inline bool cpuidle_not_available(struct cpuidle_driver *drv,
>                                          struct cpuidle_device *dev)
> --
> 2.33.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ