From patchwork Mon May 15 20:13:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 94326 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp7171633vqo; Mon, 15 May 2023 13:24:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6bCsgeACWspDXfUvAv0PPIHS4k2CbAvaZxlwC42+uJzn/8KHwcD8mxvSY57EQOW8dSIPZe X-Received: by 2002:a17:902:b946:b0:1aa:f6f2:46b7 with SMTP id h6-20020a170902b94600b001aaf6f246b7mr33001516pls.34.1684182247009; Mon, 15 May 2023 13:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684182246; cv=none; d=google.com; s=arc-20160816; b=uykzl5zPgnu0+RMBk75vy3K8/sqjIxZ1ve814286rdnnuOQWhhuE7kNKbctVwMZtWv gRaF/839RJ3wt4IHuZOtvrdo1Knoisek6nc9lz72HSwNAJINcIzwEFZvmfUz93r9DP0k cjaU7vD/vRr9kvZbi4sbiMETKBDp1ZZ9+okga4ipiOtWFEiPG6IY6HxI4DmO7fOQ7QL6 bSMX/c9ydygBLumJGaf7T7y8GYcG/zTBCKc2QgxVXmvbj25xsL0fQ9HJgc01eLSsr7MP YVw2IP7wcj8srBeRCPYiiy4KlkwX7dDWVgdm6XvfomkfhrdcOfW2zb56+hLYT+uNBVSc jv/g== 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=q+xclHRJbfTaOco3ogcoYlZx1POsGrbKOC60b7YSguU=; b=q9iiSeeje4ACEncWMY1i2uJoSFtotOzwP2YyRsH3OqWz22j+bRsNpCTycXj90X7/Fi W3HDBjag6lFQNBpoRdo0yoegkCVZLlICLwhRQAB4aBGHTaAxyy7OmmB7lJMjdCip+ZIy 0kY3VUpS2R+2LY1iL/P2IMcCeF6cj4atXnjAsrITkjD0lm2Pv9uXVH2a1JP28Yjd7cW3 QrbbQHjxf2uV4ggiDQeLnZdO5tcaqwaiTFo0/VbtLZhifTAJc9UHPNfy3EbulVyg42bD fiq9KbYoZJJEO8llnCt8CyLu4tQ61tB4+/kSUfV7EOCNOl7DozqlX7YH/VFCPMjNLdGZ 6HrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=g36wlx4d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020a170902ec8500b001ab19e023a1si9013599plg.375.2023.05.15.13.23.50; Mon, 15 May 2023 13:24:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=g36wlx4d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245268AbjEOUQP (ORCPT + 99 others); Mon, 15 May 2023 16:16:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243149AbjEOUQJ (ORCPT ); Mon, 15 May 2023 16:16:09 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6FD1C1 for ; Mon, 15 May 2023 13:16:08 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6436e075166so9907734b3a.0 for ; Mon, 15 May 2023 13:16:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1684181768; x=1686773768; 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=q+xclHRJbfTaOco3ogcoYlZx1POsGrbKOC60b7YSguU=; b=g36wlx4dAT/5M/at1hKyNtZto26zWfKQwhNbIbrF+H00O03nyEY6BiCUtUDqrcdMbq e7fz+6QIIokAKhGcCOG2WqzT4Luc93tGNTu737dq9vjufkb3y1jzvHWHWkE0QjekmU7p lApebxoBnaqlPNm5AlNHXeaQIEHLeKk+EJKHo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684181768; x=1686773768; 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=q+xclHRJbfTaOco3ogcoYlZx1POsGrbKOC60b7YSguU=; b=Xzp/Q4KatNEK/9Ni7WvcJXzCCVfyuQe4wGBBmEgzm1pJxW0CeiwYuJsnWWLLa3WiwA Cxyn35m9mGNdezAJfoXvq4vjHF7vfmPDjZNpVna276GPR+oIRBzSYkvmM1/4QVx7tLPj aW5mjydkw2gbJGEs+gtUjoz3hMp0EybvVFcUfhzrcEXfsJXyKJxoKWIoFuIV/a7iZhFj E25pVXMJJf7UI9TXtKk04aNmU+BTBMrYYt7ZR437tjYCyisx/dFozRZ2c50espj1koYu FsUrtaWaqX4B6UI2lhbhr+buqXsPjOwekoUeJHcfjEVpiHXXY6Omycz7wNetdvcDm2ab 2sAg== X-Gm-Message-State: AC+VfDzF/65iHkKpiOVEbJ02LliSrayk3IkPrlKiefJpR6bW+O+5RnXr KDv4eXX1P672DFQZXlx8nsUhrg== X-Received: by 2002:a05:6a00:10d3:b0:63b:5496:7afa with SMTP id d19-20020a056a0010d300b0063b54967afamr41742520pfu.11.1684181768187; Mon, 15 May 2023 13:16:08 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:9f33:9d98:277a:d4cd]) by smtp.gmail.com with ESMTPSA id a19-20020a62bd13000000b0063f0c9eadc7sm7981411pff.200.2023.05.15.13.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 13:16:07 -0700 (PDT) From: Douglas Anderson To: Marc Zyngier , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Matthias Brugger Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Allen-KH Cheng , linux-mediatek@lists.infradead.org, Eddie Huang , Hsin-Hsiung Wang , AngeloGioacchino Del Regno , wenst@chromium.org, yidilin@chromium.org, Tinghan Shen , jwerner@chromium.org, Weiyi Lu , Ben Ho , Seiya Wang , Douglas Anderson , Conor Dooley , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] dt-bindings: interrupt-controller: arm,gic-v3: Add quirk for Mediatek SoCs w/ broken FW Date: Mon, 15 May 2023 13:13:50 -0700 Message-ID: <20230515131353.v2.1.Iabe67a827e206496efec6beb5616d5a3b99c1e65@changeid> X-Mailer: git-send-email 2.40.1.606.ga4b1b128d6-goog In-Reply-To: <20230515131353.v2.cover@dianders> References: <20230515131353.v2.cover@dianders> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765993083988461638?= X-GMAIL-MSGID: =?utf-8?q?1765993083988461638?= When trying to turn on the "pseudo NMI" kernel feature in Linux, it was discovered that all Mediatek-based Chromebooks that ever shipped (at least ones with GICv3) had a firmware bug where they wouldn't save certain GIC "GICR" registers properly. If a processor ever entered a suspend/idle mode where the GICR registers lost state then they'd be reset to their default state. As a result of the bug, if you try to enable "pseudo NMIs" on the affected devices then certain interrupts will unexpectedly get promoted to be "pseudo NMIs" and cause crashes / freezes / general mayhem. ChromeOS is looking to start turning on "pseudo NMIs" in production to make crash reports more actionable. To do so, we will release firmware updates for at least some of the affected Mediatek Chromebooks. However, even when we update the firmware of a Chromebook it's always possible that a user will end up booting with old firmware. We need to be able to detect when we're running with firmware that will crash and burn if pseudo NMIs are enabled. The current plan is: * Update the device trees of all affected Chromebooks to include the 'mediatek,broken-save-restore-fw' property. The kernel can use this to know not to enable certain features like "pseudo NMI". NOTE: device trees for Chromebooks are never baked into the firmware but are bundled with the kernel. A kernel will never be configured to use "pseudo NMIs" and be bundled with an old device tree. * When we get a fixed firmware for one of these Chromebooks, it will patch the device tree to remove this property. For some details, you can also see the public bug Reviewed-by: Julius Werner Signed-off-by: Douglas Anderson Reviewed-by: AngeloGioacchino Del Regno --- Changes in v2: - "when CPUs are powered" => "when the GIC redistributors are..." - mediatek,gicr-save-quirk => mediatek,broken-save-restore-fw .../bindings/interrupt-controller/arm,gic-v3.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml b/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml index 92117261e1e1..39e64c7f6360 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml @@ -166,6 +166,12 @@ properties: resets: maxItems: 1 + mediatek,broken-save-restore-fw: + type: boolean + description: + Asserts that the firmware on this device has issues saving and restoring + GICR registers when the GIC redistributors are powered off. + dependencies: mbi-ranges: [ msi-controller ] msi-controller: [ mbi-ranges ]