From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7F41C43444 for ; Tue, 8 Jan 2019 09:38:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7BC66206B7 for ; Tue, 8 Jan 2019 09:38:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="eEPDgjS7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728576AbfAHJi4 (ORCPT ); Tue, 8 Jan 2019 04:38:56 -0500 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:8878 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728413AbfAHJit (ORCPT ); Tue, 8 Jan 2019 04:38:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1546940328; x=1578476328; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=bw1/Vq2gne9LAKNuyEBhQX+XTh+Fz0MdGc7HYnZ0izk=; b=eEPDgjS7mPcdMJtMOFXdfxbV5sYdEoysnHYQNYU5hMsS/PtpKmQOHOva LhEkFHz+maHoTJhr9DsTDWftleNIUWHs6klcT9L+M9+kAjnjNyfhDf3Xd 4kzteiD6Fvjh42newv6wYYWY+tUkfDLW1xfIlOvkCzlBklwqOXTRrUfWU xEpmaQAGgb9B9G3qeqWtRe8yWKID+NRPCltuLSF02tztTXm6j9HsTDOrb rqQL+NKw2BDYGbOwTB2cdO2v7U2wd00zcSzc4c7LIUCZsRKr+z9mXSZH7 IUOMHFxbMYINpiwPek2Fizmq1a7/qfu2VXvpOXUAbDuBkEIQ2W11yaiOm A==; X-IronPort-AV: E=Sophos;i="5.56,453,1539619200"; d="scan'208";a="99458414" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 08 Jan 2019 17:38:48 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 08 Jan 2019 01:18:53 -0800 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; 08 Jan 2019 01:38:47 -0800 From: Atish Patra To: linux-riscv@lists.infradead.org Cc: Atish Patra , Alan Kao , Albert Ou , Andreas Schwab , Anup Patel , Daniel Lezcano , Dmitriy Cherkasov , Jason Cooper , linux-kernel@vger.kernel.org, Marc Zyngier , Michael Clark , Palmer Dabbelt , =?UTF-8?q?Patrick=20St=C3=A4hlin?= , Thomas Gleixner , Zong Li Subject: [PATCH v2 7/8] RISC-V: Check and continue in case of an invalid cpuid. Date: Tue, 8 Jan 2019 01:38:37 -0800 Message-Id: <1546940318-9752-8-git-send-email-atish.patra@wdc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546940318-9752-1-git-send-email-atish.patra@wdc.com> References: <1546940318-9752-1-git-send-email-atish.patra@wdc.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D702C43387 for ; Tue, 8 Jan 2019 09:39:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 00F14206B7 for ; Tue, 8 Jan 2019 09:39:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZG1KVoQI"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="DSRG03E9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 00F14206B7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Hn8tPbLs5wq7OnIXj8LC4XthZctS8qwMEG9+VR2o1cY=; b=ZG1KVoQImgKwb0pbkcOiupUv5P fgQh0yjFYk39fXD+1MKJXN4yFDJia7q/UeolycGxEWWl+xiCgn9048QEbscpgve39CB7f95Jov2sq XpwYhgsQ/GPkJ3f6kIhw1XbHYn8Bs/wctWysQUlJm9HZtUhj65vu05Tjgd4lpgpeFj/KFykuMeW8p 0rN6WZPu41F0w+4BrkpsuSXVRMqOx/Eq7gt5SMfDk6mLOHQQi3zgIH+Lp0ApWiYlkaZ6gbkz3AIW0 7404cxVQzEYcC2n8kBi+xTwiC+JrH6+2of5GyQCULZo9/BCq7pjPA6zE+f71iwsQJjoY+uKEEl/TR pAJ8mCdg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ggnqh-000425-9f; Tue, 08 Jan 2019 09:39:03 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ggnqV-0003lv-0S for linux-riscv@lists.infradead.org; Tue, 08 Jan 2019 09:38:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1546940332; x=1578476332; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=bw1/Vq2gne9LAKNuyEBhQX+XTh+Fz0MdGc7HYnZ0izk=; b=DSRG03E9Ba1K7rcKXlL2HzxhKoZLZgRTGeyMZPBV/GFxMIQGbPfx9CtF dR0+ky3g17XHhGxoUCIDZOZQyZxdxFSF8CsySMFarKh8NWHC+reZjAKzx kI6sUKxeyWBXCofAcVec4cbR8qxHaa6WtVuA4dnDjiWfBYbobov4wY/en EJGCOBsyRllzsFJYMQVRx1k2hG1GbGCY8a+pzunBbDWbLpmtEkQsnKkU0 cDrXO1aqfpjUGeVgMBBB1E5r02uEfrGPO54W1dNbKPppdTY97/F6RH92r q6E+6N+3sIcusm2CCb+Lr13N8MiNic7xZ/feSncSdJQ1iCTWRgKI3UnMl A==; X-IronPort-AV: E=Sophos;i="5.56,453,1539619200"; d="scan'208";a="100000261" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 08 Jan 2019 17:38:49 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 08 Jan 2019 01:18:53 -0800 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; 08 Jan 2019 01:38:47 -0800 From: Atish Patra To: linux-riscv@lists.infradead.org Subject: [PATCH v2 7/8] RISC-V: Check and continue in case of an invalid cpuid. Date: Tue, 8 Jan 2019 01:38:37 -0800 Message-Id: <1546940318-9752-8-git-send-email-atish.patra@wdc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546940318-9752-1-git-send-email-atish.patra@wdc.com> References: <1546940318-9752-1-git-send-email-atish.patra@wdc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190108_013851_184931_C4B7D8FE X-CRM114-Status: GOOD ( 10.57 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Patrick=20St=C3=A4hlin?= , Albert Ou , Jason Cooper , Alan Kao , Dmitriy Cherkasov , Anup Patel , Daniel Lezcano , linux-kernel@vger.kernel.org, Michael Clark , Atish Patra , Palmer Dabbelt , Andreas Schwab , Marc Zyngier , Thomas Gleixner , Zong Li MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv