Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp669677pxf; Thu, 18 Mar 2021 09:01:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1DGwx37kRtksUrqweBzzL3HlkF5+ajEPmmSV/MIM3RW9jNyiHuHeQ1ksZj6OuWJJu8VI1 X-Received: by 2002:a17:906:d9d1:: with SMTP id qk17mr41549882ejb.52.1616083317034; Thu, 18 Mar 2021 09:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616083317; cv=none; d=google.com; s=arc-20160816; b=iRkmnJr3XzTUiu2nWjEoxYlahpoeK0JoTpb1vl/Ni/WQ381jZV+4HxxTkiO0f35PRW emaqezFuEcR2fqKr1CmgtfBDsFKnPYH0lb1+wZ9YsjRF9mEHFAUec0c6vLxOBwuzX5Uq zjNgvrf2x4ZUNEoRiIfkv/wwFBCOsT7Kznl0yr02gacNRHrW7jTKFtSSEkJgw/B6e+bF nLGoWmXVxrSPugWfT+GbY5xT+2r8se2e9Enaab5Snj7zAKqT2vch8PFNT0UYtYTu3t/G eI6sLQS2D774j7Aejo6dHwg4PyPoCTVELG0i0U3OLdCIuBQLKZWbapBlh7+LFO+z5kK7 S3Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=i8YWnicVrPGONIpq/gd21S16w2jN25ct31nO+iAsCV4=; b=Qg1HrG3p6BMC0vbgqFCiki8QcWNiGIacLi1pfkrp7vvOYL0tHkd8QpkN7Z2xG2jfxw aMMWTMVNp4pwfMAHrSjOJAzTDyNrmkqd+RoeFLYDlf30/uTkWSTQEsMDRRnASMd22dsL ZPECr+Kl4+F0csKN6M7Xsl9fKj5vMqG5DgekKcTHlEaZlBy+SCvFqbA5v28tfjbO86mh Mz1o6MsFbiI2sSis208vPfg0+3tgwMqH15gqWEIW6+k9v0N/wDNNBJT5xsfquRajwI6D 6dQhU5maOo5U5Kt1Q4WKSlGLuTnsaosO/oEiBphR/lOMcw0z7PmClVJA1Qmrfc7Ta4EI PT1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h9si1904717edv.190.2021.03.18.09.01.33; Thu, 18 Mar 2021 09:01:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231942AbhCRP74 (ORCPT + 99 others); Thu, 18 Mar 2021 11:59:56 -0400 Received: from mga17.intel.com ([192.55.52.151]:55330 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231726AbhCRP7r (ORCPT ); Thu, 18 Mar 2021 11:59:47 -0400 IronPort-SDR: ur8YZ1z2EdF3WXwdSMXPVteqBWki5Ui2jcqGpBoN29M7E0sdiB//QdwZtLC5uLIx4blLPjnZJk XfrmI2ZPPJ6A== X-IronPort-AV: E=McAfee;i="6000,8403,9927"; a="169634314" X-IronPort-AV: E=Sophos;i="5.81,259,1610438400"; d="scan'208";a="169634314" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 08:59:45 -0700 IronPort-SDR: twXGXCDyrFuWJMDyNKaRrG8z9VPKKXx07Vr7J+bExRSsvd3MxnEMjI2xdasK5+v9nQ1BVeHO/b OGU4Gjw/lIcg== X-IronPort-AV: E=Sophos;i="5.81,259,1610438400"; d="scan'208";a="413137430" Received: from rjwysock-mobl1.ger.corp.intel.com (HELO [10.249.142.35]) ([10.249.142.35]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 08:59:44 -0700 Subject: Re: [PATCH][RESEND] Revert "PM: ACPI: reboot: Use S5 for reboot" To: Kai-Heng Feng , Josef Bacik Cc: LKML , "kernel-team@fb.com" References: <78dfcd55-442d-dcc0-c37f-5576f65f91b5@toxicpanda.com> From: "Rafael J. Wysocki" Organization: Intel Technology Poland Sp. z o. o., KRS 101882, ul. Slowackiego 173, 80-298 Gdansk Message-ID: <03dba78e-4271-ac60-3d7f-a07924735049@intel.com> Date: Thu, 18 Mar 2021 16:59:41 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/18/2021 6:42 AM, Kai-Heng Feng wrote: > On Thu, Mar 18, 2021 at 1:25 AM Josef Bacik wrote: > [snipped] >> "shutdown now" works fine with and without your patch. Thanks, > Rafael, > Please revert the patch while we are working on it. Done, thanks! > 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