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: 149438 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp624923vqo; Fri, 6 Oct 2023 15:17:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEV8YGFGAty0y8a/Hi1C9j7w3E+dB/QllwsWS4EQnnFdjXsHyt6Pa2zfMGpSzi4UTVLmXri X-Received: by 2002:a17:902:c60a:b0:1c7:43b0:e443 with SMTP id r10-20020a170902c60a00b001c743b0e443mr8281026plr.34.1696630636167; Fri, 06 Oct 2023 15:17:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696630636; cv=none; d=google.com; s=arc-20160816; b=htyTJQqkyTVNqjouN9tWEAgVAmGD+tdUTlNgyvnJEMCshDlfcL717XoS7894OvTdbS eGlY4d3NKO5J7ndTEmv3Nqsb5wTwG1OrFoET/hdCrafLm51dCNeFhB868Wi3iHcvxliC r9j+UVDQoh32ksdGVc4zdW/5H2zHn15kiq3Le9PQctLB2GJEo+8l3xO1xvWoJdQG+E3S RqvmYCrRhe4Xc3EqLWpRIaJE0gWry4iFhavy/Y4I3DaEVZiL8a/ReZO3dT47SLvF3OLo CKuKncS5ZLDv9NNEfc/YpJ8Ya0/ONK1rCmpABVCLLytMK75rJmwEVP5tbflCR3tqZ5ot ggqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=0RzCHBb9WoSeOhmw11duqctRmWYwOtRpdu2I7EOG8ak=; fh=/IjO9ZFzuShnc5Uh+7dwdZ76/2kcU09j4bOAxY1v+eQ=; b=iuEEqM+Fik+D01X8Qq7A5C+4J6/nybAukjtIFnh9me2IY2Ma1Dy6poBuxLRZRQUO+O ZVQue/T/2jN0M38f50cpWA3YLPEB9LGT/XQZJ3ETcKBr7CHnzX7PRU05L9qV1+cOReMn 8bRGjd1MTpY4I6Bj0QSVVclAplerGjmeusLHwA8hw4gAszEnVCsfdrO/rrMvdyfvl3CE IkNLFxtfbYPx8I8lI5Nlu38p+aaVqKfhP1Hs2vC4S9OSNr83/KmrejX1CoLqfhEzrqql h4TD9dCfGX11jUJEGsmTFV/EZKv5m2CZxSdMuLd8/w0JEguASeiVo4mEFssxOKiLVUnG RLFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=WkYQiGNV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id k4-20020a170902d58400b001c73d73f163si4461241plh.505.2023.10.06.15.17.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 15:17:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=WkYQiGNV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id A2ED180C7112; Fri, 6 Oct 2023 15:16:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233739AbjJFWQV (ORCPT + 18 others); Fri, 6 Oct 2023 18:16:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233397AbjJFWQU (ORCPT ); Fri, 6 Oct 2023 18:16:20 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A3BEBD for ; Fri, 6 Oct 2023 15:16:19 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-27736c2a731so1991713a91.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=vger.kernel.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=WkYQiGNVDUcCXR6JU3Sl/cHSiT343fFRVd2S7kDVw3Y+wnGIPxJtOzCJeWZuThrOS2 AA1Iitm6skr5rYDMcSawFGBrhrHKVbztHKd7FipiGz822QxHQYQKm2qtadDWT2dv7FQc Oy0k3r3NojgeiU3T41/mD+az/uxLPNGeSY9Z4= 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=aFupcgcKZjYFLbnZrBKaKhr9MpWvBThgIMz9cA1IZy+D++h7TP/Fq1rsiSmEG7lKrZ AnJRnZDkhHm2PRoaFAwAYnNMd4h1gFKDz4QDJdBMO6g97vjBOLBbMYWjOSjDVPy+qmnD NjSjvaB0EQHaBNPmJlHmnHj8W9KQT3UUqjmrcIXL6Jtb9pdxNOXG+qX1c9OczJzaaLpt iDDluF39cDQ4lOtoKyDVqGCn5OTfnI/GQoqruHy934ZyOcfde+5QcgJQ7XTAXtfdNKg5 KW/2q4uhWd8cRmsCCG9I6/g1NzirGfTMPb2gNj/qpU5TEeKCRGOncelcAHRMC1ckNQSB jc5Q== X-Gm-Message-State: AOJu0YzA7/uNa5W7tsdpza09M5W+zNjNwpz/dRGhfbBDaD8a1IPHiJCG V3kuiZHgQ5DZKVJbGmHvuwaRAQ== 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-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 06 Oct 2023 15:16:38 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779046166077058088 X-GMAIL-MSGID: 1779046166077058088 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: 149436 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp624704vqo; Fri, 6 Oct 2023 15:16:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFo3si9Ecn7hKBmigH5jvKl6Mwbx8jOR6gq+ITEAVjtl0UJj+6AwIWNap95oY1gq+qEbjd X-Received: by 2002:a05:6a00:2341:b0:690:d413:ee13 with SMTP id j1-20020a056a00234100b00690d413ee13mr10958821pfj.23.1696630607080; Fri, 06 Oct 2023 15:16:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696630607; cv=none; d=google.com; s=arc-20160816; b=fhBk0eMebyM86Gl4qTDTmy/E3ITZ12ciPuhTWx3VJE32AEPTXcoIF8DnHS6kEypzHO fT3dwFy7kNClfifJFVzA4cMCOSwfgKasnuMfa/hoFE2pLS2lxrA+OFzk41d4zeDVyvJS iUvQRNsoisWhjAUcebveOAzGjW+i6pzutKAiwn/WzNExB8hoSiM4IdfBJZNpJwUnuJEf OGGyxLwHimVCycYN1G0ZDaVlYNnZl26+DcGhTSl+vkqQSYDmBZCDmh2pmwWtsNOMABvS FHekt5mTtxuPWP0MyGYjkO9GX26YCyYVuR/j1AdqTy2T3PKbGXxGhZS/hBCtx9qy+B35 Rabw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wCChOiC5+OCDlbLLrEgPwNPe/HtuhSm+x2PIj6YN8Og=; fh=nny2n/zUDziJzn1daQOaXjBS6rfcRUdImZiQf9Ai5Xg=; b=VRZtv+E+NFYcAy5or8xRMtX7vWb0yzE5OpwZnfPwXDQJgsbNPvBR2Fytt+3ppH2Q9g /OXwdTlunIZSbGYba+MRUzmdOTrvfqyZjIlfp0G+iz7bCW8X57OWkikJ/DAcwNR6dw7S Tn0qq/6gP7PWEFBUKRnQb9QsSl+tL3KPeaI2quKWaGGtL2XQxILbXBoIiN6qshvJtCA6 KyyHA9+nkkFi31Q18ZBgRzMQI1Ezxpirk/QbvpyrHzbXRsGaD5KS8r+yR5KWMFolPXhJ baeoIsZflg9HLOGBriLnnnVLb3I5ngqMh9/Lnp9ctDYJDrE39qKYFyDztsknLlADIIM9 5C4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fvq+qEKb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id cu7-20020a056a00448700b006901f2f2577si2304366pfb.380.2023.10.06.15.16.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 15:16:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fvq+qEKb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 3D56A8042D05; Fri, 6 Oct 2023 15:16:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233752AbjJFWQZ (ORCPT + 18 others); Fri, 6 Oct 2023 18:16:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233397AbjJFWQW (ORCPT ); Fri, 6 Oct 2023 18:16:22 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3112BD for ; Fri, 6 Oct 2023 15:16:20 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-53fa455cd94so1885819a12.2 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=vger.kernel.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=fvq+qEKbKlRP8jv1g60fch3h/u4lr7PHQDfNyM7NBAuvJqfOTbA1Q5MWTIJijf4YXO z8CUCC2PR89Pu5SCf+C+jyNI8haDON3MZhNllNa0TcjKKSH6QuTaS8o+sGyyg55EQwJV 84dxvQ8+QPfTctjC0foT7eqoItBhnMFYYBetE= 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=MhZY4vKeSlM31mcego6ZR8tjYDlI7GZoXD3WCMQuRQaNPRhKX8ARphxT37t50h7GFI 0ewsQ/wp/enl5dweBb0WP2LI4puwzUk1fpO+6dnXWpptmcPnsSR9japq4I9FmYKxsvOI yGWISqPN8+tXe2nO/4aCF5FDiYHZ9nkWi1wLiMkeKDXt1obVmWd2mcqK/EZRH3ehsR8f GNGSgy7ICLA5ScVchcwE2GRzVhSTUyvQLap5iI6EOvH0UGms7oibqE1DMVwqzwINIvz2 XbZy2UMcj6iU136ZUKN3FRIy3XPGe3jspl65PSoTULUJ+pbSdXmgMmp+tx21ZpFJtt5Y XfgQ== X-Gm-Message-State: AOJu0YyPscHILzZ41enliuQArVuJe0062PzWxtXkr3E8MIDGB/1uqfST tBXkVUF0exoqHITQ/F02gYUN5g== 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-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 06 Oct 2023 15:16:45 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779046135300653118 X-GMAIL-MSGID: 1779046135300653118 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: 149437 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp624737vqo; Fri, 6 Oct 2023 15:16:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyjqwEri8LKpwqE0tPDkDXRyl14NMgpn1v8x/fDZp6TtSPyv7+X6MN84aHvioqnW/ef3aC X-Received: by 2002:a05:6a20:728e:b0:15a:4c23:870b with SMTP id o14-20020a056a20728e00b0015a4c23870bmr9692616pzk.23.1696630611528; Fri, 06 Oct 2023 15:16:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696630611; cv=none; d=google.com; s=arc-20160816; b=gWYHUJSf38/lTF8YIXkU/bgQlcyfnn+uXJaYGISeWMIFP5xVDeDMxTAOlt/3xpYTDt WWguFhfnYt45d4PL4MDZ5ZN8K8EIJSBYAH9mabr5MOrc/DjgNrwmS8R7TJ5QDmflKNkb 6irP3evSNDAQhB5G8o6YFov2ELtB3zxKvF0uVEKYPAoJGpVbNt+8gUU/UtMyPX7UwVv1 zN0xefrSVhRPXdUsuk9YsbBfpsAFM9hPm/LR2y/1bwF1jT8ZuhCu1YMZef+NQRMKr1AQ q3zq7Uk5JLuQaIvISw2e3OmtcCFHjD4FN/ULSz3N1mgq7dOd4uTgJWxQCQ7FGCPHnc/d wdTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mKHn8MHAksMieZVNplmzQ9td3WQY/zTB+/6WLDFqzoc=; fh=XVmTbdCX3pyryhcQytEVMVPL51Yj+5K5oAR1NsdBfF0=; b=Z1Q0STdugOb4+F88DQAcI6e3u0owW55I7y0jWey1So/2Btc3NspBE4jjyx/ks0Rg/Q Zm3w3QWpdm5M94yE7do9sv+Fy4v1F5EDG+gruWS02hhtvJcvFmsXwTvPjhvlwQLdQGwH Je0Tau1YZThowqR11HZjOQ13W0G9bRdbuH+IhggDc13L8A4rqXZBDuifenSAuX59/8KS 3qLPS0I42wkUEgihsXnOi0DKvhqnQDcOhhB1UlocYGJtUEFbBBYwYQXW0bs/LHVv5jzI cphr65EeMvU3tsnGsSZVZlwSlJSjYv7GXABJUQDUJnfhaS2yK1jZZPX4seo4TIqP1Df2 4HsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZSFXcvar; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id cg19-20020a056a00291300b00693462e2553si2300128pfb.156.2023.10.06.15.16.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 15:16:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZSFXcvar; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 2A04485BF180; Fri, 6 Oct 2023 15:16:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233769AbjJFWQ2 (ORCPT + 18 others); Fri, 6 Oct 2023 18:16:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233754AbjJFWQZ (ORCPT ); Fri, 6 Oct 2023 18:16:25 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F00ACBD for ; Fri, 6 Oct 2023 15:16:22 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-578d791dd91so2049293a12.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=vger.kernel.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=ZSFXcvartjnVLWjOnc1Zm3GTsvaBpPPgn7YtM+5QGifXxevKNVwsw21LQ0hA3L+S7I 3A6tSW3yTRM/2nQZbBdrwLPsq9P4GYmv1wmJzp+Hn78NwSwX7cfaxRTLZLlUQoaQYv0e /QxBW/gsil9hUoy+DstembkO2gJqG8CBxYPYo= 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=QyIazbNHo3g5bopwkG5fBa4JW1R128fZR7JMHKlL31pW2B4J6mhE8m1Gfh0qhG7SHO Y+8+6/bhgVHrtwemViE6gw6P8KsLvwr7fBeZQGMRUJZKLh/dIKl6dbsMCSKA+p1prsiL sPp4l9WyhaRlmooigNFe/AM5lDaEi4nFt0QP5iEOx/dooaNZQ6xeokpcwEz6Op0EdgtK CaAW8cYC7Gj69NQ3sUCo+2XZIfuxlmRbHssxlcIBp/8iI+KjDKx5UWij+VyHP6izPo6g 0U3udVtTxK9uZglfr00h9oxpBb0WkeGynskfmoDulbZUfu71ebbHEVR5+nqyek/D3pk/ M/Mw== X-Gm-Message-State: AOJu0YzixySTpqfinLKDNkvk7idUsB9U0ixEn2xSs2Xn6hNjHTskcv07 jq9rV+A7/K2jEomLz+KEf89idA== 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-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 06 Oct 2023 15:16:49 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779046140248102925 X-GMAIL-MSGID: 1779046140248102925 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)