Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4649078imu; Tue, 8 Jan 2019 04:01:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN5Z3uPC9BnAiASjIbhqUKaaVL+ywarfs87XoL6Cxg3Y2xGqIUzCDrxYjSFIhBEEBryNx5Sc X-Received: by 2002:a63:8ac4:: with SMTP id y187mr1278384pgd.446.1546948919795; Tue, 08 Jan 2019 04:01:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546948919; cv=none; d=google.com; s=arc-20160816; b=ExxyvDyfc4AXMkjBM6G2P0QzqKHRrh7C5IWDWyl4qAhDCOWtXtZ1gyFbDm75A7DFWq t5+F33bdkqLG7zi9+WGbckiTpiX04AfTKEw0duZ/TXjpUSr9PgYAQ29ayEZ4el4hkTfq LgEDiqoIK+IuzL4n51VXE2NWyIt1/W6YjhUlC9TfYOCA8/11Mcsxk5POtqb8+XvJimNO gTboSJwmfbqwMGrI2vlPqOffZzxlk3C2SnLqwkB4AYYpFko9c9JgjW+Hg9+Fa/XgKsyx 935AdI5ZC70hUFfdN/2lFyRu177aUwOkxv6GZAo/mb9axBj+E87JfmpXlvW0WyZ/7hiA QXXQ== 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=B6+Mdwry/rSeNTTRL+5i0V1ZgR5fjtkD/lW5yWIBnyo=; b=MZ/LnRxtFaba/fcUqsI7KXloWCm9BXp5yF8nxkt9L/ifaijZ+w5bpsV3WyXshbj1Zy 076U08EV9gKn6oM2VBJogNhSgyN73LK3Wt2WVk/9XT6jodTO7RhaS+t/+9gYsEk1QE0t pasOCZzx1qULSZdW5I4XJL3wkkpYmKsq1x9VwPbtesCzzUmRjm7sNZtv0j8SiWr4bPyM 49EdKyExaizjXPadlzbdHewYwX66MOtlYT3k3+Mp+EZr0MKTNa1GwF/hN8+nLOIEvIlS YER/WO76U/pMDufvRejFsMG/+2MbTZFcSnSgXfPFiEds9Jgm/v6XdACM1H4mJ7LB6Le1 rtag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=f5IldSnJ; 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 o11si18975605pll.160.2019.01.08.04.01.43; Tue, 08 Jan 2019 04:01: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; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=f5IldSnJ; 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 S1728779AbfAHL74 (ORCPT + 99 others); Tue, 8 Jan 2019 06:59:56 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43213 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727107AbfAHL74 (ORCPT ); Tue, 8 Jan 2019 06:59:56 -0500 Received: by mail-wr1-f68.google.com with SMTP id r10so3741513wrs.10 for ; Tue, 08 Jan 2019 03:59:54 -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=B6+Mdwry/rSeNTTRL+5i0V1ZgR5fjtkD/lW5yWIBnyo=; b=f5IldSnJurHNa6rFqFFW58ThEuVg2vlbYLSEegNPjHWLMeYU2rcjq+arEMlM8Y4HOP L4bYcXrP3XebpSyjj7lft1Z3wMXi4JJtk9UrqPzgyNRPTuPHkov8+4uyqDsTjBUsKunm dIYdmV/z1k0bSsqLu/MKMvwO6HtWX5dDfAEd1f8kgxptFve2liCSRvZTV7rRat1GyTMz K/UkgyJIUAl/aENh8tDqiIjp4OeBQPghCumvDwrQzkXmd/j9DRRSKDIXcczRs6FbTKwY q8iqhELiv4DboqPVxhh3GnKuWdDx/F0VKPpritk2ZPvyx/zZ0F7qviWIbxbTOkB0c9vs bzxw== 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=B6+Mdwry/rSeNTTRL+5i0V1ZgR5fjtkD/lW5yWIBnyo=; b=mqrY7kc6AeNFf9OpKBn7xzzEsYp2ku0NE3dmuzRmSq4y1EOhkmjdyfaAN2bbKWkpzH JrANidIMH3UIoXl48QDq23ATHb4fHQ/92eUPTttMAhYiwni0SUrWAXFW6g76bA/jDwWR Mt9SPT0bHflrkNzqJAM7eQrxZyNCp91qJzM3EJdH9f6tSFmdlEjnQN9ed4Rx2k9hB8wI Q6Gjy4oFHdSYuCBIZ9KAk2E+hTCj2HUh6pqQqILRXRHSEGYXZct0qUyHqsTyFGC7mFBH jJjHgKj3IA2WFGdlf6WsLy+BlOvzPX29W9Oes9Bi3nAvHGQuPXFA7hurhX1r8tUJYYRr U6xw== X-Gm-Message-State: AJcUukc55dlXpWpan+KWtrRw6dpF3fYAEjBCRdzSswz+lrwiuLVDZqKa bFzluTsa5VpnXDgL53o0mT7YLdo2GOOxfkZgDUNk4g== X-Received: by 2002:adf:91a3:: with SMTP id 32mr1107409wri.99.1546948794020; Tue, 08 Jan 2019 03:59:54 -0800 (PST) MIME-Version: 1.0 References: <1546940318-9752-1-git-send-email-atish.patra@wdc.com> <1546940318-9752-8-git-send-email-atish.patra@wdc.com> In-Reply-To: <1546940318-9752-8-git-send-email-atish.patra@wdc.com> From: Anup Patel Date: Tue, 8 Jan 2019 17:29:43 +0530 Message-ID: Subject: Re: [PATCH v2 7/8] RISC-V: Check and continue in case of an invalid cpuid. 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 Prefer, commit prefix "irqchip/irq-sifive-plic:" instead of "RISC-V:" On Tue, Jan 8, 2019 at 3:08 PM Atish Patra wrote: > > riscv_hartid_to_cpuid can return invalid cpuid for a hart > that is present in DT but was never brought up. > > Print the appropriate warning message and continue. > > Signed-off-by: Atish Patra > --- > drivers/irqchip/irq-sifive-plic.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c > index 357e9daf..254ecd76 100644 > --- a/drivers/irqchip/irq-sifive-plic.c > +++ b/drivers/irqchip/irq-sifive-plic.c > @@ -237,6 +237,11 @@ static int __init plic_init(struct device_node *node, > } > > cpu = riscv_hartid_to_cpuid(hartid); > + if (cpu < 0) { > + pr_warn("Invalid cpuid for context %d\n", i); > + continue; > + } > + > handler = per_cpu_ptr(&plic_handlers, cpu); > handler->present = true; > handler->ctxid = i; > -- > 2.7.4 > Otherwise, looks good to me. Reviewed-by: Anup Patel Regards, Anup