All of lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
To: linux-riscv@lists.infradead.org
Subject: [PATCH 7/9] irqchip: add a RISC-V PLIC driver
Date: Tue, 31 Jul 2018 18:37:41 +0200	[thread overview]
Message-ID: <20180731163741.GA2359@lst.de> (raw)
In-Reply-To: <1b3f6066-0c7c-a5f5-75ad-559fe81091ee@wdc.com>

On Fri, Jul 27, 2018 at 05:04:52PM -0700, Atish Patra wrote:
>> +#define MAX_DEVICES			1024
>> +#define MAX_CONTEXTS			15872
>> +
>
> Is there any way we can preserve some of the comments in the original patch 
> about memory-mapped control registers or at least a reference where to find 
> the register offset calculations?

The comments really do not help to describe a why or how.  I'd love to
add a reference to a spec, but I could not find anything that looks
like an authoritative spec for the SiFive PLIC layout.

>> +	u32 __iomem *reg = plic_regs + ENABLE_BASE + ctxid * ENABLE_PER_HART;
>
> shouldn't it be
> u32 __iomem *reg = plic_regs + ENABLE_BASE + ctxid * ENABLE_PER_HART + 
> (hwirq / 32) * 4;

Yes, it should.  Fixed.

>> +		if (unlikely(irq <= 0)) {
>> +			pr_warn_ratelimited("can't find mapping for hwirq %lu\n",
>> +					hwirq);
>
> Ratlimiting the warning message here didn't help as ack_bad_irq() still 
> print message still flooded the console without any useful info.

I've dropped the somewhat pointless ack_bad_irq call, thanks.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Atish Patra <atish.patra@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"palmer@sifive.com" <palmer@sifive.com>,
	"jason@lakedaemon.net" <jason@lakedaemon.net>,
	"marc.zyngier@arm.com" <marc.zyngier@arm.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"anup@brainfault.org" <anup@brainfault.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"aou@eecs.berkeley.edu" <aou@eecs.berkeley.edu>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>,
	"shorne@gmail.com" <shorne@gmail.com>
Subject: Re: [PATCH 7/9] irqchip: add a RISC-V PLIC driver
Date: Tue, 31 Jul 2018 18:37:41 +0200	[thread overview]
Message-ID: <20180731163741.GA2359@lst.de> (raw)
In-Reply-To: <1b3f6066-0c7c-a5f5-75ad-559fe81091ee@wdc.com>

On Fri, Jul 27, 2018 at 05:04:52PM -0700, Atish Patra wrote:
>> +#define MAX_DEVICES			1024
>> +#define MAX_CONTEXTS			15872
>> +
>
> Is there any way we can preserve some of the comments in the original patch 
> about memory-mapped control registers or at least a reference where to find 
> the register offset calculations?

The comments really do not help to describe a why or how.  I'd love to
add a reference to a spec, but I could not find anything that looks
like an authoritative spec for the SiFive PLIC layout.

>> +	u32 __iomem *reg = plic_regs + ENABLE_BASE + ctxid * ENABLE_PER_HART;
>
> shouldn't it be
> u32 __iomem *reg = plic_regs + ENABLE_BASE + ctxid * ENABLE_PER_HART + 
> (hwirq / 32) * 4;

Yes, it should.  Fixed.

>> +		if (unlikely(irq <= 0)) {
>> +			pr_warn_ratelimited("can't find mapping for hwirq %lu\n",
>> +					hwirq);
>
> Ratlimiting the warning message here didn't help as ack_bad_irq() still 
> print message still flooded the console without any useful info.

I've dropped the somewhat pointless ack_bad_irq call, thanks.

  parent reply	other threads:[~2018-07-31 16:37 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26 14:37 RFC: simplified RISC-V interrupt and clocksource handling Christoph Hellwig
2018-07-26 14:37 ` Christoph Hellwig
2018-07-26 14:37 ` Christoph Hellwig
2018-07-26 14:37 ` [PATCH 1/9] RISC-V: remove timer leftovers Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-07-26 14:37 ` [PATCH 2/9] RISC-V: simplify software interrupt / IPI code Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-07-26 14:37 ` [PATCH 3/9] RISC-V: remove INTERRUPT_CAUSE_* defines from asm/irq.h Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-07-26 14:37 ` [PATCH 4/9] RISC-V: add a definition for the SIE SEIE bit Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-07-26 14:37 ` [PATCH 5/9] RISC-V: implement low-level interrupt handling Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-08-02  9:48   ` Thomas Gleixner
2018-08-02  9:48     ` Thomas Gleixner
2018-08-02  9:59     ` Christoph Hellwig
2018-08-02  9:59       ` Christoph Hellwig
2018-07-26 14:37 ` [PATCH 6/9] RISC-V: Support per-hart timebase-frequency Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-07-26 14:37 ` [PATCH 7/9] irqchip: add a RISC-V PLIC driver Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-07-28  0:04   ` Atish Patra
2018-07-28  0:04     ` Atish Patra
2018-07-30 15:51     ` Anup Patel
2018-07-30 15:51       ` Anup Patel
2018-07-31  3:21     ` Atish Patra
2018-07-31  3:21       ` Atish Patra
2018-07-31  3:21       ` Atish Patra
2018-07-31 16:57       ` Christoph Hellwig
2018-07-31 16:57         ` Christoph Hellwig
2018-08-01  0:38         ` Atish Patra
2018-08-01  0:38           ` Atish Patra
2018-08-01  0:38           ` Atish Patra
2018-08-01  7:14           ` Christoph Hellwig
2018-08-01  7:14             ` Christoph Hellwig
2018-08-01 12:16           ` Christoph Hellwig
2018-08-01 12:16             ` Christoph Hellwig
2018-08-02  1:09             ` Atish Patra
2018-08-02  1:09               ` Atish Patra
2018-08-02  9:53               ` Christoph Hellwig
2018-08-02  9:53                 ` Christoph Hellwig
2018-08-01 14:18           ` Christoph Hellwig
2018-08-01 14:18             ` Christoph Hellwig
2018-08-02  1:02             ` Atish Patra
2018-08-02  1:02               ` Atish Patra
2018-08-02  9:50               ` Christoph Hellwig
2018-08-02  9:50                 ` Christoph Hellwig
2018-07-31 16:37     ` Christoph Hellwig [this message]
2018-07-31 16:37       ` Christoph Hellwig
2018-08-02 10:04   ` Thomas Gleixner
2018-08-02 10:04     ` Thomas Gleixner
2018-08-02 11:51     ` Christoph Hellwig
2018-08-02 11:51       ` Christoph Hellwig
2018-07-26 14:37 ` [PATCH 8/9] dt-bindings: interrupt-controller: RISC-V PLIC documentation Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-08-02  7:24   ` Nikolay Borisov
2018-08-02  7:24     ` Nikolay Borisov
2018-08-02  9:52     ` Christoph Hellwig
2018-08-02  9:52       ` Christoph Hellwig
2018-07-26 14:37 ` [PATCH 9/9] clocksource: new RISC-V SBI timer driver Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-07-26 14:37   ` Christoph Hellwig
2018-07-26 18:51   ` Atish Patra
2018-07-26 18:51     ` Atish Patra
2018-07-27 14:41     ` Christoph Hellwig
2018-07-27 14:41       ` Christoph Hellwig
2018-07-27 17:44       ` Atish Patra
2018-07-27 17:44         ` Atish Patra
2018-07-28 21:12   ` kbuild test robot
2018-07-28 21:12     ` kbuild test robot
2018-07-28 21:16   ` kbuild test robot
2018-07-28 21:16     ` kbuild test robot
2018-07-26 23:38 ` RFC: simplified RISC-V interrupt and clocksource handling Atish Patra
2018-07-26 23:38   ` Atish Patra
2018-07-27 14:44   ` Christoph Hellwig
2018-07-27 14:44     ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180731163741.GA2359@lst.de \
    --to=hch@lst.de \
    --cc=linux-riscv@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.