Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp344747yba; Wed, 24 Apr 2019 02:08:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNMAb8KUvLhrPJXy8ZRK1p9rempTDmN+kSSABXFHkB2uhF2q2Lg1pTQDjZpIGV9u3m/5TT X-Received: by 2002:a62:b418:: with SMTP id h24mr31517798pfn.145.1556096938434; Wed, 24 Apr 2019 02:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556096938; cv=none; d=google.com; s=arc-20160816; b=mvK/2bqZt1O3HYONC4Ui5BL2wwZEwhQyhi7GtFAQCkENiSZGho43NBMhohn0HJIUUh vZJansztRAADvgADmeNJ+/VFIRZYq7sIizGm1jA+elMzH8yPGPR3eqw0/jBOPb+LKOXC 9Ro0OHE/hq5d3k14iLw+TgV6Iu0Jjxwy2AptRwvMT7uV/6nKaSjdXItdhp5Quuvmt0KV VPuaoh9OIlF0zWx9PdX5mzbkriSSdJDu8LZNWw32M0twjATAoP7ZkPtpY2grJsg7OGf3 EuYy7KiwbGhn4MK6to1W7SQJz45doKAh3JPKj7uSsMQQSAz+amNK/D9xURYKF9xT+9NE NnXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=rz+GYtqgldMYK3PobWaTcPCrbBeBFXQ6BGTMl9sOxPg=; b=C9GE/wTiXzjXGE9G/+8a0MEvjQIkzGE268G6pH6BojKdLnraHA0rKd5AsbkU1bZoIv BiU+N/tfgtiiWMlRX2XVrFPLylKJ8iQZkuF6QlwJUSPgvKt+PCcD+6AAy/OFuLd14kWx 5+r5YEKPsUpaJjbGeuvn9tCF38i1HNsF4mQsTlLnUSzy43V1rvXdlnZF2tzegZLTDCpV rqdOVpXxXFkYJpolq7vAzs1LaSOnkJGNWvvTDFmE6p+E4lT+0bjBL2R8606MYbgW24Z5 FmcCz3dgeK5WInYRLV7BhGvQo2olQw7h/t8UYkuPfcdyjn+xxYfGms+FBSF33K40CAPf GxjQ== 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 b8si19038676pla.153.2019.04.24.02.08.43; Wed, 24 Apr 2019 02:08:58 -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; 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 S1728834AbfDXJHZ (ORCPT + 99 others); Wed, 24 Apr 2019 05:07:25 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51906 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727329AbfDXJHZ (ORCPT ); Wed, 24 Apr 2019 05:07:25 -0400 Received: by mail-wm1-f66.google.com with SMTP id 4so3590205wmf.1 for ; Wed, 24 Apr 2019 02:07:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rz+GYtqgldMYK3PobWaTcPCrbBeBFXQ6BGTMl9sOxPg=; b=KV6eCR5C34Qy4NTGpVpvM3O/pDWDOjx3fKJo5cIqcTl3fJyJjbWTsRjYPoZXLpfoWq D2bT5V3GvY/0vWInZgGkGWwbSMdzAo/AbZ475nJ9KDXRFx3mk9glhFdwZqAn2kkrqi4G rW60oixM6+0ZYtn8wucXj5TjCSPe5Zv+oi1csUD/bpj5FkTl+qEy9mZtvo2KHjqQCqf8 H665MNgWVk7XYG0rvuJukrsOf+ifEd3xF+ChVpkpsP8ytNw2sj5ORpsK6OZzHIaqPydy 4nSJwb5FRYFds7nYRBf7o+jAoZexIOfo9OXEBILnyhSRZkeRogWvxa3CPMjWFYEGgzGI T4Aw== X-Gm-Message-State: APjAAAXDs0nEDRXaWOsgC9+xPO5Z34TsCG4Hn5/rMKL+sQxWXbUdKRtR IvkqZU8op3erhrChoJXHozE8BpStv+09l316Da4= X-Received: by 2002:a1c:3845:: with SMTP id f66mr5385802wma.97.1556096843472; Wed, 24 Apr 2019 02:07:23 -0700 (PDT) MIME-Version: 1.0 References: <20190424000227.3085-1-atish.patra@wdc.com> <20190424000227.3085-2-atish.patra@wdc.com> In-Reply-To: <20190424000227.3085-2-atish.patra@wdc.com> From: Sudeep Holla Date: Wed, 24 Apr 2019 10:07:12 +0100 Message-ID: Subject: Re: [PATCH v3 1/3] RISC-V: Add RISC-V specific arch_match_cpu_phys_id To: Atish Patra Cc: open list , Albert Ou , Andreas Schwab , Anup Patel , Dmitriy Cherkasov , Johan Hovold , linux-riscv@lists.infradead.org, Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Christoph Hellwig , Sudeep Holla Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 24, 2019 at 1:03 AM Atish Patra wrote: > > 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. > Reviewed-by: Sudeep Holla > Signed-off-by: Atish Patra > --- > arch/riscv/kernel/cpu.c | 3 +-- > arch/riscv/kernel/smp.c | 5 +++++ > 2 files changed, 6 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); I assume it work working just fine as you are doing cpu to hartid conversion here and weak implementation of arch_match_cpu_phys_id does direct match. > + 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..94db72662f60 100644 > --- a/arch/riscv/kernel/smp.c > +++ b/arch/riscv/kernel/smp.c > @@ -70,6 +70,11 @@ 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 >