Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2233356pxp; Mon, 21 Mar 2022 14:31:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6D2QZJhZdTlKRHimAlyAtTzAbuKePZoFPyccKy243BLexd97+8hHKbT+AfsiCoB1aOMqz X-Received: by 2002:a17:902:c215:b0:14f:f1c2:9fe3 with SMTP id 21-20020a170902c21500b0014ff1c29fe3mr14736535pll.145.1647898289124; Mon, 21 Mar 2022 14:31:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647898289; cv=none; d=google.com; s=arc-20160816; b=FqLqzdLXWCp8O+ZQJERLRr6NfvZDxmwQo/NAAAWke5Y/H9e9De09WWof+7LURGEQTN nIXOYzpT8uRKdRPDvP3mBN1E4dKNVMK+wKnPVYFMjvFo2haGJX8scwVdgcUuz2JENaTO cIT3+ZXMTuWru4+HjpaqUace0A7WCIp5b9QXgttUWD9S/7uHT1dfJlkZduUQPrK4BttL 65jcOXbDs4+/0GW3EsvjhBOKKpbuJi+RJH7iDQrCfR9GpG7KySNAG5EAWbaK9N0CCqH6 QAZJ+6ia1HM+qvda4toavUG9xtCc0NxnHmcPUzmbgLjfo9iyIUnJtYAA1YzY6B+hwnjE rajg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=Tt65ZL8xhF4wrewSGkn1srAbuGS8NYTI48r/kHBjnA8=; b=HTxzH3HSt3fUrU3TZS2HFNinl4jcqLGXYloKULv7iQ0VPilleh1D9YfAiqKGd/nHqF kVaJD12EdF+ExX4BU5w1iKY7g1QUZTy1RalohMj9E4NH3v0K/GAUrwEe8dBX3XU0oD+g ARWvwIEfDBiREsIOOMxE5Q3qyC73y9I3tMqPDtyakqBBDhnhTEm2bmVsFiCrm0212kZd S8LrUWd6GLxJAvxaCea7RjAaMKFlwW3sFNY+O9zs+koN18x/VTTpZWd8B3SQxYPtdJ/S eXlFBaxcUGG9EBFdS8ItyydSNimRtw01YwIGP89z2XpLNp7PAVZBrXPV3NOLv2ea64hi 4DyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SQpEu1um; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=64lhmoy5; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 13-20020a630d4d000000b003816043f0c5si13982417pgn.698.2022.03.21.14.31.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 14:31:29 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SQpEu1um; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=64lhmoy5; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 71DDA217C6E; Mon, 21 Mar 2022 14:10:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345852AbiCUJVY (ORCPT + 99 others); Mon, 21 Mar 2022 05:21:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345841AbiCUJVV (ORCPT ); Mon, 21 Mar 2022 05:21:21 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDE74F4619; Mon, 21 Mar 2022 02:19:56 -0700 (PDT) Date: Mon, 21 Mar 2022 09:19:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1647854394; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Tt65ZL8xhF4wrewSGkn1srAbuGS8NYTI48r/kHBjnA8=; b=SQpEu1umeqqoYlZ8gyMziv4NTrmnD5LR8d3UDtkd9th72+JlDGssvMD2c/FJ+694006bVq cB5vmT2WToQUAPaSMaNk9UO9bNbM4U9xrRF1jBGYvwAOXdLUcsotWWw/x8Z3ofgET5W/// lug5MYus5+31w+UtrLKvSv1J94EN6000mZW1+g4Gu9NhH7RkadkRbnFesdUpRmT915hD/u aZkQFh9VbT1JMuNo+XhjYAXB5WpHyjGkqhOr7G09jxMhIwuUAQeCT2qZN92P0IwlGHzjoO R5r6XFeOUqiT4dALiZckfeTFhS8xs4hc1rwQOr6SBBdqRLcyDddhqAlEWI510Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1647854394; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Tt65ZL8xhF4wrewSGkn1srAbuGS8NYTI48r/kHBjnA8=; b=64lhmoy5uAAYItB0du58oe9UpuFF1fd06NTrYLQ3XFOcMxMR+YIC8lE7j1w51CZo9261Aa ek7zg52IEPq+5hBQ== From: "irqchip-bot for Marc Zyngier" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/gic-v3: Fix GICR_CTLR.RWP polling Cc: Marc Zyngier , stable@vger.kernel.org, Andre Przywara , Lorenzo Pieralisi , tglx@linutronix.de In-Reply-To: <20220315165034.794482-2-maz@kernel.org> References: <20220315165034.794482-2-maz@kernel.org> MIME-Version: 1.0 Message-ID: <164785439291.389.17030931008479432629.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: c114741827436ad1f1d465f3719f77b996ea6eca Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/c114741827436ad1f1d465f3719f77b996ea6eca Author: Marc Zyngier AuthorDate: Tue, 15 Mar 2022 16:50:32 Committer: Marc Zyngier CommitterDate: Mon, 21 Mar 2022 09:17:13 irqchip/gic-v3: Fix GICR_CTLR.RWP polling 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 Reviewed-by: Andre Przywara Reviewed-by: Lorenzo Pieralisi Link: https://lore.kernel.org/r/20220315165034.794482-2-maz@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 0efe1a9..9b63165 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