From patchwork Wed Feb 28 22:06:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Linton X-Patchwork-Id: 130080 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp272797lja; Wed, 28 Feb 2018 14:10:29 -0800 (PST) X-Google-Smtp-Source: AH8x227QAUSm3sopcC+ZnBftcCXoXm+r1RjqwvMkVbw2SM48EDBTRUfXelOd2cpBd6fYwt4ob+Jj X-Received: by 10.98.204.69 with SMTP id a66mr19221836pfg.33.1519855829020; Wed, 28 Feb 2018 14:10:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519855829; cv=none; d=google.com; s=arc-20160816; b=P+Caz4eXUtiFEWF/x3dsWxZU+WMZgvzRo57Ze9t7sm95SrBFLs/oWoOl7HXITybpM7 d+ENfFUy4umop0gAgfw0CcK0j8MFIZ2kI6C+Y4rk/k+3E2t0MrJYLi94fe1a4Yln3FYH KRJ5NiDGYHGZ2XQdmcyq0YFvpykeEPPj5RAPMSdNY6XCoN7xk83WQvdkFzmLxt3yFtKQ nUnNx4wY7TliSnksryALPHvrbMVXZ55locvHvLhH69jCKFk3iTPc+p5D8oDgVbky1bkT 0JjcA/4yJbCGPLaIZiBX8HF2dfZR31g2ZyNGmNzNbVUNKWl55hqHAmUAUKPUn39O2K4r U0gg== 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=X8oIGhkK37WMHWcgEZvYNTfwfcW2tjL2fvwAWo6swsY=; b=GKgfnpoWS6HVN3X0xDQF6Agse4D+bC6ZHJ5kMVx9d2Ba9Crxfd2A+nol8hSjWta1oM NjNCapzGzmkgm9sQtN+dGWCXpn7M2Vp2xD66+RyPvAaNOau/X28GYBjBG93fuWTDr2Ej CLtgu6A8Yv39+dUb1GGdZNgP58EUC/bRXCwXnNSYk3FJAjF9sW3nTUrz2k9wgWtOspjs jb2Xpl1euUY+by4944YDODGplPh7HtHx4eI4ROK2TEmi0uW+PDnaCcbvReJRXHoEIuKC 6GqtWPUpPBhSZRSJNEEPUwDM6PUyMygiH/3f0Ur+Q25C6YIZ9VVPby8lbKCvKSq3DaXL 6MOA== 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 g2-v6si1888521pll.556.2018.02.28.14.10.28; Wed, 28 Feb 2018 14:10:29 -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 S935414AbeB1WKZ (ORCPT + 28 others); Wed, 28 Feb 2018 17:10:25 -0500 Received: from foss.arm.com ([217.140.101.70]:57998 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935307AbeB1WHT (ORCPT ); Wed, 28 Feb 2018 17:07:19 -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 942A21682; Wed, 28 Feb 2018 14:07:19 -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 93CA83F246; Wed, 28 Feb 2018 14:07:18 -0800 (PST) From: Jeremy Linton To: linux-acpi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, hanjun.guo@linaro.org, rjw@rjwysocki.net, will.deacon@arm.com, catalin.marinas@arm.com, gregkh@linuxfoundation.org, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, wangxiongfeng2@huawei.com, vkilari@codeaurora.org, ahs3@redhat.com, dietmar.eggemann@arm.com, morten.rasmussen@arm.com, palmer@sifive.com, lenb@kernel.org, john.garry@huawei.com, austinwc@codeaurora.org, tnowicki@caviumnetworks.com, Jeremy Linton Subject: [PATCH v7 04/13] arm64/acpi: Create arch specific cpu to acpi id helper Date: Wed, 28 Feb 2018 16:06:10 -0600 Message-Id: <20180228220619.6992-5-jeremy.linton@arm.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180228220619.6992-1-jeremy.linton@arm.com> References: <20180228220619.6992-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.6 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);