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: <CAJZ5v0gYMLopZuTr1nE9GDMJ_r8O-+YWz+SLAKm9-muBVrk8+A@mail.gmail.com>
Date:   Wed, 24 May 2023 18:55:48 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Kai-Heng Feng <kai.heng.feng@...onical.com>
Cc:     jejb@...ux.ibm.com, martin.petersen@...cle.com,
        bblock@...ux.ibm.com, acelan.kao@...onical.com,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/2] PM: suspend: Define pm_suspend_target_state

On Tue, May 2, 2023 at 5:05 PM Kai-Heng Feng
<kai.heng.feng@...onical.com> wrote:
>
> Define pm_suspend_target_state so it can still be used when
> CONFIG_SUSPEND is not set.
>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@...onical.com>
> ---
> v4:
>  - Move pm_suspend_target_state to CONFIG_SUSPEND block.
>
> v3:
>  - New patch to resolve undefined pm_suspend_target_state.
>
>  drivers/base/power/wakeup.c | 5 -----
>  include/linux/suspend.h     | 4 +++-
>  2 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
> index 7cc0c0cf8eaa..a917219feea6 100644
> --- a/drivers/base/power/wakeup.c
> +++ b/drivers/base/power/wakeup.c
> @@ -19,11 +19,6 @@
>
>  #include "power.h"
>
> -#ifndef CONFIG_SUSPEND
> -suspend_state_t pm_suspend_target_state;
> -#define pm_suspend_target_state        (PM_SUSPEND_ON)
> -#endif
> -
>  #define list_for_each_entry_rcu_locked(pos, head, member) \
>         list_for_each_entry_rcu(pos, head, member, \
>                 srcu_read_lock_held(&wakeup_srcu))
> diff --git a/include/linux/suspend.h b/include/linux/suspend.h
> index d0d4598a7b3f..474ecfbbaa62 100644
> --- a/include/linux/suspend.h
> +++ b/include/linux/suspend.h
> @@ -202,6 +202,7 @@ struct platform_s2idle_ops {
>  };
>
>  #ifdef CONFIG_SUSPEND
> +extern suspend_state_t pm_suspend_target_state;
>  extern suspend_state_t mem_sleep_current;
>  extern suspend_state_t mem_sleep_default;
>
> @@ -337,6 +338,8 @@ extern bool sync_on_suspend_enabled;
>  #else /* !CONFIG_SUSPEND */
>  #define suspend_valid_only_mem NULL
>
> +#define pm_suspend_target_state        (PM_SUSPEND_ON)
> +
>  static inline void pm_suspend_clear_flags(void) {}
>  static inline void pm_set_suspend_via_firmware(void) {}
>  static inline void pm_set_resume_via_firmware(void) {}
> @@ -503,7 +506,6 @@ extern void pm_report_max_hw_sleep(u64 t);
>
>  /* drivers/base/power/wakeup.c */
>  extern bool events_check_enabled;
> -extern suspend_state_t pm_suspend_target_state;
>
>  extern bool pm_wakeup_pending(void);
>  extern void pm_system_wakeup(void);
> --

Applied as 6.5 material under an edited subject and with some edits in
the changelog.

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ