From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Marc Zyngier <maz@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Andre Przywara <andre.przywara@arm.com>,
Thomas Gleixner <tglx@linutronix.de>,
Eric Auger <eric.auger@redhat.com>,
stable@vger.kernel.org
Subject: Re: [PATCH 1/3] irqchip/gic-v3: Fix GICR_CTLR.RWP polling
Date: Thu, 17 Mar 2022 17:03:31 +0000 [thread overview]
Message-ID: <YjNp4wzdGM3y2Rji@lpieralisi> (raw)
In-Reply-To: <20220315165034.794482-2-maz@kernel.org>
On Tue, Mar 15, 2022 at 04:50:32PM +0000, Marc Zyngier wrote:
> It turns out that our polling of RWP is totally wrong when checking
> for it in the redistributors, as we test the *distributor* bit index,
> whereas it is a different bit number in the RDs... Oopsie boo.
>
> This is embarassing. Not only because it is wrong, but also because
> it took *8 years* to notice the blunder...
>
> Just fix the damn thing.
>
> Fixes: 021f653791ad ("irqchip: gic-v3: Initial support for GICv3")
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> Cc: stable@vger.kernel.org
> ---
> drivers/irqchip/irq-gic-v3.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> index 5e935d97207d..736163d36b13 100644
> --- a/drivers/irqchip/irq-gic-v3.c
> +++ b/drivers/irqchip/irq-gic-v3.c
> @@ -206,11 +206,11 @@ static inline void __iomem *gic_dist_base(struct irq_data *d)
> }
> }
>
> -static void gic_do_wait_for_rwp(void __iomem *base)
> +static void gic_do_wait_for_rwp(void __iomem *base, u32 bit)
> {
> u32 count = 1000000; /* 1s! */
>
> - while (readl_relaxed(base + GICD_CTLR) & GICD_CTLR_RWP) {
> + while (readl_relaxed(base + GICD_CTLR) & bit) {
> count--;
> if (!count) {
> pr_err_ratelimited("RWP timeout, gone fishing\n");
> @@ -224,13 +224,13 @@ static void gic_do_wait_for_rwp(void __iomem *base)
> /* Wait for completion of a distributor change */
> static void gic_dist_wait_for_rwp(void)
> {
> - gic_do_wait_for_rwp(gic_data.dist_base);
> + gic_do_wait_for_rwp(gic_data.dist_base, GICD_CTLR_RWP);
> }
>
> /* Wait for completion of a redistributor change */
> static void gic_redist_wait_for_rwp(void)
> {
> - gic_do_wait_for_rwp(gic_data_rdist_rd_base());
> + gic_do_wait_for_rwp(gic_data_rdist_rd_base(), GICR_CTLR_RWP);
> }
>
> #ifdef CONFIG_ARM64
> --
> 2.34.1
>
next prev parent reply other threads:[~2022-03-17 17:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220315165034.794482-1-maz@kernel.org>
2022-03-15 16:50 ` [PATCH 1/3] irqchip/gic-v3: Fix GICR_CTLR.RWP polling Marc Zyngier
2022-03-16 14:51 ` Andre Przywara
2022-03-16 15:19 ` Marc Zyngier
2022-03-17 17:03 ` Lorenzo Pieralisi [this message]
2022-03-21 9:19 ` [irqchip: irq/irqchip-next] " irqchip-bot for Marc Zyngier
2022-03-21 14:07 ` irqchip-bot for Marc Zyngier
2022-04-05 15:39 ` [irqchip: irq/irqchip-fixes] " irqchip-bot for Marc Zyngier
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=YjNp4wzdGM3y2Rji@lpieralisi \
--to=lorenzo.pieralisi@arm.com \
--cc=andre.przywara@arm.com \
--cc=eric.auger@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=stable@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).