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: 683707 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 6354AC77B7D for ; Mon, 15 May 2023 20:16:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245255AbjEOUQN (ORCPT ); Mon, 15 May 2023 16:16:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245258AbjEOUQJ (ORCPT ); Mon, 15 May 2023 16:16:09 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B812FE52 for ; Mon, 15 May 2023 13:16:08 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6436e075166so9907733b3a.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=NDHc0OBDDxVJnbnIuAyvssPnI8a5CoAnlFk3bI0a82gblzfIFjW9h98QtChS2t+VwH yEORohCOn8jK13wWIkISTm0lxf48rS43MrwZnfAnWAu2/7JYN5zXDYBEAJVX3gyvjq/n 61jSsl+d5dJa7th+P8fB5MmRZwGSA9LTfBz5C0DSaAGRw6mI2wX3O8T8Rh5f7QDk96um IHLX9Ezi8D9jed+m12ItqKnOcLCrPbtbl/TWhTIN/5PuGcGoBZQjMBBN8P0xKTMOa71f Sdy+0JqdlIA9NutlNHOE0cx7udXlHFt/NiBQsCoi9NhvN92yjHm7yEvqZTrFtTtf5Wz/ DtuQ== X-Gm-Message-State: AC+VfDyri+tnMdNiPy7jc/vjtKH7D+pcEzwE67Gd+XynUcyWgwznXfsD rBB3+qqc1zV5cf/wEBTmfq2d4Q== X-Google-Smtp-Source: ACHHUZ5WhKqgoMTuex1L+d9MK/DlTrH0o+Ldk/9GGkvVe2VsoV5lyk+s+Rn1dX3B0wpYq4ALaKdvAA== 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 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 --- 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 ]