Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3594564imu; Tue, 18 Dec 2018 00:38:15 -0800 (PST) X-Google-Smtp-Source: AFSGD/WkgMi5XzR3I76+78mHXpeYt3gbRo4zvcurFHcDiDyn1eAVdPCSmvNisErPAAR/bLlY+fEX X-Received: by 2002:a65:51ca:: with SMTP id i10mr14465734pgq.371.1545122295426; Tue, 18 Dec 2018 00:38:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545122295; cv=none; d=google.com; s=arc-20160816; b=PNOeUONmqLqHCzvPawGbZnP/9vCBCmo2Z4SSizaLhImb6bxUEODw4i8/UBVLO6MqcC pfXxsV0IGBFPsi6CX5PWzJGnFJyJfOHZfVdnvoWS2udTimz+7NKeIV6qEmXZjRxsHPxJ yy559UyC/nfx4RzQy9ofoxyY7zXL25qQ+G2UAWucfiJPoI2k5FqUFn6LX6MeSPLz0/Kg smF6zNjZr2rzpYlzrCQ7J6WBLFDjMQck8lxb9AXywyc1T70XRxDjtbEWDtzOg5L3l9f8 DbdROtRFpmdPAtvecz5LJz76Fl9NYp204gduDWMzHgCRkatzI8FLD5eK7AfYYqrbQ7x8 2vZA== 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=Z6xPOHkiFjAua7p3m3cOH8RbdrxMp2PAq5c5QrYtguc=; b=YK/bPRs/7hZy4EbVUJ/Ywl2qIVIXJb+gYj1oIXkPKeO0mBbLA5ZfjS0yoeaiZVvaEj h1d4lBucUIGtBOkxVdn0E6YmxCQZiuqg/E9tSse5J9pCF95QWrxTeGF/oOqBgxej9Z4g dWvEqhW3NGxzv/q5p+ospXgbxj5X9UlKiI6mgpzRb9Gd4wOLh7dNueg8QFUQgyrLP/dZ 9gpxSn8gK4K1KgWPV9LmOkxOrJ8OxxhvZc5QtwX3y+JcYtMWSIX0xVj1ELK7X8gMnfkg Xym6CWrvvn+hXodJH7FIpUQwm/anadKK6Bf8Gm3uFqG30oe3N/K0cX+GGjyZHgccGflm YjeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=aYsUlbGg; 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 d4si13381757pfa.150.2018.12.18.00.38.00; Tue, 18 Dec 2018 00:38:15 -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=aYsUlbGg; 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 S1726690AbeLRIgp (ORCPT + 99 others); Tue, 18 Dec 2018 03:36:45 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:33236 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726638AbeLRIgn (ORCPT ); Tue, 18 Dec 2018 03:36:43 -0500 Received: by mail-wr1-f65.google.com with SMTP id c14so14968532wrr.0 for ; Tue, 18 Dec 2018 00:36:42 -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=Z6xPOHkiFjAua7p3m3cOH8RbdrxMp2PAq5c5QrYtguc=; b=aYsUlbGgFWDEdTPnV0XlupgMvbbuBmYOMIqGPJhPE81Fbq+7a85inoth2jcqtjld65 ifQGGizdmqfPBW4GCIt/7YJsK+C9gtdJCTcvUT7M4ncQP2Ul1zaSXqDBnUvd9p9zy61z 6X5+M08//P845iFngS3zwQEnXc3zu6DdZkBmKPd5SaEt5OQYOKeRTVhgB21wniypvAtp jnEjOCL2va04n8mmgIUcOGRtQft+FhDtKeOvDL97c5QDoaQgDbFONqZVm7b1qONOnkB3 Z59+Jhc4/JYWLYcMB7uBZWKuvrkFVtDm15abMr7TxlGgDhfz8w3ct5x+Ao17N9lgxxZM m2Ow== 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=Z6xPOHkiFjAua7p3m3cOH8RbdrxMp2PAq5c5QrYtguc=; b=Ll8hwb/uLgXxSTx3jnVpPqgRiijuWmIDqjbQqLW1cMwXYSQpVZlwRpRBJZQxFkk5Ee tweohvKZaU/KrxjB5/rGLDxFVLRixHxCU5YhapLjhiNxT2Dn27sxbO3s46z6ZzEt/KNM wYG9esamKuOFYg1a83QNoXEu4lC0tCVBdgl3FE3cRm2kzR+FrcWm3dUSXaWUk2twQrUh SCxAzz+g1B3zR8RDCpwZihBPAMVQg1Npqa2o+IdgYcVNS340ukb8mxhZOtBOkOEynOrE h1wLNBZu/R08otNC9Zw2DKc/KG6UFwikW1NjMeMVHT10a8NZUGTWW70O7qBbZDf6uYai mXQg== X-Gm-Message-State: AA+aEWYAtEQ2PufU0TR+qwiurw+EjoC9EvRdS0IMuHa5oDVpRNihF0/p uBj3frugtHrU3f8s6FefJaH425XcZaunWpSd4tRjIQ== X-Received: by 2002:adf:91a3:: with SMTP id 32mr12280891wri.99.1545122201042; Tue, 18 Dec 2018 00:36:41 -0800 (PST) MIME-Version: 1.0 References: <20181130080207.20505-1-anup@brainfault.org> <20181130080207.20505-5-anup@brainfault.org> <20181217182812.GD7086@infradead.org> In-Reply-To: <20181217182812.GD7086@infradead.org> From: Anup Patel Date: Tue, 18 Dec 2018 14:06:29 +0530 Message-ID: Subject: Re: [PATCH v3 4/6] irqchip: sifive-plic: Add warning in plic_init() if handler already present To: Christoph Hellwig Cc: Palmer Dabbelt , Albert Ou , Daniel Lezcano , Thomas Gleixner , Jason Cooper , Marc Zyngier , Atish Patra , linux-riscv@lists.infradead.org, "linux-kernel@vger.kernel.org List" 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 Mon, Dec 17, 2018 at 11:58 PM Christoph Hellwig wrote: > > On Fri, Nov 30, 2018 at 01:32:05PM +0530, Anup Patel wrote: > > We have two enteries (one for M-mode and another for S-mode) in the > > interrupts-extended DT property of PLIC DT node for each HART. It is > > expected that firmware/bootloader will set M-mode HWIRQ line of each > > HART to 0xffffffff (i.e. -1) in interrupts-extended DT property > > because Linux runs in S-mode only. > > > > If firmware/bootloader is buggy then it will not correctly update > > interrupts-extended DT property which might result in a plic_handler > > configured twice. This patch adds a warning in plic_init() if a > > plic_handler is already marked present. This warning provides us > > a hint about incorrectly updated interrupts-extended DT property. > > > > Signed-off-by: Anup Patel > > --- > > 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 d4433399eb89..3d4f205f8abe 100644 > > --- a/drivers/irqchip/irq-sifive-plic.c > > +++ b/drivers/irqchip/irq-sifive-plic.c > > @@ -234,6 +234,11 @@ static int __init plic_init(struct device_node *node, > > > > cpu = riscv_hartid_to_cpuid(hartid); > > handler = per_cpu_ptr(&plic_handlers, cpu); > > + if (handler->present) { > > + pr_warn("handler not available for context %d.\n", i); > > + continue; > > + } > > Shouldn't this be something like "handler already present.." OK, I will re-phrase it. > > Otherwise this looks fine: > > Reviewed-by: Christoph Hellwig Regards, Anup