Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2611496imu; Thu, 17 Jan 2019 18:12:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN6EQfLCcmZYEmpiLHWXhe5F1yc7Y+gv4p1SSy+w7OYZxwRo/3EnHTfWTZLokIk/ubPfqxgj X-Received: by 2002:a62:8a51:: with SMTP id y78mr17243661pfd.35.1547777576547; Thu, 17 Jan 2019 18:12:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547777576; cv=none; d=google.com; s=arc-20160816; b=m5EosaG72QalWSHY2y4d3qQhEFAz1a6nSEV7e92THgH+xpQozTk10jyxIC5z+wwVN0 0stMyinclszHMn9LPx12dkRWCI3fovOeHD2uSaJjvHN+oBqXpGuBEems3PSdEJ9IsMJM ghDtD49ilyV1oudiOJxXBkltBcCJ2XciW3mZefdeZ1sFWnlxvz3XyBoO3gMcMMaYn/+3 tJh9XcltvksPEU0fv2ht5OIP47laPkjx2YGtuDgjQIEqKNP+a+Nkzqjg0uVoKZstS6f9 VqD6WhO1PaTi3450Ljhnxy1/DE6ffkrJSEwzKRPzc0gjsH9WrsRnnaGRov2a5gVTZtvl ZWLQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=CdEQwuGqoY2XUTaQf+OHW9+SYastT1xpsDQJCsTfj0E=; b=a12nE6JIsmqTCbhNJ36f5zNnGmQglmC0NvWzm7n9ZXiqrWPQTN6vrpbZSGosJkbtSP 5Q//WGtCjO1exs1G0e8Fq1OrwZIzBcjlvoHDcRGPgqtPHnHg5u40NXMxGxfiMzLtW8K+ ewytqy3srPvTlWY+pz/l1sOsi3nN06iFCE2mgBmGSz3qIUV7XVB25yf4OyVLtTGSF66v /uuGG8WQGqv/wBJDpj9GFL+fFIEirAeYAMecgnm6QsWYG72DBL/W7YDOnxUaUG23T+m6 3sQy7LBgyfdsbT6lQv3GdVI7G5PMHcOhQTG7byOzE71vVMWU63yqhF9RchN0+T5V6ASa FZfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=mYFB24vm; 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 3si3298881pla.240.2019.01.17.18.12.41; Thu, 17 Jan 2019 18:12:56 -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=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=mYFB24vm; 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 S1727082AbfARCKm (ORCPT + 99 others); Thu, 17 Jan 2019 21:10:42 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:21044 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726834AbfARCKm (ORCPT ); Thu, 17 Jan 2019 21:10:42 -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=1547777442; x=1579313442; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=zlOkxdwgTtcKUukUT/zB3tM58Winto37alvQsq8ejgo=; b=mYFB24vmDJu5ncyYFCKpvknsA67QFKfU0htf6kTDAb7FQCbcRxmfh2QB yM5HrFIF8okPUB1RLSxMu+H7K1RuBcry6yk6BKJHy6T3cFE0LFiJkQyNV uP4OoNjdK8lSVBMXawbkhPFbVihPPT60m8sl1NCDtefb9/QVpDlz74Gr9 vuXrw2W7uiTtV1jEf88Bu7V6+wQErLHR43C/ka6foDrVgMs2I4/zHyqjI IRU3hc4mmqoZwmA8vJxaO3LwZrqGbyAhTnEKekqgZfmd86RnStdvB6sQx 90qD6HkXPRfDUWF1x3LSSRXR7uSQmJKrnYu/qcZdJ+NYBlRDxZooLKflP g==; X-IronPort-AV: E=Sophos;i="5.56,489,1539619200"; d="scan'208";a="100881259" 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; 18 Jan 2019 10:10:42 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 17 Jan 2019 17:50:21 -0800 Received: from c02v91rdhtd5.sdcorp.global.sandisk.com (HELO [10.111.68.123]) ([10.111.68.123]) by uls-op-cesaip02.wdc.com with ESMTP; 17 Jan 2019 18:10:42 -0800 Subject: Re: [PATCH v2 7/8] RISC-V: Check and continue in case of an invalid cpuid. To: Anup Patel 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 References: <1546940318-9752-1-git-send-email-atish.patra@wdc.com> <1546940318-9752-8-git-send-email-atish.patra@wdc.com> From: Atish Patra Message-ID: Date: Thu, 17 Jan 2019 18:10:40 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/8/19 4:00 AM, Anup Patel wrote: > Prefer, commit prefix "irqchip/irq-sifive-plic:" instead of "RISC-V:" > Will do. Regards, Atish > 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 >