From patchwork Fri Dec 1 22:23:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Linton X-Patchwork-Id: 120401 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1705934qgn; Fri, 1 Dec 2017 14:23:59 -0800 (PST) X-Google-Smtp-Source: AGs4zMZV4n+NZtuheN0Q64k3U1VueqL0cDH3gUiOv6z+u17+AvNz1p6g9kIoCXSOZsMIdB2oIRZr X-Received: by 10.99.148.1 with SMTP id m1mr7248259pge.237.1512167039143; Fri, 01 Dec 2017 14:23:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512167039; cv=none; d=google.com; s=arc-20160816; b=FNK98HGzWimhMA1v2hlsqeGpWGwuz37DT9eTyQoBOKGVuZFPhLT6/zifKtl1MSEVQf 84cl/iL9QI2JuFp3zMkSHcNb7SaRRiVutNbhbOwb/gCVwbKBuGqYTEmz8iOaEdBqyXcx XXnknX1AZdoL+OczxwCdOaLS/oihHB8bBSZo1rOqhRHm4A4afLpSvjf5tgM5sb4kT5b5 kckuDp/qcyK5Erg6BXecyboQTWwKjfCDYlLiBUl3E9wc+MSEHKWXH0aUq8B/3rCQl3GU UtXNsK5XAs8lfTCA/u11FbFqkqx7Deg5EC5zpvSgNgBh4Al5Sx/CaPTWbLcZIzRJ7lY0 7Krg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=4iPvFEq+tGKe9fBR5f3REmEVUIJuzQtM7sAa4kcVxgY=; b=s9xko6Al6U/XJ5Sf8BKKS6NI7MLV6gV9uScUlZ6nMuZnjOqjgV079IDodrSHn3cMyQ pPuyCziPJGaLA8bY6e5fYccyiAkhRTSDf58tPuIT7bHKdiM4VYwNWlB3hLoR1HvLgk+7 s/XnBb9efLQgnv+5zeQEohIaR82X4jhSmqxVurfhzRv6TK9R4gHf+Za+ym3CPfBBgnzH v7HTEjEAG/9Xmx64d8PCys4h3M+PhVRbYRFbelpNa93BQ77Mhj6bXWN1iC7YZvmLORD3 NFt5XuvrxEhQRdRMrRaqf5BvauNWET3h0YjxmyzSxnVs+s1NLpakC4tzse0WAq9PzBW5 r8lw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s189si5460375pgb.104.2017.12.01.14.23.58; Fri, 01 Dec 2017 14:23:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751555AbdLAWXz (ORCPT + 28 others); Fri, 1 Dec 2017 17:23:55 -0500 Received: from foss.arm.com ([217.140.101.70]:46990 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751486AbdLAWXv (ORCPT ); Fri, 1 Dec 2017 17:23:51 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 684C815A2; Fri, 1 Dec 2017 14:23:51 -0800 (PST) Received: from beelzebub.austin.arm.com (beelzebub.austin.arm.com [10.118.12.119]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 79D063F246; Fri, 1 Dec 2017 14:23:50 -0800 (PST) From: Jeremy Linton To: linux-acpi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, hanjun.guo@linaro.org, lorenzo.pieralisi@arm.com, rjw@rjwysocki.net, will.deacon@arm.com, catalin.marinas@arm.com, gregkh@linuxfoundation.org, viresh.kumar@linaro.org, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, jhugo@codeaurora.org, wangxiongfeng2@huawei.com, Jonathan.Zhang@cavium.com, ahs3@redhat.com, Jayachandran.Nair@cavium.com, austinwc@codeaurora.org, lenb@kernel.org, Jeremy Linton Subject: [PATCH v5 1/9] arm64/acpi: Create arch specific cpu to acpi id helper Date: Fri, 1 Dec 2017 16:23:22 -0600 Message-Id: <20171201222330.18863-2-jeremy.linton@arm.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20171201222330.18863-1-jeremy.linton@arm.com> References: <20171201222330.18863-1-jeremy.linton@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Its helpful to be able to lookup the acpi_processor_id associated with a logical cpu. Provide an arm64 helper to do this. Signed-off-by: Jeremy Linton --- arch/arm64/include/asm/acpi.h | 4 ++++ 1 file changed, 4 insertions(+) -- 2.13.5 diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index 32f465a80e4e..0db62a4cbce2 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -86,6 +86,10 @@ static inline bool acpi_has_cpu_in_madt(void) } struct acpi_madt_generic_interrupt *acpi_cpu_get_madt_gicc(int cpu); +static inline u32 get_acpi_id_for_cpu(unsigned int cpu) +{ + return acpi_cpu_get_madt_gicc(cpu)->uid; +} static inline void arch_fix_phys_package_id(int num, u32 slot) { } void __init acpi_init_cpus(void);