From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752105AbbCFG5u (ORCPT ); Fri, 6 Mar 2015 01:57:50 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:2749 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbbCFG5s (ORCPT ); Fri, 6 Mar 2015 01:57:48 -0500 Message-ID: <54F94E88.9040706@huawei.com> Date: Fri, 6 Mar 2015 14:51:52 +0800 From: Hanjun Guo User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Catalin Marinas , "Rafael J. Wysocki" CC: Mark Rutland , "linaro-acpi@lists.linaro.org" , Will Deacon , "Lorenzo Pieralisi" , Timur Tabi , ACPI Devel Maling List , Grant Likely , Robert Richter , Arnd Bergmann , Marc Zyngier , Jon Masters , Mark Brown , "linux-arm-kernel@lists.infradead.org" , Ashwin Chaugule , Graeme Gregory , "Rafael J. Wysocki" , Linux Kernel Mailing List , Hanjun Guo , , Sudeep Holla , "Olof Johansson" Subject: Re: [PATCH v9 14/21] ACPI / processor: Make it possible to get CPU hardware ID via GICC References: <1424853601-6675-1-git-send-email-hanjun.guo@linaro.org> <1424853601-6675-15-git-send-email-hanjun.guo@linaro.org> <2411054.s4TkmAUKjT@vostro.rjw.lan> <54F80DC9.3090808@huawei.com> <20150305112707.GB7712@e104818-lin.cambridge.arm.com> <20150305151915.GB11447@e104818-lin.cambridge.arm.com> In-Reply-To: <20150305151915.GB11447@e104818-lin.cambridge.arm.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.17.188] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015/3/5 23:19, Catalin Marinas wrote: > On Thu, Mar 05, 2015 at 02:13:58PM +0100, Rafael J. Wysocki wrote: >> On Thu, Mar 5, 2015 at 12:27 PM, Catalin Marinas >> wrote: >>> On Thu, Mar 05, 2015 at 04:03:21PM +0800, Hanjun Guo wrote: >>>> On 2015/3/5 6:46, Rafael J. Wysocki wrote: >>>>> IMO, you really need to define phys_cpuid_t in a common place or people will >>>>> forget that it may be 64-bit, because they'll only be looking at their arch. >>>> Since x86 and ARM64 are using different types for phys_cpuid_t, we need to >>>> introduce something like following if define it in common place: >>>> >>>> in linux/acpi.h, >>>> >>>> #if defined(CONFIG_X86) || defined(CONFIG_IA64) >>>> typedef u32 phys_cpuid_t; >>>> #define PHYS_CPUID_INVALID (phys_cpuid_t)(-1) >>>> #else if defined(CONFIG_ARM64) >>>> typedef u64 phys_cpuid_t; >>>> #define PHYS_CPUID_INVALID INVALID_HWID >>>> #endif >>>> >>>> I think it's awful, did I miss something? >> Well, you can define the type and PHYS_CPUID_INVALID in the arch >> code and then do this in a common header: >> >> #ifndef PHYS_CPUID_INVALID >> typedef u32 phys_cpuid_t; >> #define PHYS_CPUID_INVALID (phys_cpuid_t)(-1) >> #endif >> >> That would allow you to avoid the need to duplicate the >> definitions where it is not necessary. > It's fine by me. I will update the patch. Thanks Hanjun