From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753615AbaHUDIa (ORCPT ); Wed, 20 Aug 2014 23:08:30 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:57803 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751525AbaHUDI1 (ORCPT ); Wed, 20 Aug 2014 23:08:27 -0400 Message-ID: <53F5624E.3010102@linaro.org> Date: Thu, 21 Aug 2014 11:06:54 +0800 From: Hanjun Guo User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Catalin Marinas CC: "Rafael J. Wysocki" , Mark Rutland , "graeme.gregory@linaro.org" , Arnd Bergmann , Olof Johansson , "grant.likely@linaro.org" , Sudeep Holla , Will Deacon , Jason Cooper , Marc Zyngier , Bjorn Helgaas , Daniel Lezcano , Mark Brown , Rob Herring , Robert Richter , Lv Zheng , Robert Moore , Lorenzo Pieralisi , Liviu Dudau , Randy Dunlap , Charles Garcia-Tobin , "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 v2 08/18] ARM64 / ACPI: Get the enable method for SMP initialization in ACPI way References: <1407166105-17675-1-git-send-email-hanjun.guo@linaro.org> <1407166105-17675-9-git-send-email-hanjun.guo@linaro.org> <20140818142733.GT20043@localhost> <53F30B99.4000704@linaro.org> <20140820145219.GO24600@localhost> In-Reply-To: <20140820145219.GO24600@localhost> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2014-8-20 22:52, Catalin Marinas wrote: > On Tue, Aug 19, 2014 at 09:32:25AM +0100, Hanjun Guo wrote: >> On 2014-8-18 22:27, Catalin Marinas wrote: >>> On Mon, Aug 04, 2014 at 04:28:15PM +0100, Hanjun Guo wrote: >>>> +#ifdef CONFIG_ACPI >>>> +/* >>>> + * Get a cpu's boot method in the ACPI way. >>>> + */ >>>> +static char * __init acpi_get_cpu_boot_method(void) >>>> +{ >>>> + /* >>>> + * For ACPI 5.1, only two kind of methods are provided, >>>> + * Parking protocol and PSCI, but Parking protocol is >>>> + * specified for ARMv7 only, so make PSCI as the only method >>>> + * for SMP initialization before the ACPI spec or Parking >>>> + * protocol spec is updated. >>>> + */ >>>> + switch (smp_boot_protocol()) { >>>> + case ACPI_SMP_BOOT_PSCI: >>>> + return "psci"; >>>> + case ACPI_SMP_BOOT_PARKING_PROTOCOL: >>>> + default: >>>> + return NULL; >>>> + } >>>> +} >>> >>> Actually, do we even need to define smp_boot_protocol()? Is it used >>> anywhere else apart from this patch (I still haven't gone through all >>> patches)? >> >> It is just used in this patch. I think we can make the ACPI boot protocol >> scalable in this way, if we support another boot protocol in ACPI in the >> future, we can easily update the function to support it, does it make sense? > > Not really. You just add additional code, enums, functions when all you > do is check for acpi_psci_present() (or whatever new protocol you would > get). If the enum is never going to be used outside this file, don't > bother with additional functions. > > BTW, it would be nicer if the acpi related functions are contained in as > fewer files as possible. So here you could keep > acpi_get_cpu_boot_method() in the acpi.c file. It only returns a string. ok, I will update them. Thanks Hanjun