Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4650945imu; Tue, 8 Jan 2019 04:03:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN7gBa/+Skcf4AYhDwIXQ6tg+QnvQpfQKLY4gcquV1r9tIFN9aLIW7iANe1gBEA2X+lq9N0O X-Received: by 2002:a17:902:bb05:: with SMTP id l5mr1542737pls.230.1546949010480; Tue, 08 Jan 2019 04:03:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546949010; cv=none; d=google.com; s=arc-20160816; b=IiU6oslZXZuaW5FEJHpKBZ259K/9LkAosx3+RxHicAXRiXCyOj0epCLh0r4DiHeXbk ddTwJNYartcHcp1CDXueVcGk8vT5sTgI9yAKJsG9rUbr10cei1pwx01dZV4edMjp0maD BHRNHxK1pXeN9ZRB26MODWDkWalUK6A7zWtbnFaoxcRHBhB1mGtzk5mWKJrjxrSFmat6 HkASd+AtVXJR8WrxfES+71dIbSp++vwewfpZGiIVFxpQMnaj4p4b6xgnovflzWvPng8G nw33TIBXNbNnCs16u5QoxaYPeHleIsDjkflLHVQnCQ643hyQLk3FBNHM7vdXXXxyNkZ6 VWjQ== 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:dkim-signature; bh=4z/joS18OrBx5VzkEUr1UXjVHtJ0iMM9fC/5WEi+jKg=; b=yha7Hwys9DgO8bvb2LnvDsM65hQoenBP5oncZ93djgbnMGHKPodcFlPx08uIIbX7Fy NmZaKTRFiHaN9dNwsTQs4NBqHfQ12KMT+oKJMo4Q7TTp+hW6nhRozrx7gFQls7BrDBuc uIzM9Hd/qRkc0jZzevpudRt2P7rvdj0KGIVzNpBrJhL5SWxabAgsaGSRtbzTZVUYDLFM tVA/GJrH3adGC7VPZjlGwpuFfXClF0OpN5wE/xoPRfS9C4lFyTlBZCdm2Eg980Ox++1s FQyO/accOgBuY3RSvXPyUJf7xDSTbtWzXfE+95OMJj9G7Rtii4z5Y0eKlDKW/x/+ltoG EF1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=wL+AvZqu; 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 w23si62098178plq.198.2019.01.08.04.03.14; Tue, 08 Jan 2019 04:03:30 -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; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=wL+AvZqu; 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 S1728716AbfAHMBw (ORCPT + 99 others); Tue, 8 Jan 2019 07:01:52 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:51354 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727107AbfAHMBv (ORCPT ); Tue, 8 Jan 2019 07:01:51 -0500 Received: by mail-wm1-f65.google.com with SMTP id b11so3889537wmj.1 for ; Tue, 08 Jan 2019 04:01:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4z/joS18OrBx5VzkEUr1UXjVHtJ0iMM9fC/5WEi+jKg=; b=wL+AvZquaWVe3+cpWa6p+I7Qq5eeTQRKQgOLuwpVCjMC1pd5/PCHJV2lPQ50Gy+NXJ KoRyatQs2KqojE9wsH5bgtbQiY5eF5UgjY7At4k0n2qi2pfnkbMACSnxQ01htM0if6nB kezg4lD3DKi7ZQK2LsQgM9kiZmNXQVv39sFiq8OPgVugnP8gL2saqm8d+yd4BOKnAtQf O6mJW8kgiAYCB2eE1d1jJYbMwtbOELXEl4K/i+JGrrhZZZiLkkg3WNIP7WVM9ckUbnsk XQVweuX30Eruy5yGcg9IdnW8zbxFcn9R2SpFtbiI6RW97vQYO/3YO3i9zZk5oRL+/tF+ Ck2g== 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=4z/joS18OrBx5VzkEUr1UXjVHtJ0iMM9fC/5WEi+jKg=; b=EAeRnGFBNCJPfqtnyAIr9orTw4+plogl0t/FkQYseTyhY6h2ttoGvZQlICjopIlaUH 6S1sEOHdvPwsjAEz7m34vh05Q1gZUNy91qT66D61BmcXYjVkrZmfVWcwTLxkENNusEHl goKjGJ1qxcGPd70SRmPpwxbTGsMF4esuvTPfOvjPoCda8RjzpNUmHuyf6zoLIL00rQNO E95kZhIZ4BLAB5K5dcCbeQ+vYaD+Errx7UBY/XjWiUN4S2SpjiEsipo+SIVmqZsngY8G LkC5dIdyCCat7zSEeuNo0Ond2BvpN2rihjxYB7sB6gWLC/n5wkGbfSPURCN3RoV8FmF0 o8Xw== X-Gm-Message-State: AJcUukeOfLPYSQphN8wWTxGkiB9d/lF3n0/FERyDWJsz1YzNcPRnDYs7 4RhrAAQ5k/GHRAbQa9D0G7EAW2u0yv0C2495UgForg== X-Received: by 2002:a1c:ca15:: with SMTP id a21mr1458339wmg.132.1546948909573; Tue, 08 Jan 2019 04:01:49 -0800 (PST) MIME-Version: 1.0 References: <1546940318-9752-1-git-send-email-atish.patra@wdc.com> <1546940318-9752-9-git-send-email-atish.patra@wdc.com> In-Reply-To: <1546940318-9752-9-git-send-email-atish.patra@wdc.com> From: Anup Patel Date: Tue, 8 Jan 2019 17:31:38 +0530 Message-ID: Subject: Re: [PATCH v2 8/8] RISC-V: Assign hwcap only according to current cpu. To: Atish Patra Cc: linux-riscv@lists.infradead.org, Alan Kao , Albert Ou , Andreas Schwab , Daniel Lezcano , Dmitriy Cherkasov , Jason Cooper , "linux-kernel@vger.kernel.org List" , Marc Zyngier , Michael Clark , Palmer Dabbelt , =?UTF-8?Q?Patrick_St=C3=A4hlin?= , Thomas Gleixner , Zong Li 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 Tue, Jan 8, 2019 at 3:08 PM Atish Patra wrote: > > Currently, we set hwcap based on first valid cpu from > DT. This may not be correct always as that CPU might not > be current booting cpu. > > Set hwcap based on the current cpu instead of first > valid CPU from DT. > > Signed-off-by: Atish Patra > --- > arch/riscv/kernel/cpufeature.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c > index a6e369ed..ed6122ff 100644 > --- a/arch/riscv/kernel/cpufeature.c > +++ b/arch/riscv/kernel/cpufeature.c > @@ -43,12 +43,15 @@ void riscv_fill_hwcap(void) > elf_hwcap = 0; > > /* > - * We don't support running Linux on hertergenous ISA systems. For > - * now, we just check the ISA of the first "okay" processor. > + * We don't support running Linux on hertergenous ISA systems. > + * But first "okay" processor might not be the boot cpu. > + * Check the ISA of boot cpu. > */ > - while ((node = of_find_node_by_type(node, "cpu"))) > - if (riscv_of_processor_hartid(node) >= 0) > + while ((node = of_find_node_by_type(node, "cpu"))) { > + if (riscv_of_processor_hartid(node) == boot_cpu_hartid) > break; > + } > + > if (!node) { > pr_warning("Unable to find \"cpu\" devicetree entry"); > return; > -- > 2.7.4 > Looks good to me. Reviewed-by: Anup Patel Regards, Anup