Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1616999pxp; Thu, 17 Mar 2022 12:49:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxb5r21Cv1mnFGKUxuqYW+sLe4HY7EF8aje6+gO0xWFaV2RppzY/hKTMpxkthjNNUm4U1eP X-Received: by 2002:a65:6050:0:b0:378:c9e5:b3ab with SMTP id a16-20020a656050000000b00378c9e5b3abmr5065982pgp.338.1647546565544; Thu, 17 Mar 2022 12:49:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647546565; cv=none; d=google.com; s=arc-20160816; b=sgQOTujPdCWbNG4ba8VIfZXYj6wku/1h5S2Az0P0987pnXq3BLgORBcaZ15yhGAWfK kYNqwcI45bfvixtVqDmc6BqWxwZq4sEoekSjCDr/Z7PKGELGCKIpSaPM2VIjBa3xRQdb zzSpsaQqVhPZOU52n1h21MHyDpirSrL002sbOyNnO8JcTu1oFdu70PRCXD0tQLi6jrrW LOBhaebDHToBenRv605u/dRsklkTA6umcxP9KRuA29f06crgZpDd54TELvQNM2ZB/DJP s9PrbcATwKHhcKqYDdr5L3RfYyGCCzIWtVLPmbvuXTDvBtl85co4ks0eIOYe9oPfY3zF 9e/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=vnhpVvpWx2GEcjIlQGQO7nOvgQ/vSYHQAFzoZqY9u9A=; b=BYYZfd8YbMmzYU0jPlIygZdCBYLoi5TDKOv6Y2g8XFqF7SpHrL0IIWv9NqDYwvqhYg 9e9waZ+mIATxjG3+ad+DWVWdTal1udrLIZPcrKY0GJLcDvGZ75tPZakNpsQ1W49uLF50 kAA1bAI5368PUuQkQLWZ8824D7GiAhkciSCim/N/Tx7J9aVHPyrLvQnCh1rWhoEZJmbV 7Tx56h/ICQqDTqhFc08wLPMRGDnqJ7Ot9jLjowCVo/T+WcQWtNxQFwcI0j1WLg6OjS95 +IUWPvjywsDgVHui3KUYthk5UGXWROCftVQgbxsOuvmjPsFf8UNRgcRE9uRajjNvDvMk Mz1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u2-20020a170902e5c200b00153b7fb14ccsi6110114plf.23.2022.03.17.12.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 12:49:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ADEA825A4B7; Thu, 17 Mar 2022 12:47:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236750AbiCQREz (ORCPT + 99 others); Thu, 17 Mar 2022 13:04:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231339AbiCQREx (ORCPT ); Thu, 17 Mar 2022 13:04:53 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 30DB2C3372; Thu, 17 Mar 2022 10:03:37 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E708F1682; Thu, 17 Mar 2022 10:03:36 -0700 (PDT) Received: from lpieralisi (unknown [10.57.40.134]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F0C5C3F7B4; Thu, 17 Mar 2022 10:03:35 -0700 (PDT) Date: Thu, 17 Mar 2022 17:03:31 +0000 From: Lorenzo Pieralisi To: Marc Zyngier Cc: linux-kernel@vger.kernel.org, Andre Przywara , Thomas Gleixner , Eric Auger , stable@vger.kernel.org Subject: Re: [PATCH 1/3] irqchip/gic-v3: Fix GICR_CTLR.RWP polling Message-ID: References: <20220315165034.794482-1-maz@kernel.org> <20220315165034.794482-2-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220315165034.794482-2-maz@kernel.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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 > Cc: stable@vger.kernel.org > --- > drivers/irqchip/irq-gic-v3.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Lorenzo Pieralisi > 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 >