Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1701374yba; Thu, 25 Apr 2019 04:24:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuL/woHqT9uv6Ml68+x9XuGaeahhqiSbGdh5VJT7WyWuzpXBchYVJ+qXw4mpqUd4Ek1IzY X-Received: by 2002:a63:d713:: with SMTP id d19mr37003663pgg.145.1556191487290; Thu, 25 Apr 2019 04:24:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556191487; cv=none; d=google.com; s=arc-20160816; b=Ver3aA0rOrBtMRBqi/vWjPYDfOUq4Nf1pUiz5wtrMW3P4vHKsJlrZIRaieAkpCVaq0 4BpLfFcvnOKRz5MEWNzvy/5OTgWTqTsxcYPuXZivXLkBFXZMqjtbuai6fLRu+n1Zjbmu blWxJ/6cCSRw6tB8BlO/DyOwPJVNB9b/BnodKCWjZp9JL3bJ4IMuIC8oAHqSRHncpuGe W2nzhNLGz9c3qcLZ+ouzOtWqGYIqGdezIzwc9sZ9P5kSm6Isgk0TTVVgx8nAxjmr+Ojb JwpF3n6EpQZp8vdbcJad9TNGKjPxR/zyrKV2GdOYGDI/n08WxrlBszRLvm1zQalogRLO 0+kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr:dkim-signature; bh=1xWQsDbTjz3ZGjx/dOA2nmXEB2ldKliuj+3jVO7bE8U=; b=n19dfwUZotYlcke5RD+ogSdqFnbzunm2FbJDRD8CykgSNhWR54NoHInmnF1jwMT5/o GJU51aj9e90nO3l3SIZspdZQ+B0BJOyjWvw/g+VncvOMsnyVAguKJTb2Mp3a4vxp6cXZ 3wfd9vnxo+bQiVbxCI2/L5oYfDtXwk77VbfHm+eDRblRLV5eCHtn+bj0wV1eaZE7DH61 pnLMnmQlLzORMK+TytrtbkJnvUVq4l4WiF7ZpOEC+93KivC4Bk/16SM4UFeuO5m5Jb50 DxxsiiBscUhm9pBYvLdisdEMfRHGbZBRcmEeus897ilD2/M+wAh6N3OyUMZQV9WtP/8r R9Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=WbgnNj+7; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si21786449pfh.249.2019.04.25.04.24.31; Thu, 25 Apr 2019 04:24:47 -0700 (PDT) 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; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=WbgnNj+7; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731223AbfDXVsO (ORCPT + 99 others); Wed, 24 Apr 2019 17:48:14 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:15282 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727737AbfDXVsM (ORCPT ); Wed, 24 Apr 2019 17:48:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1556142492; x=1587678492; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ptio9EMvYP5f+ORUvvZuKR6bpx8beU1V6Uj718zf84I=; b=WbgnNj+7sswrkPVvXzhJr3Bs7sgUedtYzjhjwsNKIINedMN7YPXjtuaF 6YF64lF2UAJnpHgILNULqDgdxqsAgxn5zHivdjDBpSGa5+dQpxnfDJGSI AqO7eQ+BHlpNvgtdxyXX658qkrQ+uthK7ocb2ol81gVmSnpQgNG4m65eH Db+5kBlkcVJdMBAnhpa1SrFymfsdoaj+rhYzqFx4VLJJXX1yHyOu7GrpZ VIheGgOZV+IltmGiEaxjHB+Nvf/wC2J5d/0KpjAibLGewUBMiUwB6LGmp J/rn72LwWIu1SKEPKg3h5C+E9FOq0+KTZ9TSrnkFMeTGKpKlUItlhVwgp A==; X-IronPort-AV: E=Sophos;i="5.60,391,1549900800"; d="scan'208";a="106739583" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 25 Apr 2019 05:48:12 +0800 IronPort-SDR: BPjY0gW5YQuY23KmVCY0BhYMcGH/a7gKlnfctYGjzJ7N2w8Dr+se46BWEV5rNDcCfjFd/HvFcm ofPgDbwN+V3l4SAjN4W4nEHp8HE3r4fNhqtjctZHfiNHVBq0XIos/FcNbTRL+LReRnjTIoP6VQ GenzQ4uq8Q5MyWr8XWQMqVwbVUWYWtvSZgawX8mO5p0IhwEsl0vNTIoRwTJ0zBzLvMcY76AsVY D5hdoW0OSObPcNj0rErAzPgGRbCIOm7niV3bUP5X3u1geUxCCb8+9liCiPmjbX5Nlm+rleg5r7 oJXt6Xiti1yCTHxazV+P0hlp Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 24 Apr 2019 14:26:51 -0700 IronPort-SDR: quCW3b+lX1Ndy1Wt7UxWgfVqe8zOsHY0ctGiHEEhl8VQViFsLHwbAKApNMc4MLDnJ71TfEvJhG 5fmonddg2oJW1G2U9rn9a7BumtehvKQptK86BofNA8471TxgDQT6rF/2i9WS+QuFMkU9GAFp4o 2y/UkPjhmrIk5VUtMBi1zS00v9Ohr9fgMct/lsRVpT7EixYquKGXVPDBGRyLy2P1hCDHLp/J7W 5424QVAXORveZ4zm0dLvUkuzw8uFB6G1HdmrcfKGv0ancXO1BgZz7LAfvAcEfa1WjJDwpUSMj7 lLc= Received: from jedi-01.sdcorp.global.sandisk.com (HELO jedi-01.int.fusionio.com) ([10.11.143.218]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Apr 2019 14:48:12 -0700 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Christoph Hellwig , Sudeep Holla , Albert Ou , Andreas Schwab , Anup Patel , Johan Hovold , linux-riscv@lists.infradead.org, Palmer Dabbelt , Paul Walmsley , Damien Le Moal Subject: [PATCH 1/4] RISC-V: Add RISC-V specific arch_match_cpu_phys_id Date: Wed, 24 Apr 2019 14:47:58 -0700 Message-Id: <20190424214801.18880-2-atish.patra@wdc.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190424214801.18880-1-atish.patra@wdc.com> References: <20190424214801.18880-1-atish.patra@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org OF/DT core has a hook for architecture specific logical cpuid to hartid mapping. By implementing this, we can pass the logical cpu id to cpu node parsing functions. Fix the instances where logical cpuid is expected as an argument in of_get_cpu_node. Signed-off-by: Atish Patra Reviewed-by: Christoph Hellwig Reviewed-by: Sudeep Holla --- arch/riscv/kernel/cpu.c | 3 +-- arch/riscv/kernel/smp.c | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index cf2fca12414a..c8d2a3223099 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -136,8 +136,7 @@ static void c_stop(struct seq_file *m, void *v) static int c_show(struct seq_file *m, void *v) { unsigned long cpu_id = (unsigned long)v - 1; - struct device_node *node = of_get_cpu_node(cpuid_to_hartid_map(cpu_id), - NULL); + struct device_node *node = of_get_cpu_node(cpu_id, NULL); const char *compat, *isa, *mmu; seq_printf(m, "processor\t: %lu\n", cpu_id); diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c index 0c41d07ec281..89251f8ab754 100644 --- a/arch/riscv/kernel/smp.c +++ b/arch/riscv/kernel/smp.c @@ -70,6 +70,12 @@ void riscv_cpuid_to_hartid_mask(const struct cpumask *in, struct cpumask *out) for_each_cpu(cpu, in) cpumask_set_cpu(cpuid_to_hartid_map(cpu), out); } + +bool arch_match_cpu_phys_id(int cpu, u64 phys_id) +{ + return phys_id == cpuid_to_hartid_map(cpu); +} + /* Unsupported */ int setup_profiling_timer(unsigned int multiplier) { -- 2.21.0