From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757766AbbCESS7 (ORCPT ); Thu, 5 Mar 2015 13:18:59 -0500 Received: from mail-pd0-f178.google.com ([209.85.192.178]:39081 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752801AbbCESS5 (ORCPT ); Thu, 5 Mar 2015 13:18:57 -0500 Date: Thu, 5 Mar 2015 10:19:04 -0800 From: Olof Johansson To: Hanjun Guo Cc: Catalin Marinas , "Rafael J. Wysocki" , Will Deacon , Grant Likely , Lorenzo Pieralisi , Arnd Bergmann , Mark Rutland , Graeme Gregory , Sudeep Holla , Jon Masters , Marc Zyngier , Mark Brown , Robert Richter , Timur Tabi , Ashwin Chaugule , suravee.suthikulpanit@amd.com, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, Tomasz Nowicki Subject: Re: [PATCH v9 11/21] ARM64 / ACPI: Get PSCI flags in FADT for PSCI init Message-ID: <20150305181904.GE4932@quad.lixom.net> References: <1424853601-6675-1-git-send-email-hanjun.guo@linaro.org> <1424853601-6675-12-git-send-email-hanjun.guo@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424853601-6675-12-git-send-email-hanjun.guo@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Feb 25, 2015 at 04:39:51PM +0800, Hanjun Guo wrote: > From: Graeme Gregory > > There are two flags: PSCI_COMPLIANT and PSCI_USE_HVC. When set, > the former signals to the OS that the firmware is PSCI compliant. > The latter selects the appropriate conduit for PSCI calls by > toggling between Hypervisor Calls (HVC) and Secure Monitor Calls > (SMC). > > FADT table contains such information in ACPI 5.1, FADT table was > parsed in ACPI table init and copy to struct acpi_gbl_FADT, so > use the flags in struct acpi_gbl_FADT for PSCI init. > > Since ACPI 5.1 doesn't support self defined PSCI function IDs, > which means that only PSCI 0.2+ is supported in ACPI. > > CC: Lorenzo Pieralisi > CC: Catalin Marinas > CC: Will Deacon > Tested-by: Suravee Suthikulpanit > Tested-by: Yijing Wang > Tested-by: Mark Langsdorf > Tested-by: Jon Masters > Tested-by: Timur Tabi > Tested-by: Robert Richter > Acked-by: Robert Richter > Signed-off-by: Graeme Gregory > Signed-off-by: Tomasz Nowicki > Signed-off-by: Hanjun Guo Acked-by: Olof Johansson However, a comment on the color of the bike shed below. I'm fine with this being addressed with an incremental patch instead of respun: > diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c > index e8c7000..97fa7f3 100644 > --- a/arch/arm64/kernel/setup.c > +++ b/arch/arm64/kernel/setup.c > @@ -390,10 +390,12 @@ void __init setup_arch(char **cmdline_p) > > early_ioremap_reset(); > > - if (acpi_disabled) > + if (acpi_disabled) { > unflatten_device_tree(); > - > - psci_init(); > + psci_dt_init(); > + } else { > + psci_acpi_init(); > + } I would prefer having a common psci_init() in psci.c, which in turn calls either the dt or the acpi version, and after that calls the set_functions if the init function passed -- it'll keep more code common as new versions of PSCI is added. It also keeps setup_arch() somewhat cleaner, and avoids bubbling up the dt-vs-acpi differences to the top level. -Olof