lkml.org 
[lkml]   [2022]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/3] irqchip/gic-v3: Fix GICR_CTLR.RWP polling
    Date
    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(-)

    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
    \
     
     \ /
      Last update: 2022-09-17 16:17    [W:2.852 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site