public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Samuel Holland <samuel.holland@sifive.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Samuel Holland <samuel@sholland.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: Re: [PATCH] irqchip/sifive-plic: Avoid clearing the per-hart enable bits
Date: Tue, 18 Jul 2023 10:26:37 +0100	[thread overview]
Message-ID: <86zg3ttvsi.wl-maz@kernel.org> (raw)
In-Reply-To: <20230717185841.1294425-1-samuel.holland@sifive.com>

On Mon, 17 Jul 2023 19:58:40 +0100,
Samuel Holland <samuel.holland@sifive.com> wrote:
> 
> Writes to the PLIC completion register are ignored if the enable bit for
> that (interrupt, hart) combination is cleared. This leaves the interrupt
> in a claimed state, preventing it from being triggered again.
> 
> Originally, the enable bit was cleared in the .irq_mask operation, and
> commit 69ea463021be ("irqchip/sifive-plic: Fixup EOI failed when masked")
> added a workaround for this issue. Later, commit a1706a1c5062
> ("irqchip/sifive-plic: Separate the enable and mask operations") moved
> toggling the enable bit to the .irq_enable/.irq_disable operations and
> removed the workaround.
> 
> However, there are still places where .irq_disable can be called from
> inside the hard IRQ handler, for example in irq_pm_check_wakeup(). As a
> result, this issue causes an interrupt to get stuck in a claimed state
> after being used to wake the system from s2idle.
> 
> There is no real benefit to implementing the .irq_enable/.irq_disable
> operations using the enable bits. In fact, the existing mask/unmask
> implementation using the threshold register is already more efficient,
> as it requires no read/modify/write cycles. So let's leave the enable
> bits set for the lifetime of the IRQ, using them only to control its
> affinity.

Side question, which doesn't affect this patch: what happens with
interrupts that are firing while the interrupt is in a disabled state?
It's fine for levels, but what of edge interrupts?

My reading of the spec is that it is the role of the "gateway" to hold
the signal, and that this is upstream of the PLIC itself, so it
*should* be fine, but I'd like confirmation on that.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2023-07-18  9:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 18:58 [PATCH] irqchip/sifive-plic: Avoid clearing the per-hart enable bits Samuel Holland
2023-07-18  9:26 ` Marc Zyngier [this message]
2023-09-20 10:18   ` Palmer Dabbelt

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=86zg3ttvsi.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=samuel.holland@sifive.com \
    --cc=samuel@sholland.org \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox