All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
To: Josef Bacik <josef@toxicpanda.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	"kernel-team@fb.com" <kernel-team@fb.com>
Subject: Re: [PATCH][RESEND] Revert "PM: ACPI: reboot: Use S5 for reboot"
Date: Thu, 18 Mar 2021 13:42:04 +0800	[thread overview]
Message-ID: <CAAd53p6Lp8+S0yjWi=MikQJ_zywiWamUS5p19oKoqB6uYW8jzg@mail.gmail.com> (raw)
In-Reply-To: <78dfcd55-442d-dcc0-c37f-5576f65f91b5@toxicpanda.com>

On Thu, Mar 18, 2021 at 1:25 AM Josef Bacik <josef@toxicpanda.com> wrote:
[snipped]
> "shutdown now" works fine with and without your patch.  Thanks,

Rafael,
Please revert the patch while we are working on it.

Josef,
Can you please test the following patch:

diff --git a/kernel/reboot.c b/kernel/reboot.c
index eb1b15850761..263444a3fb38 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -233,6 +233,15 @@ void migrate_to_reboot_cpu(void)
        set_cpus_allowed_ptr(current, cpumask_of(cpu));
 }

+static void kernel_shutdown_prepare(enum system_states state)
+{
+       blocking_notifier_call_chain(&reboot_notifier_list,
+               (state == SYSTEM_HALT) ? SYS_HALT : SYS_POWER_OFF, NULL);
+       system_state = state;
+       usermodehelper_disable();
+       device_shutdown();
+}
+
 /**
  *     kernel_restart - reboot the system
  *     @cmd: pointer to buffer containing command to execute for restart
@@ -243,7 +252,7 @@ void migrate_to_reboot_cpu(void)
  */
 void kernel_restart(char *cmd)
 {
-       kernel_restart_prepare(cmd);
+       kernel_shutdown_prepare(SYSTEM_POWER_OFF);
        if (pm_power_off_prepare)
                pm_power_off_prepare();
        migrate_to_reboot_cpu();
@@ -257,14 +266,6 @@ void kernel_restart(char *cmd)
 }
 EXPORT_SYMBOL_GPL(kernel_restart);

-static void kernel_shutdown_prepare(enum system_states state)
-{
-       blocking_notifier_call_chain(&reboot_notifier_list,
-               (state == SYSTEM_HALT) ? SYS_HALT : SYS_POWER_OFF, NULL);
-       system_state = state;
-       usermodehelper_disable();
-       device_shutdown();
-}
 /**
  *     kernel_halt - halt the system
  *

>
> Josef

  reply	other threads:[~2021-03-18  5:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17  2:17 [PATCH][RESEND] Revert "PM: ACPI: reboot: Use S5 for reboot" Josef Bacik
2021-03-17  2:50 ` Kai-Heng Feng
2021-03-17 15:19   ` Josef Bacik
2021-03-17 16:14     ` Kai-Heng Feng
2021-03-17 17:25       ` Josef Bacik
2021-03-18  5:42         ` Kai-Heng Feng [this message]
2021-03-18 15:59           ` Rafael J. Wysocki
2021-03-18 19:02           ` Josef Bacik
2021-03-19 16:23             ` Kai-Heng Feng
2021-07-12 17:03               ` Kai-Heng Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAd53p6Lp8+S0yjWi=MikQJ_zywiWamUS5p19oKoqB6uYW8jzg@mail.gmail.com' \
    --to=kai.heng.feng@canonical.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.