Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp784255rwd; Tue, 16 May 2023 07:42:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4zyAD/FQ3h2AIKPF/OrMt4Ci/rlu12ofQyMSIqKXCGU/KTkVLwfqiV1VLoP1r/uzi++qd1 X-Received: by 2002:a17:90a:a009:b0:250:462:d20e with SMTP id q9-20020a17090aa00900b002500462d20emr38046947pjp.45.1684248156835; Tue, 16 May 2023 07:42:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684248156; cv=none; d=google.com; s=arc-20160816; b=qP5xSIzDnYNAAa8WhTGXr7c5U4YgvbXmWYMdlsdPjMNTGSwoCc/mt1WzXMfBPqELbB ZUDl3hwpxtgShXUsBnar81ZVNjHA3xnPmCJX5TTNNgaHlg/RYeaqQBKX3NvlK4+8EU/Z E9gD/rHk8Xnw4oWvzm8CrPVGDogr3a2474VybCApTggeoA31MFyb/74lcmwNlQPMRiRM u81DGyr0r6TgmWGtgfWQZZvZbVLNv0iZkllcQPA+gGO+5EDP6em+g3OTtM7BHVPmr0FK JwpMpfivH300KLroPRF/zsdqcEPTzlhjChC+WXQyODUDh1stAwiR5beygos1H2S3Va5C k5Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Um1tUxrJi7GYgRkSCDyfBikS3Jewh3k7uhzREmBIwwY=; b=Zv+8Yp0gvlfcIYDplhDUJBfJNMQrjLcow4DDmIVjyeETLW1mW4SxJXIG2vPsw6CsYc toxQZzf/RiBhSftCsQTZogLMwRkPAAa9AKOx3NRRfdHi/fQNndPY+FTMyiONh/YzgHuj I0G9xeAg8VRDFIGsBwiMgem49JLpp26cyWohI7Q5jasYlZmQ0H8Q/YeIEdkUXCnaW1Hg hKWTRabWb5kSgDqp35Tyi3IOLjhwOkwSSMKNDrzQmSZsuQ56daq2CxT1VVKyFB9zeHfN 9rVPF2jThrSNugwBXutTVDoYePiI0bVHkeR5yfmq7zWa7Qsz7q46XuQLROFMztBH/T/5 GiTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZOCp4xaF; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id il11-20020a17090b164b00b0025023111538si2097222pjb.36.2023.05.16.07.42.22; Tue, 16 May 2023 07:42:36 -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=ZOCp4xaF; 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 S233924AbjEPOUX (ORCPT + 99 others); Tue, 16 May 2023 10:20:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233216AbjEPOUI (ORCPT ); Tue, 16 May 2023 10:20:08 -0400 Received: from mail-vs1-xe34.google.com (mail-vs1-xe34.google.com [IPv6:2607:f8b0:4864:20::e34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9C747ABC for ; Tue, 16 May 2023 07:19:53 -0700 (PDT) Received: by mail-vs1-xe34.google.com with SMTP id ada2fe7eead31-4361225a745so3010862137.2 for ; Tue, 16 May 2023 07:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1684246793; x=1686838793; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Um1tUxrJi7GYgRkSCDyfBikS3Jewh3k7uhzREmBIwwY=; b=ZOCp4xaFxexSDGJYQZSqZNykw1Le/JfuA3Ze1ozd+i7MNRSCmmK1MVQr1IgEDP62qx EbnFYB5XOOslcwUFPzeBIa+9x5FhRIm5zNS0QvPnJCZfrknNRWWPRHZxT+Ef2Ng/dNJQ y4lSwUtjMY4+R3APscBh1MdGfLarRZNIZnMpk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684246793; x=1686838793; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Um1tUxrJi7GYgRkSCDyfBikS3Jewh3k7uhzREmBIwwY=; b=BR17jYm5AYWgbCJGmq4kPEvxRAr5q6VTI848DAxhSBvlHPz9z8DIR8OiAvhOIv1IQe S1ebYxDA8U3EPFlGXAZpksYEQoIEVl1FYIzuOVP3ey8QNt1pA/oBvaKAUTlwIxhBKAqf 4WKMeh5aYlXR1HqaQLeWk7F8IL/LnLk2ozwAMgjumMjToYhDr7oGpo/bpL4bnZpyFdmb ALbCi1tPI1n+8iBGl4+HaFpgKQw2kSiHgYtzKjt7TdlPUdMrr+Ygn0iv4qvFu0aOzh5U srMD+c/OtJbzhOJUDn9EUnYVpHg6pnrRAIGTjYngDueo1zQBkjXb5Y/WwIfWXz7fEg1R +Pkg== X-Gm-Message-State: AC+VfDw/sedyIXIC1zwprNwjfmeio3znCZmv3rb0mX2bWdfH8YKwi2jw AwHmlWzRM1DXlYSHoRVQj4sR3525m7yU33DdvNo= X-Received: by 2002:a67:f516:0:b0:426:b2d8:17e9 with SMTP id u22-20020a67f516000000b00426b2d817e9mr14838703vsn.20.1684246793023; Tue, 16 May 2023 07:19:53 -0700 (PDT) Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com. [209.85.160.171]) by smtp.gmail.com with ESMTPSA id t8-20020a05620a034800b007591cc41ed6sm633941qkm.25.2023.05.16.07.19.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 May 2023 07:19:52 -0700 (PDT) Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-3f38824a025so1817241cf.0 for ; Tue, 16 May 2023 07:19:52 -0700 (PDT) X-Received: by 2002:ac8:4e86:0:b0:3f5:4eb4:414f with SMTP id 6-20020ac84e86000000b003f54eb4414fmr3310qtp.13.1684246791898; Tue, 16 May 2023 07:19:51 -0700 (PDT) MIME-Version: 1.0 References: <20230515131353.v2.cover@dianders> <20230515131353.v2.2.I88dc0a0eb1d9d537de61604cd8994ecc55c0cac1@changeid> <3cc683e7-28aa-7b6e-1499-3aca953294cc@collabora.com> In-Reply-To: <3cc683e7-28aa-7b6e-1499-3aca953294cc@collabora.com> From: Doug Anderson Date: Tue, 16 May 2023 07:19:39 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/5] irqchip/gic-v3: Disable pseudo NMIs on Mediatek devices w/ firmware issues To: AngeloGioacchino Del Regno Cc: Marc Zyngier , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Allen-KH Cheng , linux-mediatek@lists.infradead.org, Eddie Huang , Hsin-Hsiung Wang , wenst@chromium.org, yidilin@chromium.org, Tinghan Shen , jwerner@chromium.org, Weiyi Lu , Ben Ho , Seiya Wang , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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,URIBL_BLOCKED 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 Hi, On Tue, May 16, 2023 at 6:23=E2=80=AFAM AngeloGioacchino Del Regno wrote: > > Il 15/05/23 22:13, Douglas Anderson ha scritto: > > Some Chromebooks with Mediatek SoCs have a problem where the firmware > > doesn't properly save/restore certain GICR registers. Newer > > Chromebooks should fix this issue and we may be able to do firmware > > updates for old Chromebooks. At the moment, the only known issue with > > these Chromebooks is that we can't enable "pseudo NMIs" since the > > priority register can be lost. Enabling "pseudo NMIs" on Chromebooks > > with the problematic firmware causes crashes and freezes. > > > > Let's detect devices with this problem and then disable "pseudo NMIs" > > on them. We'll detect the problem by looking for the presence of the > > "mediatek,broken-save-restore-fw" property in the GIC device tree > > node. Any devices with fixed firmware will not have this property. > > > > Our detection plan works because we never bake a Chromebook's device > > tree into firmware. Instead, device trees are always bundled with the > > kernel. We'll update the device trees of all affected Chromebooks and > > then we'll never enable "pseudo NMI" on a kernel that is bundled with > > old device trees. When a firmware update is shipped that fixes this > > issue it will know to patch the device tree to remove the property. > > > > In order to make this work, the quick detection mechanism of the GICv3 > > code is extended to be able to look for properties in addition to > > looking at "compatible". > > > > Reviewed-by: Julius Werner > > Signed-off-by: Douglas Anderson > > I don't like firmware removing properties from my devicetrees and I'd lik= e this > issue to get addressed in another way (use a scratch register? and check = it in > Linux drivers to determine if the issue is not present: if scratch contai= ns BIT(x), > do not parse the quirk) but that's a different discussion which is a bit = out of > context for this patch, so: Any particular reason why? IMO it's actually a fair bit cleaner to have firmware remove a property that's specifically documented for the firmware to remove compared to having firmware adding properties to or otherwise messing with the device tree. For the removal case, it's easy from the device tree git history to find out about the property, when it was added, and that it is expected that some versions of firmware will remove it. IMO having firmware add properties can be a little more mysterious, though that has its place too. In general, though, firmware is expected to be able to be able to touch up the device tree. It puts things in "chosen", adds bits describing the firmware, can add things to the device tree to describe components it is uniquely able to probe (like SDRAM), could enable/disable a component if it has info about their presence, etc. I'm happy to hear other opinions on it, but in my mind having a sideband bit telling us to ignore the quirk is more confusing instead of less confusing. > Reviewed-by: AngeloGioacchino Del Regno Thanks!