From patchwork Fri Oct 6 22:15:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13412065 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2E30AE94133 for ; Fri, 6 Oct 2023 22:16:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=5/0L7rgWZrAm+2HwfgFkNivRME3Eb4vCNN0B3Pk/ydA=; b=yQiWnCoDMY+zu/ 9BxXVg4ksZAdvkTQ6pANVcOr/rGVqNA+7K6PhTqDHUWExC/BD8nSTavDsQnjTTw63XR40J2FysNtc r6u/dWH+TEp/MA7xo9KgXggEjceGAgnKwfL/WwASZdDeju2ZhhxvmD/euYqkKmpktbmv8jdoremZh BhWaTGR3LRaitQukavmr5WStEuQGr0y8Gqg9peCN1Nw+gD0ttZ5UThIBQHZ1v/ve3ujGoa2RRbx9c hL3JJ7hLMUjBWdcjvtptRzb0CQeIz12th8jj2hUiNe5bauR79Yy5nz1GIiwILn7cJdDgnc/m3+6gt Ygijhn/UmTM88namV6kQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qot7T-006Zo8-0Q; Fri, 06 Oct 2023 22:16:27 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qot7O-006ZmB-0C for linux-arm-kernel@lists.infradead.org; Fri, 06 Oct 2023 22:16:24 +0000 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-564b6276941so1914110a12.3 for ; Fri, 06 Oct 2023 15:16:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696630578; x=1697235378; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=0RzCHBb9WoSeOhmw11duqctRmWYwOtRpdu2I7EOG8ak=; b=Eg2W5c9nmwQA5V0h0O1TgjYO0jojKjvhgfuiiueshXumSbQKsEJ9+i5pLNQKBS0GgZ LovoDYS4U4/nEmeu2SyMCjLeasMd2zoiRDXGIho/vNylTPe8cawkawIE5M0rRUi/R1WU P0IE0mcGW6ZN9fzROTkF3VGF4HKSL7US0jdbA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696630578; x=1697235378; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0RzCHBb9WoSeOhmw11duqctRmWYwOtRpdu2I7EOG8ak=; b=t7b6i2e8R0/RvvbocmZPnS89AfczvripRu/v0vT6FlT/+dZ89DpL+HUiKqs6/4/XMq 3ea4ZgPQK2gqJymASUISKd66axZspAnlDvKxO63fBYW5WIJzNOSdkJtLcfIOIZbHxCXC 4xmd7w5UIHmx6WiEfldih6d+qU3lNndf98mLfKiGAOfK8Aq4fzL7crJTXM124VRMS0L4 Q78KnTk6Pk0fknr4E6ifiZp4oZ83zxS03QL5KlNixwmycyMjdxi64Q8cBoUMdEiLdTVM 6K2VnuPIW9EvdB+kN0lLPqmv1ZVxYFa1ju822LIM7JJAxTg+ZZ0IzydYlMc65j99w2RA HrGw== X-Gm-Message-State: AOJu0YzXVJpa1vRa0LRFzSstutgu7URtBlsdbnZc64NA/S+0Ogfih8Wc oP464W93pIL9MCtJpLfRGxRC1w== X-Google-Smtp-Source: AGHT+IHF+LblYJeVzXRHb4Z5bbsiKZ6oGjIBxOn4gbb3wXUJcmjP+I9SQqkZQJ0WyiuqATULZb/vbA== X-Received: by 2002:a17:90a:f3c4:b0:277:4057:b752 with SMTP id ha4-20020a17090af3c400b002774057b752mr9638126pjb.46.1696630578523; Fri, 06 Oct 2023 15:16:18 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:1f37:5459:32bf:faf9]) by smtp.gmail.com with ESMTPSA id rj6-20020a17090b3e8600b00276e8e4f1fbsm5946523pjb.1.2023.10.06.15.16.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 15:16:17 -0700 (PDT) From: Douglas Anderson To: Marc Zyngier , Mark Rutland , Catalin Marinas , Will Deacon , Chen-Yu Tsai Cc: Douglas Anderson , Amit Daniel Kachhap , AngeloGioacchino Del Regno , James Morse , Joey Gouly , Mark Brown , Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 1/3] arm64: Disable GiC priorities on Mediatek devices w/ firmware issues Date: Fri, 6 Oct 2023 15:15:51 -0700 Message-ID: <20231006151547.1.Ide945748593cffd8ff0feb9ae22b795935b944d6@changeid> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231006_151622_125854_01CABAA9 X-CRM114-Status: GOOD ( 18.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Signed-off-by: Douglas Anderson --- arch/arm64/kernel/cpufeature.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 2806a2850e78..e35efab8efa9 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -2094,9 +2094,30 @@ static int __init early_enable_pseudo_nmi(char *p) } early_param("irqchip.gicv3_pseudo_nmi", early_enable_pseudo_nmi); +static bool are_gic_priorities_broken(void) +{ + bool is_broken = false; + struct device_node *np; + + /* + * Detect broken Mediatek firmware that doesn't properly save and + * restore GIC priorities. + */ + np = of_find_compatible_node(NULL, NULL, "arm,gic-v3"); + if (np) { + is_broken = of_property_read_bool(np, "mediatek,broken-save-restore-fw"); + of_node_put(np); + } + + return is_broken; +} + static bool can_use_gic_priorities(const struct arm64_cpu_capabilities *entry, int scope) { + if (are_gic_priorities_broken()) + return false; + /* * ARM64_HAS_GIC_CPUIF_SYSREGS has a lower index, and is a boot CPU * feature, so will be detected earlier. From patchwork Fri Oct 6 22:15:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13412066 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 51800E94133 for ; Fri, 6 Oct 2023 22:16:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+s4K0f14VTlUrRB0VbJqtTtKOqfj+fXpQK364dI1t8M=; b=CmNqCndg+7VN+S EfeS6V6abm4uvsrPykMwByd1hLMJKUF5eeKidSbO1Yiju7WNiHpmbIBWgW3ax/RHOft4wNcBti6D5 5nnS7QIvm17utUGS88YzA9MlIXQ/Oq2ydInlSDQdBh/W9v/H0mno8r8HriJRLgNd9ckeU5tl0/d2z QMKTKaOM/aTBOCDi5qFx+LNvCFSpQthEKd+74LTm/9JhuGdNwYPEhvldHX6Gs9ktwhgA4zwcZJ2h2 m2oUhe6elsM7jKeGjkVHuCj4RHrLMgifxtps9zdbCPqTmEQz7Mc0BebHj8+HgXDQhDw3cQk00PEjB hYpGoBNBA0KINQgYvenA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qot7U-006ZpP-1w; Fri, 06 Oct 2023 22:16:28 +0000 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qot7R-006ZmJ-0k for linux-arm-kernel@lists.infradead.org; Fri, 06 Oct 2023 22:16:26 +0000 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-54290603887so1881267a12.1 for ; Fri, 06 Oct 2023 15:16:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696630580; x=1697235380; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wCChOiC5+OCDlbLLrEgPwNPe/HtuhSm+x2PIj6YN8Og=; b=lUcv8hehRivexKvegHhBauNr9+IFYeNh0qSgcNOztT0kHeQ5+XMWJrQ+VeDMGXyuqD nr045p+7zOMQ8MZ2dUOrdznUuUHterT3robIO6wkZgDkWrI9RvS754o1kVoIAvuDymwl pPPEa3VxwTRILRkP7gsJxjnUdiqnP3VR9xRyc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696630580; x=1697235380; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wCChOiC5+OCDlbLLrEgPwNPe/HtuhSm+x2PIj6YN8Og=; b=gll9je1Ydkc98OmyogJmXoyE8/W1f6FsZt+KxtxbM2P/9zGgKmiqgj1wGBLNZH9COc Ai2tOtB9hJSHnFlVCA3fJbxbOiu97nkJIyM0XL0CYsRWunWt1GmCBt/8Fw1Tpv2OQofe LqQBcm8r8crKACAWwpJhsngMfuCV5HwRf+e8YjGDCelV+tzffxAHzONJes5Lwsvp922u 3B9roJDJlc5yJj/S0sGF6p8qoWztQ2k4TydkOpuVuxCSosyvuev2WXaEaQe6hMuVpV9J mNSZtY+/nhMdltL/gfyvZ8gwm5Cg9dKjxSJl+GB2YW9ekW+sX017E69cEoXxjtXhNb5L XggQ== X-Gm-Message-State: AOJu0YwzAWDheEVEp1dR9Uag5AIGtq8WT4lFF26+kY4SVELLKyHd971F 7yFicFo84kgyaXNwN+1Ls9js6w== X-Google-Smtp-Source: AGHT+IHKwJcVCOzr02nXWYBfeXvpup+ZejkzGxyBBUXwkHWHzNfLIWK/MnuToROxrwttI3fLYLoUug== X-Received: by 2002:a17:90b:224d:b0:274:566a:3477 with SMTP id hk13-20020a17090b224d00b00274566a3477mr9047899pjb.39.1696630580472; Fri, 06 Oct 2023 15:16:20 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:1f37:5459:32bf:faf9]) by smtp.gmail.com with ESMTPSA id rj6-20020a17090b3e8600b00276e8e4f1fbsm5946523pjb.1.2023.10.06.15.16.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 15:16:19 -0700 (PDT) From: Douglas Anderson To: Marc Zyngier , Mark Rutland , Catalin Marinas , Will Deacon , Chen-Yu Tsai Cc: Douglas Anderson , D Scott Phillips , Josh Poimboeuf , Peter Zijlstra , Stephen Boyd , Thomas Gleixner , Valentin Schneider , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] Revert "arm64: smp: avoid NMI IPIs with broken MediaTek FW" Date: Fri, 6 Oct 2023 15:15:52 -0700 Message-ID: <20231006151547.2.I2c5fa192e767eb3ee233bc28eb60e2f8656c29a6@changeid> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231006151547.1.Ide945748593cffd8ff0feb9ae22b795935b944d6@changeid> References: <20231006151547.1.Ide945748593cffd8ff0feb9ae22b795935b944d6@changeid> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231006_151625_270101_FA68FF6B X-CRM114-Status: GOOD ( 14.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This reverts commit a07a594152173a3dd3bdd12fc7d73dbba54cdbca. This is no longer needed after the patch ("arm64: Disable GiC priorities on Mediatek devices w/ firmware issues"). Signed-off-by: Douglas Anderson Acked-by: Mark Rutland --- arch/arm64/kernel/smp.c | 5 +---- drivers/irqchip/irq-gic-v3.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 16ead57a583d..f36a97a54d2b 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -964,10 +964,7 @@ static void smp_cross_call(const struct cpumask *target, unsigned int ipinr) static bool ipi_should_be_nmi(enum ipi_msg_type ipi) { - DECLARE_STATIC_KEY_FALSE(supports_pseudo_nmis); - - if (!system_uses_irq_prio_masking() || - !static_branch_likely(&supports_pseudo_nmis)) + if (!system_uses_irq_prio_masking()) return false; switch (ipi) { diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 737da1b9aabf..787ccc880b22 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -106,7 +106,7 @@ static DEFINE_STATIC_KEY_TRUE(supports_deactivate_key); * - Figure 4-7 Secure read of the priority field for a Non-secure Group 1 * interrupt. */ -DEFINE_STATIC_KEY_FALSE(supports_pseudo_nmis); +static DEFINE_STATIC_KEY_FALSE(supports_pseudo_nmis); DEFINE_STATIC_KEY_FALSE(gic_nonsecure_priorities); EXPORT_SYMBOL(gic_nonsecure_priorities); From patchwork Fri Oct 6 22:15:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13412067 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3DC04E94135 for ; Fri, 6 Oct 2023 22:16:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KiKCw/d/tfDTCqhiULCPAgUPKtiQY6nbcnr/aZoEq84=; b=0oCVLRplSSGJ5w D86h7tcLpVQk5l6MPQFM9ONHfYOS1WLgd1mT3vcLZZIp7885QdG0Kc5keMiDp2Xp56wUycvUt2lgM pzM29ydjnKwI1ngtSHugUlMFSZnhsPPIPsuH2pOSwXhG+yHWWsg8VR3HogyQt1PVNe4s/KZY3+iyD 7/c24D3qT7ZqA1Do60nnoWgHAGCXktYxanQrG/0Sp/6oquOlkRAwARDe82zWnFtjwmQXeIdUqBsPh Osd7RE4AoTr7oOLi9cvFEuXnejL/sgrpqJGRjE9qq/VOHMU3HFt4TLzrnTofsPJU1MYavJ3ggTLdb qwX7gKIBPk1s2t5glWOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qot7Y-006ZrC-37; Fri, 06 Oct 2023 22:16:32 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qot7T-006Zmq-1F for linux-arm-kernel@lists.infradead.org; Fri, 06 Oct 2023 22:16:28 +0000 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-277504a23a1so2065518a91.0 for ; Fri, 06 Oct 2023 15:16:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696630582; x=1697235382; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mKHn8MHAksMieZVNplmzQ9td3WQY/zTB+/6WLDFqzoc=; b=fscSDqqyAZgY6b/zgMJgeqovbMbynHUuPe68fS3HGoqIHM1c/QWgYxFNdb5R1Dx+jH U4H8BVj/gtZybWxYhCvFGXkJxYTWA+mh8qvnqRFR7uwqNXvwQBK+vEbkVHgal7jFi5pA rkGOKn4sMwLAMAciAkVV7Mb56TiZYMa82+BQQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696630582; x=1697235382; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mKHn8MHAksMieZVNplmzQ9td3WQY/zTB+/6WLDFqzoc=; b=YmfUGP2+KlQvAodtrxWk9eB4taszwWAPqwH3dFx1ewi8bEBxQKI9n5OFFrY1OHF9p7 gYABFL8TZZGJ5GxBE9TFnQ/+X1aSXX4GuL0RiTtqe1629or0eBAcAI9ZnSVtM3iFJGjb DkppGwO8Qd2jorgCOEVmYKT4I5llyf45QYt20T3Z2REM2RfHZ+a5F26h2LV1FAFOsbSh GSaJBTgZ2t526B5SzOlMTzhiAnhnOpAa8p2XIS1pVXz28WK4fJJlHwnyCA7rkJB0fkfU bSp4YgL87bibKVERw3y7sbyhAhqb6j0jFEz9b2ByfAbjrkdaiu/2ep9LRgA7p8YgBdJO NXTQ== X-Gm-Message-State: AOJu0Yz5KyMjJ7S+yQ8ukP2r5cK42APIJDadGViNwvyW/U98vdLpdi1L 4fujpL6mSFqariGHMYRz1tonaw== X-Google-Smtp-Source: AGHT+IFtVb4aW+OND3UEg2HZFIAKdVlqCxraW/RlbV8GK+Xlw6U93GKGB3E+X4qacvY9EjVOr1BC8g== X-Received: by 2002:a17:90b:3907:b0:276:5512:13ab with SMTP id ob7-20020a17090b390700b00276551213abmr8650294pjb.10.1696630582413; Fri, 06 Oct 2023 15:16:22 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:1f37:5459:32bf:faf9]) by smtp.gmail.com with ESMTPSA id rj6-20020a17090b3e8600b00276e8e4f1fbsm5946523pjb.1.2023.10.06.15.16.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 15:16:21 -0700 (PDT) From: Douglas Anderson To: Marc Zyngier , Mark Rutland , Catalin Marinas , Will Deacon , Chen-Yu Tsai Cc: Douglas Anderson , AngeloGioacchino Del Regno , Matthias Brugger , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 3/3] irqchip/gic-v3: Remove Mediatek pseudo-NMI firmware quirk handling Date: Fri, 6 Oct 2023 15:15:53 -0700 Message-ID: <20231006151547.3.Ie582d33cfe46f9ec2248e7f2dabdd6bbd66486a6@changeid> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231006151547.1.Ide945748593cffd8ff0feb9ae22b795935b944d6@changeid> References: <20231006151547.1.Ide945748593cffd8ff0feb9ae22b795935b944d6@changeid> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231006_151627_430754_FC62E384 X-CRM114-Status: GOOD ( 14.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is a partial revert of commit 44bd78dd2b88 ("irqchip/gic-v3: Disable pseudo NMIs on Mediatek devices w/ firmware issues"). In the patch ("arm64: Disable GiC priorities on Mediatek devices w/ firmware issues") we've moved the quirk handling to another place and so it's not needed in the GiC driver. NOTE: this isn't a full revert because it leaves some of the changes to the "quirks" structure around in case future code needs it. Signed-off-by: Douglas Anderson Acked-by: Mark Rutland --- drivers/irqchip/irq-gic-v3.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 787ccc880b22..9ff776709ae6 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -39,8 +39,7 @@ #define FLAGS_WORKAROUND_GICR_WAKER_MSM8996 (1ULL << 0) #define FLAGS_WORKAROUND_CAVIUM_ERRATUM_38539 (1ULL << 1) -#define FLAGS_WORKAROUND_MTK_GICR_SAVE (1ULL << 2) -#define FLAGS_WORKAROUND_ASR_ERRATUM_8601001 (1ULL << 3) +#define FLAGS_WORKAROUND_ASR_ERRATUM_8601001 (1ULL << 2) #define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1) @@ -1790,15 +1789,6 @@ static bool gic_enable_quirk_msm8996(void *data) return true; } -static bool gic_enable_quirk_mtk_gicr(void *data) -{ - struct gic_chip_data *d = data; - - d->flags |= FLAGS_WORKAROUND_MTK_GICR_SAVE; - - return true; -} - static bool gic_enable_quirk_cavium_38539(void *data) { struct gic_chip_data *d = data; @@ -1891,11 +1881,6 @@ static const struct gic_quirk gic_quirks[] = { .compatible = "asr,asr8601-gic-v3", .init = gic_enable_quirk_asr8601, }, - { - .desc = "GICv3: Mediatek Chromebook GICR save problem", - .property = "mediatek,broken-save-restore-fw", - .init = gic_enable_quirk_mtk_gicr, - }, { .desc = "GICv3: HIP06 erratum 161010803", .iidr = 0x0204043b, @@ -1957,11 +1942,6 @@ static void gic_enable_nmi_support(void) if (!gic_prio_masking_enabled()) return; - if (gic_data.flags & FLAGS_WORKAROUND_MTK_GICR_SAVE) { - pr_warn("Skipping NMI enable due to firmware issues\n"); - return; - } - rdist_nmi_refs = kcalloc(gic_data.ppi_nr + SGI_NR, sizeof(*rdist_nmi_refs), GFP_KERNEL); if (!rdist_nmi_refs)