From nobody Sun May 10 07:13:35 2026 Received: from mail.manjaro.org (mail.manjaro.org [116.203.91.91]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 262A81F5433; Fri, 27 Dec 2024 15:42:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=116.203.91.91 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735314163; cv=none; b=gNVVDLzHCov3/4D3/Ml+CxpRYQTbvafkdV5ISsjKT33PrlmkWh3Q48HXBO2JsEeQ/2c4XzKJ0/Mv4qyh0M67lqhGuhTVJ2Yk7j1m1ozzpC5YLJQVtAXmA5tlZyBXmha1AUWqAELDo7e6P3VHFbvDG13sT95k9n2WPY5RdA07+Ws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735314163; c=relaxed/simple; bh=8mRE4En6RhYiVT8i+Ue7qQwG8+2GFsQ9myuHHur+b6g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VvKx/2b+IdMrojm+jhM9K/dzpwz8A2mAcLcHSZPQuO7e+j0jH8kPybG3yuaQc8p8W5UFm887AnwRxq7wyOa5WdHRYOt+4COLOhtWo6YASGClO2Im+ISrmRbaIlYBjr0eWOU04ksV6xK/3A+SWqSYsa+Mno+CS6YpoV/ltMYi2aM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manjaro.org; spf=pass smtp.mailfrom=manjaro.org; dkim=pass (2048-bit key) header.d=manjaro.org header.i=@manjaro.org header.b=nyx6qur0; arc=none smtp.client-ip=116.203.91.91 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manjaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=manjaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=manjaro.org header.i=@manjaro.org header.b="nyx6qur0" From: Dragan Simic DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1735314158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fpAoN691ZMq93DDFamwdYsr4hx8aHUG0+VLaMt58XnA=; b=nyx6qur0Mtqhp/NKCI8DlvrPDj77GRamoTO4n2Kl+Lzrh6yjlT07t9r35Ahyuv0Q9uR8+y XGWuAqw/teJHX1yPhBNErnfBlf5lKTBfF/vwwFYENrEVW9eiF2ViYcB0mHOVI25H3OUm1g DivoLe4jeA+jmgYUZ8V0uTBnczrgfFDll2IQOagt+vFVvfpsA0jenPavvAPO8biFddZkBf vlN/ko5lCRTydOgrkN1PBU+yhFLRBtMg+8LsgCxE9yvIB5BGW4C1G2/o3Wqw7qFaAUUNeG K0yY2HMPB8F8lKzRGVkgwdg4bbIXT9bM7Qj0+cCj0skVDexnWFQy7HiaEOGMmw== To: linux-rockchip@lists.infradead.org Cc: heiko@sntech.de, maz@kernel.org, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, FUKAUMI Naoki Subject: [PATCH 1/2] arm64: dts: rockchip: Use "dma-noncoherent" in base RK3588 SoC dtsi Date: Fri, 27 Dec 2024 16:42:23 +0100 Message-Id: In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org Content-Type: text/plain; charset="utf-8" The preferred way to denote hardware with non-coherent DMA is to use the "dma-noncoherent" DT property, at both the GIC redistributor and the GIC ITS levels, [1] instead of relying on the compatibles to handle hardware errata, in this case the Rockchip 3588001 errata. [2] Let's have the preferred way employed in the base Rockchip RK3588 SoC dtsi, which also goes along with adding initial support for the Rockchip RK3582 S= oC variant, with its separate compatible. [2][3] [1] Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml [2] https://lore.kernel.org/linux-rockchip/86msgoozqa.wl-maz@kernel.org/ [3] https://lore.kernel.org/linux-rockchip/20241222030355.2246-4-naoki@radx= a.com/ Cc: Marc Zyngier Cc: FUKAUMI Naoki Signed-off-by: Dragan Simic Acked-by: Marc Zyngier --- arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi b/arch/arm64/boo= t/dts/rockchip/rk3588-base.dtsi index d97d84b88837..bd2385b6bd7f 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi @@ -1972,27 +1972,30 @@ &i2s3_sdi =20 gic: interrupt-controller@fe600000 { compatible =3D "arm,gic-v3"; + dma-noncoherent; reg =3D <0x0 0xfe600000 0 0x10000>, /* GICD */ <0x0 0xfe680000 0 0x100000>; /* GICR */ interrupts =3D ; interrupt-controller; mbi-alias =3D <0x0 0xfe610000>; mbi-ranges =3D <424 56>; msi-controller; ranges; #address-cells =3D <2>; #interrupt-cells =3D <4>; #size-cells =3D <2>; =20 its0: msi-controller@fe640000 { compatible =3D "arm,gic-v3-its"; + dma-noncoherent; reg =3D <0x0 0xfe640000 0x0 0x20000>; msi-controller; #msi-cells =3D <1>; }; =20 its1: msi-controller@fe660000 { compatible =3D "arm,gic-v3-its"; + dma-noncoherent; reg =3D <0x0 0xfe660000 0x0 0x20000>; msi-controller; #msi-cells =3D <1>; From nobody Sun May 10 07:13:35 2026 Received: from mail.manjaro.org (mail.manjaro.org [116.203.91.91]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 263061F6695; Fri, 27 Dec 2024 15:42:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=116.203.91.91 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735314162; cv=none; b=YMhq8KZ00pmPBSkOhVieZxuoP5Ug5+h5MngcblmtYTQ4+hTXx5Oq5cSLBHRDnsAz8a8sPsJlZmwDoW/P+3/f1LEgqwBU+OnzFQasemQ5UnrhxzXLUJzizVNfz0KjXcqVc4hxzoPcrt122v9hhmrSl3tJtLkiREY9VFrm2Fn0hSY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735314162; c=relaxed/simple; bh=+w+RyXTBnHGMuhhpgvR4mMSLHUZznN0bRTn188jONWM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ckyMKLg9bLNdAaQABvB1qO8UTXSHtz5Mt2hTnaez5nO+0o0Q8+LRXNhNS8PiGdJVnVvJ1dn9Dt9TtBQtDkqt7i3GgZEVzAOiIbZR8jw3FQtkfc3fvUUinvRT6GzoT8mZ8SCtTfCzbUJ0abDWDD5MEQQ27uaXQiLRmEcpSBojlA8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manjaro.org; spf=pass smtp.mailfrom=manjaro.org; dkim=pass (2048-bit key) header.d=manjaro.org header.i=@manjaro.org header.b=Hzek+HOk; arc=none smtp.client-ip=116.203.91.91 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manjaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=manjaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=manjaro.org header.i=@manjaro.org header.b="Hzek+HOk" From: Dragan Simic DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1735314159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hEcBR6l6UHxeka28jkp0UZiIrR1TObruGMZ44Ym9TOY=; b=Hzek+HOkJN6awql/zr3rwIK5vauxfOdCwUiq71REymTIdas9uTUCZv/nQC4fKvoMBc3ksC oYmBuEnqv/ZbPK6irBg1nux6LBzfxruPknzCMTNaMq9JiRYE3xwbCLncqFNbW1jjJbSj+r 2xfITBVgS/gU5DxjRN4gjTQWOk2ECd1fr0rZxPy7b68irXuH8iUCgJHCTQKNqbW4O/EJzH CUjcEC/44EZAoLOGqsX2ZfZDX92E8ELjdqxpkVymD77NXLRm2ihVXTaVldSeJCFuDsgm5F cf48A1+f2/iBZKLelZ6SBckIkakAPu393tiz7l4ASqoLz1NwkBykgDpPS5UzaQ== To: linux-rockchip@lists.infradead.org Cc: heiko@sntech.de, maz@kernel.org, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, FUKAUMI Naoki Subject: [PATCH 2/2] irqchip/gic-v3-its: Make "dma-noncoherent" preferred for RK358x errata Date: Fri, 27 Dec 2024 16:42:24 +0100 Message-Id: <1382cd99ec213b5fb6f3b23d4e895f078f587b8f.1735313870.git.dsimic@manjaro.org> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org Content-Type: text/plain; charset="utf-8" The preferred way to denote hardware with non-coherent DMA is to use the "dma-noncoherent" DT property, [1] instead of relying on the compatibles. [= 2] Alas, older versions of the Rockchip RK3588 and RK3588S SoC dts(i) files failed to specify this DT property, which means that checking the compatibl= es remains required for backward SoC dts(i) compatibility. Let's have the Rockchip 3588001 hardware errata handled the preferred way, with newer versions of the Rockchip RK3588, RK3588S and RK3582 SoC dts(i) files that properly specify the "dma-noncoherent" DT properties at both the GIC redistributor and the GIC ITS levels, while falling back to checking the compatibles for backward RK3588 and RK3588S SoC dts(i) compatibility. [1] Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml [2] https://lore.kernel.org/linux-rockchip/86msgoozqa.wl-maz@kernel.org/ Cc: Marc Zyngier Cc: FUKAUMI Naoki Signed-off-by: Dragan Simic --- drivers/irqchip/irq-gic-v3-its.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-= its.c index fdec478ba5e7..982dcbb30f39 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -4747,6 +4747,18 @@ static bool __maybe_unused its_enable_rk3588001(void= *data) { struct its_node *its =3D data; =20 + /* + * The preferred way to denote hardware with non-coherent DMA is to use + * the "dma-noncoherent" DT property, which the older RK3588 SoC dts(i) + * files failed to specify, relying on the compatibles instead. + * + * Thus, check for the presence of "dma-noncoherent" DT property first, + * to let the hardware quirk be handled the preferred way, and fall back + * to checking the compatibles for backward dts(i) compatibility. + */ + if (!of_dma_is_coherent(to_of_node(its->fwnode_handle))) + return false; + if (!of_machine_is_compatible("rockchip,rk3588") && !of_machine_is_compatible("rockchip,rk3588s")) return false;