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: <CAJZ5v0hhdxnPRpmvB9SSs7X9bQ=zz7pZ-+KOE67WwMvEOwXCRA@mail.gmail.com>
Date:   Tue, 12 Jul 2022 20:45:18 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     xiongxin <xiongxin@...inos.cn>
Cc:     "Rafael J. Wysocki" <rafael@...nel.org>,
        Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
        Riwen Lu <luriwen@...inos.cn>,
        Linux PM <linux-pm@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next 1/2] PM: suspend: expand the assignment scope of the pm_suspend_target_state

On Wed, Jun 29, 2022 at 5:35 AM xiongxin <xiongxin@...inos.cn> wrote:
>
> The pm_suspend_target_state variable can be used as a suspend state
> identifier and given to the specific device driver as a code judgment;
>
> Because the suspend_prepare() function is time-consuming for the
> operation of freezing processes, and this stage is actually in the suspend
> stage, it is necessary to expand the scope of the pm_suspend_target_state
> variable to be assigned to the suspend state at enter_state() function;

I don't see why it is necessary, sorry.

> Another reason is that the specific device driver can locate whether it is
> in the suspend state based on this variable, so as to determine the
> validity of its wake-up source.

I think you have a specific use case in mind, so please explain why
and how this change helps in your specific use case.

So far I don't see a reason for applying this patch.

> Signed-off-by: xiongxin <xiongxin@...inos.cn>
> ---
>  kernel/power/suspend.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
> index 827075944d28..c754b084ec03 100644
> --- a/kernel/power/suspend.c
> +++ b/kernel/power/suspend.c
> @@ -564,6 +564,12 @@ static int enter_state(suspend_state_t state)
>         if (state == PM_SUSPEND_TO_IDLE)
>                 s2idle_begin();
>
> +       /*
> +        * Expand the scope of suspend state for suspend operations
> +        * performed from the /sys/power/state entry.
> +        */
> +       pm_suspend_target_state = state;
> +
>         if (sync_on_suspend_enabled) {
>                 trace_suspend_resume(TPS("sync_filesystems"), 0, true);
>                 ksys_sync_helper();
> @@ -590,6 +596,7 @@ static int enter_state(suspend_state_t state)
>         pm_pr_dbg("Finishing wakeup.\n");
>         suspend_finish();
>   Unlock:
> +       pm_suspend_target_state = PM_SUSPEND_ON;
>         mutex_unlock(&system_transition_mutex);
>         return error;
>  }
> --
> 2.25.1
>
>
> No virus found
>                 Checked by Hillstone Network AntiVirus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ