Message ID | 20230720200753.322133-1-nfraprado@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp3374199vqt; Thu, 20 Jul 2023 13:54:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlGqzZoVOxPqItVvDBASWBRfb9M7HPuAuNcO6Dez62R7qLVUxOF6qytp6kn6P38U254lOk63 X-Received: by 2002:a17:906:2457:b0:987:5147:7498 with SMTP id a23-20020a170906245700b0098751477498mr5160267ejb.32.1689886488542; Thu, 20 Jul 2023 13:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689886488; cv=none; d=google.com; s=arc-20160816; b=E9RJoVvUtnXZw383WcZmDNfa8Gy+W28TyaZRtGiYFKDyJoa3U30chbeyc2jlJ87fOw t5bvBX4yVt8XMWZh5xFc6bQLqo7bxbhM68Sjh1DEqe2cC+QyCfZWiR89UChXzJ64mJji 2kcVk1RQsyWLxHsKnZ8TnBmrhMhD12bwzMnATtOVMbZF1/A2dPOgZRSOy2lZ240W3fRW Ow5BeP8zWbE87016Nvn7hzMhu0mS3ZnBP3O8ebFOjj6/2JbFKMppUkReVO7+KKSPk7hg BDjGU6+Du/rrjsVPCvS++OPMbtHzqnrt6SQZknYzCGCg6bxtjTvqv8Di6aTITb25RUGw EQbA== 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=YTmc75LfHTa7TCmgPznB1cxeujrYHdCm4+YQn7nJwTc=; fh=dB1Ohglh3wqyWRQQN35p8SkshgtqEiNyHVJ6JKWp4aU=; b=iIdDHKJys7LPmLfQ+YD0BbXbGjfRpOx4TlwbZVVCCVWCYXa5KWPEz2ADFR/tHJN4r8 Mhun/+Pm6VY9eLVuSLvGmJ2FmmTn4nIez3bXWJ8GjvraRNIz1fRFJUDlJqNebegOxBbB pd0iEw2Dv3nODnJglOxaKEHEMig8TnCy//lahJmpmB0gF1XTMJ+hmnNHyuzkyprXCy+4 ZaDxFENjxSrnxmpESq8o4AR7TeAiSA9oQvfsA/t8MTfxDk5QWDJF+Pe+eysBHe4IWAeh iwZMi1BOQdETjliqycOFHYCNe3HoN5EC035UAuCcYGAaRTaqMCDs9RNLDSMv7fK0WL1X A4gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=gGgk+y0l; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d13-20020a1709064c4d00b00997c3561696si1142613ejw.577.2023.07.20.13.54.24; Thu, 20 Jul 2023 13:54:48 -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=@collabora.com header.s=mail header.b=gGgk+y0l; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229973AbjGTUIH (ORCPT <rfc822;assdfgzxcv4@gmail.com> + 99 others); Thu, 20 Jul 2023 16:08:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230173AbjGTUIF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 20 Jul 2023 16:08:05 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AA90ED; Thu, 20 Jul 2023 13:08:04 -0700 (PDT) Received: from notapiano.myfiosgateway.com (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 134E86607090; Thu, 20 Jul 2023 21:08:00 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1689883683; bh=q4fuY2sBxPima8ZJjGLmr5uxehT6OzQWdozbhPSZu+U=; h=From:To:Cc:Subject:Date:From; b=gGgk+y0lWDU7OZlur4njWxpvtgz8F37oiLPkhWxHa94nXWnBkfsmBcUQ7igmMplxt oIYzYgPseJV4YazM7MPyfWHuk1gxRJTcJ8VvrZKN4K/rUcoj94z6Kr2+X7l/hgDSWY kr1+GxlBcLIfWel5c4HAI0iiD1xGBCZcEY27Jyy1FQG5m3Wx2fxaewu5v8rvV1T+n+ dEpKpdI/FFJtAfHCj46UzJ2Q30esCp79qalPhv6eWZoRneXzKxPzBBhnoToW+a5WJg ZcsKJvqtCTx+b0P1bHl+YSoQpwUS6OFGmamZVc85AECSE0wIwBcCdJSnwRR/trvouG oLt54JiNIBomg== From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com> To: Matthias Brugger <matthias.bgg@gmail.com> Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, kernel@collabora.com, Chen-Yu Tsai <wenst@chromium.org>, =?utf-8?b?TsOtY29s?= =?utf-8?b?YXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com>, Conor Dooley <conor+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Rob Herring <robh+dt@kernel.org>, Seiya Wang <seiya.wang@mediatek.com>, Tinghan Shen <tinghan.shen@mediatek.com>, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH] arm64: dts: mediatek: mt8195: Set DSU PMU status to fail Date: Thu, 20 Jul 2023 16:07:51 -0400 Message-ID: <20230720200753.322133-1-nfraprado@collabora.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771974414517645717 X-GMAIL-MSGID: 1771974414517645717 |
Series |
arm64: dts: mediatek: mt8195: Set DSU PMU status to fail
|
|
Commit Message
Nícolas F. R. A. Prado
July 20, 2023, 8:07 p.m. UTC
The DSU PMU allows monitoring performance events in the DSU cluster,
which is done by configuring and reading back values from the DSU PMU
system registers. However, for write-access to be allowed by ELs lower
than EL3, the EL3 firmware needs to update the setting on the ACTLR3_EL3
register, as it is disallowed by default.
That configuration is not done on the firmware used by the MT8195 SoC,
as a consequence, booting a MT8195-based machine like
mt8195-cherry-tomato-r2 with CONFIG_ARM_DSU_PMU enabled hangs the kernel
just as it writes to the CLUSTERPMOVSCLR_EL1 register, since the
instruction faults to EL3, and BL31 apparently just re-runs the
instruction over and over.
Mark the DSU PMU node in the Devicetree with status "fail", as the
machine doesn't have a suitable firmware to make use of it from the
kernel, and allowing its driver to probe would hang the kernel.
Fixes: 37f2582883be ("arm64: dts: Add mediatek SoC mt8195 and evaluation board")
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---
arch/arm64/boot/dts/mediatek/mt8195.dtsi | 1 +
1 file changed, 1 insertion(+)
Comments
Il 20/07/23 22:07, Nícolas F. R. A. Prado ha scritto: > The DSU PMU allows monitoring performance events in the DSU cluster, > which is done by configuring and reading back values from the DSU PMU > system registers. However, for write-access to be allowed by ELs lower > than EL3, the EL3 firmware needs to update the setting on the ACTLR3_EL3 > register, as it is disallowed by default. Typo: ACTLR_EL2, ACTLR_EL3 bit 12 must be set if SCR.NS is 1; ACTLR_EL3 bit 12 must be set if SCR.NS is 0. On MT8195 Chromebooks, SCR.NS is 1 - hence ACTLR_EL2/EL3 must have BIT(12) set, but at least ACTLR_EL2 doesn't have it set. I haven't verified EL3, but that doesn't matter, since both need to be set. > > That configuration is not done on the firmware used by the MT8195 SoC, > as a consequence, booting a MT8195-based machine like > mt8195-cherry-tomato-r2 with CONFIG_ARM_DSU_PMU enabled hangs the kernel > just as it writes to the CLUSTERPMOVSCLR_EL1 register, since the > instruction faults to EL3, and BL31 apparently just re-runs the > instruction over and over. ...at least for this SoC, TF-A's BL31 fault handler loops over the same instruction forever, hanging the AP... Regards, Angelo > > Mark the DSU PMU node in the Devicetree with status "fail", as the > machine doesn't have a suitable firmware to make use of it from the > kernel, and allowing its driver to probe would hang the kernel. > > Fixes: 37f2582883be ("arm64: dts: Add mediatek SoC mt8195 and evaluation board") > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > > --- > > arch/arm64/boot/dts/mediatek/mt8195.dtsi | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts/mediatek/mt8195.dtsi > index 5c670fce1e47..0705d9c3a6a7 100644 > --- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi > +++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi > @@ -313,6 +313,7 @@ dsu-pmu { > interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH 0>; > cpus = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>, > <&cpu4>, <&cpu5>, <&cpu6>, <&cpu7>; > + status = "fail"; > }; > > dmic_codec: dmic-codec {
On Fri, Jul 21, 2023 at 10:16:44AM +0200, AngeloGioacchino Del Regno wrote: > Il 20/07/23 22:07, Nícolas F. R. A. Prado ha scritto: > > The DSU PMU allows monitoring performance events in the DSU cluster, > > which is done by configuring and reading back values from the DSU PMU > > system registers. However, for write-access to be allowed by ELs lower > > than EL3, the EL3 firmware needs to update the setting on the ACTLR3_EL3 > > register, as it is disallowed by default. > > Typo: ACTLR_EL2, ACTLR_EL3 bit 12 must be set if SCR.NS is 1; > ACTLR_EL3 bit 12 must be set if SCR.NS is 0. > > On MT8195 Chromebooks, SCR.NS is 1 - hence ACTLR_EL2/EL3 must have BIT(12) set, > but at least ACTLR_EL2 doesn't have it set. > > I haven't verified EL3, but that doesn't matter, since both need to be set. The kernel is running at EL2 (as I verified from CurrentEL), so only ACTLR_EL3 needs to be set. ACTLR_EL2 controls whether EL1 can write to the register (in non-secure mode) [1], which doesn't matter in this case. [1] https://developer.arm.com/documentation/101430/r1p2/Register-descriptions/AArch64-system-registers/ACTLR-EL2--Auxiliary-Control-Register--EL2 Thanks, Nícolas
On Thu, Jul 20, 2023 at 04:07:51PM -0400, Nícolas F. R. A. Prado wrote: > The DSU PMU allows monitoring performance events in the DSU cluster, > which is done by configuring and reading back values from the DSU PMU > system registers. However, for write-access to be allowed by ELs lower > than EL3, the EL3 firmware needs to update the setting on the ACTLR3_EL3 > register, as it is disallowed by default. > > That configuration is not done on the firmware used by the MT8195 SoC, > as a consequence, booting a MT8195-based machine like > mt8195-cherry-tomato-r2 with CONFIG_ARM_DSU_PMU enabled hangs the kernel > just as it writes to the CLUSTERPMOVSCLR_EL1 register, since the > instruction faults to EL3, and BL31 apparently just re-runs the > instruction over and over. > > Mark the DSU PMU node in the Devicetree with status "fail", as the > machine doesn't have a suitable firmware to make use of it from the > kernel, and allowing its driver to probe would hang the kernel. > > Fixes: 37f2582883be ("arm64: dts: Add mediatek SoC mt8195 and evaluation board") > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Hi Matthias, gentle ping on this patch, as it's not possible to boot MT8195 Chromebooks with the mainline defconfig without this fix. Thanks, Nícolas
Il 20/07/23 22:07, Nícolas F. R. A. Prado ha scritto: > The DSU PMU allows monitoring performance events in the DSU cluster, > which is done by configuring and reading back values from the DSU PMU > system registers. However, for write-access to be allowed by ELs lower > than EL3, the EL3 firmware needs to update the setting on the ACTLR3_EL3 > register, as it is disallowed by default. > > That configuration is not done on the firmware used by the MT8195 SoC, > as a consequence, booting a MT8195-based machine like > mt8195-cherry-tomato-r2 with CONFIG_ARM_DSU_PMU enabled hangs the kernel > just as it writes to the CLUSTERPMOVSCLR_EL1 register, since the > instruction faults to EL3, and BL31 apparently just re-runs the > instruction over and over. > > Mark the DSU PMU node in the Devicetree with status "fail", as the > machine doesn't have a suitable firmware to make use of it from the > kernel, and allowing its driver to probe would hang the kernel. > > Fixes: 37f2582883be ("arm64: dts: Add mediatek SoC mt8195 and evaluation board") > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts/mediatek/mt8195.dtsi index 5c670fce1e47..0705d9c3a6a7 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi @@ -313,6 +313,7 @@ dsu-pmu { interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH 0>; cpus = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>, <&cpu4>, <&cpu5>, <&cpu6>, <&cpu7>; + status = "fail"; }; dmic_codec: dmic-codec {