Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934825AbcCJCZu (ORCPT ); Wed, 9 Mar 2016 21:25:50 -0500 Received: from mga11.intel.com ([192.55.52.93]:28198 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754349AbcCJCZk convert rfc822-to-8bit (ORCPT ); Wed, 9 Mar 2016 21:25:40 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,313,1455004800"; d="scan'208";a="920617197" From: "Chen, Yu C" To: Matt Fleming CC: "Rafael J. Wysocki" , "Rafael J. Wysocki" , ACPI Devel Maling List , "x86@kernel.org" , "linux-efi@vger.kernel.org" , Linux Kernel Mailing List , "linux-pm@vger.kernel.org" , Len Brown , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "Zhang, Rui" Subject: RE: [PATCH][RFC v3] ACPI / PM: Fix poweroff issue on HW-full platforms without _S5 Thread-Topic: [PATCH][RFC v3] ACPI / PM: Fix poweroff issue on HW-full platforms without _S5 Thread-Index: AQHReBtTuYTrZFDLZkGy2iiQCJLNIJ9NcY+AgACwtaCAACIcAIABZrTQgAEQ+ACAATnd4A== Date: Thu, 10 Mar 2016 02:25:36 +0000 Message-ID: <36DF59CE26D8EE47B0655C516E9CE640286D3EA6@shsmsx102.ccr.corp.intel.com> References: <1457319045-25434-1-git-send-email-yu.c.chen@intel.com> <36DF59CE26D8EE47B0655C516E9CE640286D329F@shsmsx102.ccr.corp.intel.com> <2414254.VhAiD01BTS@vostro.rjw.lan> <36DF59CE26D8EE47B0655C516E9CE640286D370A@shsmsx102.ccr.corp.intel.com> <20160309153436.GB15775@codeblueprint.co.uk> In-Reply-To: <20160309153436.GB15775@codeblueprint.co.uk> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDMyZDU4N2MtODFjMC00ZDY5LTlhOWMtOGQ1ZGQ5YWVmMzBmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjhndmRNMUpOeXM1RktaT2NnUDdQRldoR05McytQZmxRMWFwVSs4bnp4SUU9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2760 Lines: 75 Hi Matt, > -----Original Message----- > From: Matt Fleming [mailto:matt@codeblueprint.co.uk] > Sent: Wednesday, March 09, 2016 11:35 PM > To: Chen, Yu C > Cc: Rafael J. Wysocki; Rafael J. Wysocki; ACPI Devel Maling List; > x86@kernel.org; linux-efi@vger.kernel.org; Linux Kernel Mailing List; linux- > pm@vger.kernel.org; Len Brown; Thomas Gleixner; Ingo Molnar; H. Peter > Anvin; Zhang, Rui > Subject: Re: [PATCH][RFC v3] ACPI / PM: Fix poweroff issue on HW-full > platforms without _S5 > > On Tue, 08 Mar, at 04:25:30PM, Chen, Yu C wrote: > > Hum. unfortunately it is not guaranteed to run after all of the other > > code, because other components who register pm_power_off may be > built as modules, and > > we can not predict/control the sequence registration. So this patch may > > break the EFI platforms who use non-efi poweroff due to unstable EFI > > service , not sure if there are any released-products of this kind. > > Certainly the majority of x86 client machines do not use EFI power off, > because it hardly ever functions correctly. > > > Currently I'm thinking of 3 possible solutions, could you please give some > advices on them: > > > > 1. Introduce bootopt of 'poweroff=efi' > > Set the pm_power_off to efi_power_off no matter whether there is > > _S5 or not > > > > 2. Introduce /sys/power/poweroff > > Allow the user to choose which pm_power_off, for example: > > > > # cat /sys/power/poweroff > > *acpi acpi_power_off > > efi efi_power_off > > gpio gpio_poweroff_do_poweroff > > user can echo string to enable which one. > > > > And two APIs: > > register_power_off(char *name, power_off func) > > unregister_power_off(char *name) > > > > > > 3. replace all the codes of pm_power_off() with > > reliable_pm_power_off() > > > > void reliable_pm_power_off(void) > > { > > if (!pm_power_off) { > > if (acpi_no_s5) > > pm_power_off = efi_power_off; > > /* Other conditions added in the future. */ > > } > > pm_power_off(); > > } > > Be wary of adding all these control knobs. People just want their machines to > reboot properly without having to mess with boot parameters. > > Let's go back to the start. What prompted this patch? Do Intel have (or are > planning) machines that do not have _S5 and are expected to use EFI to reset > the system? Yes, there might be a new platform without _S5, and might need EFI poweroff for a backup. > Or is this some new configuration discussed in the ACPI spec > that Linux needs to be support? > > Can we remove the ambiguity and options to force EFI reset if _S5 is missing? > Afterall, that's why the function is called efi_poweroff_*required*. OK, the boot option is obsoleted, I'll try another version of default_power_off per Rafael's suggestion, thanks. yu