Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2491932ybe; Sat, 14 Sep 2019 16:31:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5Wmy01g9cNyaurE+e0iidRX1ijBASqtBozv+QCj/CQHK4WuCYwUTLHSStD0qfS9U2Upuh X-Received: by 2002:a17:906:2358:: with SMTP id m24mr3355486eja.64.1568503876097; Sat, 14 Sep 2019 16:31:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568503876; cv=none; d=google.com; s=arc-20160816; b=mle3be5NGCpew5bUxbzJ64CBP9VOHQbsR8IAqQeYh0a/jFe5WrI7pd6yKD6b0FnJii wChxF6NIm77AES9cxGfGMyneLcjqQ+cdrNUfEs4mTxOU7bbxaV4tva35EpU2xP1OES+K MAcCq2YyqIWUye6v7p9wvs34b4XEuy4OoMa90krldJlG7ZBEpFFgdiLxlf9HOGW1tYC1 83RZ1CMDtu+ZuZDWOPSsaRjSoULeWQcqdozlryti+3pm+kDvs5N9HCwAO3MbdiLz6KYo Aw34AFxbL6E62T5+IbDlTuMVLYchVuZ9w9h8DzLegNoEYxErXLwpgxBMbkcIpyYztSoZ PmDA== 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=qEuJqEba5wd0EP42PfWTuZEN2nNByfuuSJHMeH7V5js=; b=sNOKqYIG6oYvrqfnCBYLxm2CiTG66unDySxjrcw/DGGHI5GuCyNvcaBVovtl5w7e5l rXhaYA2v8BRBfBZYtUr8ZXBZ+Zi1Vs6a4c+2ll7jLvWdlTRayraCwfvYsYRU9lTm2gJS O4AmBfQeaJuVVNdPp7FbgfS5XPSfk94vnIMBOaAQ0NodbaD+dv4bKtaH6V06FTD7LXSt APLGr+n/SHNeWZ45udBB+Dnx6cXpDhhV0wl9R3tR5P2P98xjiBt4tgQJuZcjFa7Qesab Qyt6UUj3BllCuVXCtUMXLEeKIzmYFuZVEmrxXh8fIaHVCSplAXQXZf7ztOCHbsfyy+bZ WX0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aWbri8oF; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b42si18993257edb.11.2019.09.14.16.30.52; Sat, 14 Sep 2019 16:31:16 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=aWbri8oF; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730029AbfINTmq (ORCPT + 99 others); Sat, 14 Sep 2019 15:42:46 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:35267 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727570AbfINTmp (ORCPT ); Sat, 14 Sep 2019 15:42:45 -0400 Received: by mail-lj1-f193.google.com with SMTP id q22so25544496ljj.2 for ; Sat, 14 Sep 2019 12:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qEuJqEba5wd0EP42PfWTuZEN2nNByfuuSJHMeH7V5js=; b=aWbri8oFWimFKwzNLl8dD8A6uR8s9aQvkud0KLHl+/Mp6+B2kuy58ZTBrhHHdUKjH+ tovVX+rYex0P9grYA2a2NmrGbZR1eWcimwHjPO1xq9VOhMfhiLrOSOUQPwKi0xG6pEtE JHkbbcJ0tXIna0YENdEvm+7q19wmgvTL99xjxxzAcWy9GA3LDorOp5Ac84lNJGCb8q6v Hse+RYCFyYDUvmo5CR+Vy2EIrfvqu2mAyzL7WqXHigJFjEZDA4oQGIoSoV1kMftxGiN1 //HkC2b8mhyHwmrk/ufRQU165MsmG9sgL9y5gMjZgS+x1doMBIjMuKGVB0cbnAUrs7SB gL5w== 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=qEuJqEba5wd0EP42PfWTuZEN2nNByfuuSJHMeH7V5js=; b=jfSq9MAfghqX4oR/BHSUU2jE6nm+wDEisylAjv+JvY9EmJguZEhNVUvf9gqG6McfcX HUOj+OXWSE3PXZUUY+gNB+f+exv0uAEMNygcNpj5RGVuD/Mb/DhcaBAGpqi6mHAD7ZQd FspeOu6l+rwIdO0d8QW+PdsgSnJp3t6wsy2vurfQFVb1/C8Lh6BwyCeLB+QF/axQEm9/ S2i2M19hlfxPkfa3LDMF1Mv3w3cRfjtquIguY3E7xTYAkzZa2dm/Jz6XV1+rLDFznqzx 1XDHvjvz6XBjid1m4wGDF7MpKKPJ5zPFom01pxZt83JQMBvKJJkRnsJMzhYDzg5R0WHy cR0g== X-Gm-Message-State: APjAAAWw3uR8ZTr3L2xOMz4V1/zr2ikxyneZGwo0ArVDsxWl4kxPBw81 aIXaHe78uqfOy1XC6EHo+2S2Iu2pSWbstIbGB3Y= X-Received: by 2002:a2e:5d98:: with SMTP id v24mr34390435lje.56.1568490163906; Sat, 14 Sep 2019 12:42:43 -0700 (PDT) MIME-Version: 1.0 References: <529ec882-734f-17ae-e4cb-3aeb563ad1d5@bluespec.com> In-Reply-To: From: Charles Papon Date: Sat, 14 Sep 2019 21:42:32 +0200 Message-ID: Subject: Re: [PATCH] irqchip/sifive-plic: add irq_mask and irq_unmask To: Palmer Dabbelt Cc: Darius Rad , jason@lakedaemon.net, maz@kernel.org, linux-kernel , Paul Walmsley , linux-riscv , tglx@linutronix.de 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 I had issues with that plic driver. The current implementation wasn't usable with driver using level sensitive interrupt together with the IRQF_ONESHOT flag. Those null were producing crashes in the chained_irq_enter function. Filling them with dummy function fixed the issue. On Sat, Sep 14, 2019 at 9:00 PM Palmer Dabbelt wrote: > > On Thu, 12 Sep 2019 14:40:34 PDT (-0700), Darius Rad wrote: > > As per the existing comment, irq_mask and irq_unmask do not need > > to do anything for the PLIC. However, the functions must exist > > (the pointers cannot be NULL) as they are not optional, based on > > the documentation (Documentation/core-api/genericirq.rst) as well > > as existing usage (e.g., include/linux/irqchip/chained_irq.h). > > > > Signed-off-by: Darius Rad > > --- > > drivers/irqchip/irq-sifive-plic.c | 13 +++++++++---- > > 1 file changed, 9 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c > > index cf755964f2f8..52d5169f924f 100644 > > --- a/drivers/irqchip/irq-sifive-plic.c > > +++ b/drivers/irqchip/irq-sifive-plic.c > > @@ -111,6 +111,13 @@ static void plic_irq_disable(struct irq_data *d) > > plic_irq_toggle(cpu_possible_mask, d->hwirq, 0); > > } > > > > +/* > > + * There is no need to mask/unmask PLIC interrupts. They are "masked" > > + * by reading claim and "unmasked" when writing it back. > > + */ > > +static void plic_irq_mask(struct irq_data *d) { } > > +static void plic_irq_unmask(struct irq_data *d) { } > > + > > #ifdef CONFIG_SMP > > static int plic_set_affinity(struct irq_data *d, > > const struct cpumask *mask_val, bool force) > > @@ -138,12 +145,10 @@ static int plic_set_affinity(struct irq_data *d, > > > > static struct irq_chip plic_chip = { > > .name = "SiFive PLIC", > > - /* > > - * There is no need to mask/unmask PLIC interrupts. They are "masked" > > - * by reading claim and "unmasked" when writing it back. > > - */ > > .irq_enable = plic_irq_enable, > > .irq_disable = plic_irq_disable, > > + .irq_mask = plic_irq_mask, > > + .irq_unmask = plic_irq_unmask, > > #ifdef CONFIG_SMP > > .irq_set_affinity = plic_set_affinity, > > #endif > > I can't find any other drivers in irqchip with empty irq_mask/irq_unmask. I'm > not well versed in irqchip stuff, so I'll leave it up to the irqchip > maintainers to comment on if this is the right way to do this. Either way, I'm > assuming it'll go in through some the irqchip tree so > > Acked-by: Palmer Dabbelt > > just to make sure I don't get in the way if it is the right way to do it :). > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv