From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFEFCC4332F for ; Tue, 7 Nov 2023 16:06:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235558AbjKGQGX (ORCPT ); Tue, 7 Nov 2023 11:06:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235523AbjKGQGF (ORCPT ); Tue, 7 Nov 2023 11:06:05 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E614855AD for ; Tue, 7 Nov 2023 07:57:08 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 818CFC433C9; Tue, 7 Nov 2023 15:57:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699372628; bh=JY60Lx5ZvGXboVH+s2MR9Ye3RuI2c9Q7hwNs+uhiPf8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HsvPjn9rl1D3gxOxWU03YB+Z9Qf3ye5PKtE6TceSmX6XNY3pNr1shquC3d2iQruKS kdYX6dpSGkhCXjpEq55veRve1ASe1wmGf7eK3tac+xg9KRDfJiPm/4P6mvB0SI2xfp fivSC0dZFyqthKJ57w7+fRSH6+toerlJdK87mygd2zI0mpb8nohhnkXceBj2e/buW3 x1OOBXQ+wmVaZOGR9Vh5MuZbMwXr8kPC6jvcppNS7TWvbMI0pk8jE/ttrW5F+jNfIE dfd6L54sJx1UPByyupwP7WFTWiXImpw8L0ajrOiSzDRhJ15oP6n78/W1q/6Tdy2WVx t5po7FMeN29iw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1r0ORt-00BB5G-Ri; Tue, 07 Nov 2023 15:57:06 +0000 Date: Tue, 07 Nov 2023 15:57:05 +0000 Message-ID: <86cywl1rqm.wl-maz@kernel.org> From: Marc Zyngier To: Douglas Anderson Cc: Mark Rutland , Catalin Marinas , Will Deacon , Chen-Yu Tsai , Amit Daniel Kachhap , AngeloGioacchino Del Regno , James Morse , Joey Gouly , Mark Brown , Matthias Brugger , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH v2 1/2] arm64: Move Mediatek GIC quirk handling from irqchip to core In-Reply-To: <20231107072651.v2.1.Ide945748593cffd8ff0feb9ae22b795935b944d6@changeid> References: <20231107072651.v2.1.Ide945748593cffd8ff0feb9ae22b795935b944d6@changeid> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: dianders@chromium.org, mark.rutland@arm.com, catalin.marinas@arm.com, will@kernel.org, wenst@chromium.org, amit.kachhap@arm.com, angelogioacchino.delregno@collabora.com, james.morse@arm.com, joey.gouly@arm.com, broonie@kernel.org, matthias.bgg@gmail.com, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 07 Nov 2023 15:26:56 +0000, Douglas Anderson wrote: > > In commit 44bd78dd2b88 ("irqchip/gic-v3: Disable pseudo NMIs on > Mediatek devices w/ firmware issues") we added a method for detecting > Mediatek devices with broken firmware and disabled pseudo-NMI. While > that worked, it didn't address the problem at a deep enough level. > > The fundamental issue with this broken firmware is that it's not > saving and restoring several important GICR registers. The current > list is believed to be: > * GICR_NUM_IPRIORITYR > * GICR_CTLR > * GICR_ISPENDR0 > * GICR_ISACTIVER0 > * GICR_NSACR > > Pseudo-NMI didn't work because it was the only thing (currently) in > the kernel that relied on the broken registers, so forcing pseudo-NMI > off was an effective fix. However, it could be observed that calling > system_uses_irq_prio_masking() on these systems still returned > "true". That caused confusion and led to the need for > commit a07a59415217 ("arm64: smp: avoid NMI IPIs with broken MediaTek > FW"). It's worried that the incorrect value returned by > system_uses_irq_prio_masking() on these systems will continue to > confuse future developers. > > Let's fix the issue a little more completely by disabling IRQ > priorities at a deeper level in the kernel. Once we do this we can > revert some of the other bits of code dealing with this quirk. > > This includes a partial revert of commit 44bd78dd2b88 > ("irqchip/gic-v3: Disable pseudo NMIs on Mediatek devices w/ firmware > issues"). This isn't a full revert because it leaves some of the > changes to the "quirks" structure around in case future code needs it. > > Suggested-by: Mark Rutland > Signed-off-by: Douglas Anderson Acked-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.