2023-05-15 20:34:36

by Doug Anderson

[permalink] [raw]
Subject: [PATCH v2 0/5] irqchip/gic-v3: Disable pseudo NMIs on Mediatek Chromebooks w/ bad FW

As talked about in the bindings patch included in this series
("dt-bindings: interrupt-controller: arm,gic-v3: Add quirk for
Mediatek SoCs w/ broken FW"), many Mediatek-based Chromebooks shipped
with firmware that doesn't properly save/restore some GICR
registers. This causes the system to crash if "pseudo NMIs" are turned
on.

This series makes sure that we never allow turning on "pseudo NMIs" if
we are running with the problematic firmware.

The patches in this series can land in any order and can go through
entirely different trees. None of the patches are harmful on their
own, but to get things fixed we need all of them.

v2 fixes the quirk name and also moves the quirk out of the SoC.dtsi
file and into the Chromebook file. This, unfortunately, means that
mt8186-based Chromebooks are no longer handled since they don't appear
to be upstream yet. :(

Changes in v2:
- "when CPUs are powered" => "when the GIC redistributors are..."
- Changed "Fixes" tag.
- Moved from mt8183.dtsi to mt8183-kukui.dtsi
- Moved from mt8192.dtsi to mt8192-asurada.dtsi
- Moved from mt8195.dtsi to mt8195-cherry.dtsi
- mediatek,gicr-save-quirk => mediatek,broken-save-restore-fw

Douglas Anderson (5):
dt-bindings: interrupt-controller: arm,gic-v3: Add quirk for Mediatek
SoCs w/ broken FW
irqchip/gic-v3: Disable pseudo NMIs on Mediatek devices w/ firmware
issues
arm64: dts: mediatek: mt8183: Add mediatek,broken-save-restore-fw to
kukui
arm64: dts: mediatek: mt8192: Add mediatek,broken-save-restore-fw to
asurada
arm64: dts: mediatek: mt8195: Add mediatek,broken-save-restore-fw to
cherry

.../interrupt-controller/arm,gic-v3.yaml | 6 ++++++
.../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 4 ++++
.../boot/dts/mediatek/mt8192-asurada.dtsi | 4 ++++
.../boot/dts/mediatek/mt8195-cherry.dtsi | 4 ++++
drivers/irqchip/irq-gic-common.c | 8 ++++++--
drivers/irqchip/irq-gic-common.h | 1 +
drivers/irqchip/irq-gic-v3.c | 20 +++++++++++++++++++
7 files changed, 45 insertions(+), 2 deletions(-)

--
2.40.1.606.ga4b1b128d6-goog



2023-05-15 20:45:12

by Doug Anderson

[permalink] [raw]
Subject: [PATCH v2 3/5] arm64: dts: mediatek: mt8183: Add mediatek,broken-save-restore-fw to kukui

Firmware shipped on mt8183 Chromebooks is affected by the GICR
save/restore issue as described by the patch ("dt-bindings:
interrupt-controller: arm,gic-v3: Add quirk for Mediatek SoCs w/
broken FW"). Add the quirk property.

Fixes: cd894e274b74 ("arm64: dts: mt8183: Add krane-sku176 board")
Reviewed-by: Julius Werner <[email protected]>
Signed-off-by: Douglas Anderson <[email protected]>
---

Changes in v2:
- Changed "Fixes" tag.
- Moved from mt8183.dtsi to mt8183-kukui.dtsi
- mediatek,gicr-save-quirk => mediatek,broken-save-restore-fw

arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
index 63952c1251df..8892b2f64a0f 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
@@ -292,6 +292,10 @@ dsi_out: endpoint {
};
};

+&gic {
+ mediatek,broken-save-restore-fw;
+};
+
&gpu {
mali-supply = <&mt6358_vgpu_reg>;
};
--
2.40.1.606.ga4b1b128d6-goog


2023-05-16 10:07:51

by Marc Zyngier

[permalink] [raw]
Subject: Re: [PATCH v2 0/5] irqchip/gic-v3: Disable pseudo NMIs on Mediatek Chromebooks w/ bad FW

On Mon, 15 May 2023 21:13:49 +0100,
Douglas Anderson <[email protected]> wrote:
>
> As talked about in the bindings patch included in this series
> ("dt-bindings: interrupt-controller: arm,gic-v3: Add quirk for
> Mediatek SoCs w/ broken FW"), many Mediatek-based Chromebooks shipped
> with firmware that doesn't properly save/restore some GICR
> registers. This causes the system to crash if "pseudo NMIs" are turned
> on.
>
> This series makes sure that we never allow turning on "pseudo NMIs" if
> we are running with the problematic firmware.
>
> The patches in this series can land in any order and can go through
> entirely different trees. None of the patches are harmful on their
> own, but to get things fixed we need all of them.
>
> v2 fixes the quirk name and also moves the quirk out of the SoC.dtsi
> file and into the Chromebook file. This, unfortunately, means that
> mt8186-based Chromebooks are no longer handled since they don't appear
> to be upstream yet. :(
>
> Changes in v2:
> - "when CPUs are powered" => "when the GIC redistributors are..."
> - Changed "Fixes" tag.
> - Moved from mt8183.dtsi to mt8183-kukui.dtsi
> - Moved from mt8192.dtsi to mt8192-asurada.dtsi
> - Moved from mt8195.dtsi to mt8195-cherry.dtsi
> - mediatek,gicr-save-quirk => mediatek,broken-save-restore-fw
>
> Douglas Anderson (5):
> dt-bindings: interrupt-controller: arm,gic-v3: Add quirk for Mediatek
> SoCs w/ broken FW
> irqchip/gic-v3: Disable pseudo NMIs on Mediatek devices w/ firmware
> issues
> arm64: dts: mediatek: mt8183: Add mediatek,broken-save-restore-fw to
> kukui
> arm64: dts: mediatek: mt8192: Add mediatek,broken-save-restore-fw to
> asurada
> arm64: dts: mediatek: mt8195: Add mediatek,broken-save-restore-fw to
> cherry
>
> .../interrupt-controller/arm,gic-v3.yaml | 6 ++++++
> .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 4 ++++
> .../boot/dts/mediatek/mt8192-asurada.dtsi | 4 ++++
> .../boot/dts/mediatek/mt8195-cherry.dtsi | 4 ++++
> drivers/irqchip/irq-gic-common.c | 8 ++++++--
> drivers/irqchip/irq-gic-common.h | 1 +
> drivers/irqchip/irq-gic-v3.c | 20 +++++++++++++++++++
> 7 files changed, 45 insertions(+), 2 deletions(-)

I'll take the first two patches as fixes. The rest can be merged via
the soc tree as required.

M.

--
Without deviation from the norm, progress is not possible.

Subject: Re: [PATCH v2 3/5] arm64: dts: mediatek: mt8183: Add mediatek,broken-save-restore-fw to kukui

Il 15/05/23 22:13, Douglas Anderson ha scritto:
> Firmware shipped on mt8183 Chromebooks is affected by the GICR
> save/restore issue as described by the patch ("dt-bindings:
> interrupt-controller: arm,gic-v3: Add quirk for Mediatek SoCs w/
> broken FW"). Add the quirk property.
>
> Fixes: cd894e274b74 ("arm64: dts: mt8183: Add krane-sku176 board")
> Reviewed-by: Julius Werner <[email protected]>
> Signed-off-by: Douglas Anderson <[email protected]>

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>



2023-05-29 15:53:57

by Matthias Brugger

[permalink] [raw]
Subject: Re: [PATCH v2 0/5] irqchip/gic-v3: Disable pseudo NMIs on Mediatek Chromebooks w/ bad FW



On 16/05/2023 11:58, Marc Zyngier wrote:
> On Mon, 15 May 2023 21:13:49 +0100,
> Douglas Anderson <[email protected]> wrote:
>>
>> As talked about in the bindings patch included in this series
>> ("dt-bindings: interrupt-controller: arm,gic-v3: Add quirk for
>> Mediatek SoCs w/ broken FW"), many Mediatek-based Chromebooks shipped
>> with firmware that doesn't properly save/restore some GICR
>> registers. This causes the system to crash if "pseudo NMIs" are turned
>> on.
>>
>> This series makes sure that we never allow turning on "pseudo NMIs" if
>> we are running with the problematic firmware.
>>
>> The patches in this series can land in any order and can go through
>> entirely different trees. None of the patches are harmful on their
>> own, but to get things fixed we need all of them.
>>
>> v2 fixes the quirk name and also moves the quirk out of the SoC.dtsi
>> file and into the Chromebook file. This, unfortunately, means that
>> mt8186-based Chromebooks are no longer handled since they don't appear
>> to be upstream yet. :(
>>
>> Changes in v2:
>> - "when CPUs are powered" => "when the GIC redistributors are..."
>> - Changed "Fixes" tag.
>> - Moved from mt8183.dtsi to mt8183-kukui.dtsi
>> - Moved from mt8192.dtsi to mt8192-asurada.dtsi
>> - Moved from mt8195.dtsi to mt8195-cherry.dtsi
>> - mediatek,gicr-save-quirk => mediatek,broken-save-restore-fw
>>
>> Douglas Anderson (5):
>> dt-bindings: interrupt-controller: arm,gic-v3: Add quirk for Mediatek
>> SoCs w/ broken FW
>> irqchip/gic-v3: Disable pseudo NMIs on Mediatek devices w/ firmware
>> issues
>> arm64: dts: mediatek: mt8183: Add mediatek,broken-save-restore-fw to
>> kukui
>> arm64: dts: mediatek: mt8192: Add mediatek,broken-save-restore-fw to
>> asurada
>> arm64: dts: mediatek: mt8195: Add mediatek,broken-save-restore-fw to
>> cherry
>>
>> .../interrupt-controller/arm,gic-v3.yaml | 6 ++++++
>> .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 4 ++++
>> .../boot/dts/mediatek/mt8192-asurada.dtsi | 4 ++++
>> .../boot/dts/mediatek/mt8195-cherry.dtsi | 4 ++++
>> drivers/irqchip/irq-gic-common.c | 8 ++++++--
>> drivers/irqchip/irq-gic-common.h | 1 +
>> drivers/irqchip/irq-gic-v3.c | 20 +++++++++++++++++++
>> 7 files changed, 45 insertions(+), 2 deletions(-)
>
> I'll take the first two patches as fixes. The rest can be merged via
> the soc tree as required.
>
> M.
>

Patches 3-5 applied now. Thanks!