From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796538371; b=PhTk42mn4/dcOhtLrJohF/OZWEpPFe3WytVuhrl+bRtAytVa8rWQGoy3MrI2ohmGPCVK TEs1+x920u5DGf64BoKwUPHpXl2ne4ZWUHN0tdeahNZpCnk7konSGOlfymHlUXpU2MofJ /gPF0V7vJrcNT/5POlP6p954c9Vw6bopV+sAwggBathtVFIMCR/apXLgs4fjr62VAW8nd 1EPTikYkC9uojZnZ5GYNHqR4AGt5yTrmI39LyRUQhYCX+y9GVpkXad6+1sZNGTSsAnY2H iJI15dAwUFjHdKVCmvHg7oXdfw4LPsZzw3UfUZI1VrgGnziETi3zag53d/NtRq++HEQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796538371; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=xw4JCu17px6709Yw/AFCHV0uXAZOrirs2DQGWcQvWQU=; b=1G5gqooTWdN20HJ+WTLuG152NxdoYAnmLrN/dsffrFPmNFahJLUfTXiPYkTo7FTPIuCn vrJ4S7nyY/FmLaQcFaKL3oxD7AqZK4VyDyppiBT45SuPQMPsEQX/nOex0WANhwo3FVJYa 9rlWkk9WwPlyc50DqWzlv8RdT5BZ/4nLdOBN0wsuGxC7piYL/pk2W3KBUmWSeXIeyMT+u pA8cN2PRMO8wO5d4sVDnUMovK/LXVZqXz13MdACmFkE4WxJ57+Y8tOW8ifeDNzzMEzNpV d+PvVK01u4qubgAwGzquUTImaDJsDyHMsL6hdUqlBa64O1dceMWbEzvcqkEtnV6gIfQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WVt7sbkj; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6221606A31F for ; Sun, 6 Dec 2026 06:26:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WVt7sbkj Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B6481F0093B; Sun, 6 Dec 2026 06:26:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796538371; bh=xw4JCu17px6709Yw/AFCHV0uXAZOrirs2DQGWcQvWQU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=WVt7sbkj4Sj0hXXwfOjYnxkuiQgxBIhanwiUKWpZPuP1iM/p9vVCymENvli1HGWPi z36EF56r1aCYencJKxPCQXVreRwiLkSnwCPLzBvYooACzp2y6lUUH4g1EFnF5wvFJb 1jdQQ6MIbBpBzNtoAnBMS3hThnDE30+RMw3Qwj+fTwBCoA79C8OHwdSaSFtIjpwrNq 5XDLXJMbdEs0WaloTbI/2wIcPDW72/wvlsSflWx7r3ZyscYVwHmoE2IeXMRB3TbOHo M6yeFowUkbB2fWJaeEhd4FKQD8kObTcy7SyDAi6rIXZumOMDU4/8DqvluiOQC7HoGY Vp62zFOiGOd3A== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v4 13/18] arm64: dts: rockchip: Add the reset lines of the RK3588 VEPU121 cores Reply-To: sashiko-reviews@lists.linux.dev To: "Arun Iyengar" Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org, media-ci@linuxtv.org In-Reply-To: <20261206-hantro-robust-v4-13-b99d33a5ec6d@gmail.com> References: <20261206-hantro-robust-v4-0-b99d33a5ec6d@gmail.com> <20261206-hantro-robust-v4-13-b99d33a5ec6d@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 06 Dec 2026 06:26:10 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [High] media: verisilicon: unsynchronized VEPU121 reset races with IOMMU/IRQ MMIO - [High] media: verisilicon: unchecked iommu_detach_device() allows IOMMU bypass -- commit ff9dbdd5b26a4614c8a544216f4d70394108c463 Author: Arun Iyengar arm64: dts: rockchip: Add the reset lines of the RK3588 VEPU121 cores This commit adds the AXI and AHB reset lines to the four VEPU121 JPEG encoder nodes (vepu121_0 through vepu121_3) in rk3588-base.dtsi. > diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi b/arch/arm64/b= oot/dts/rockchip/rk3588-base.dtsi > index aa69fd3793fd6..227465d446a29 100644 > --- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi > +++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi > @@ -1325,6 +1325,8 @@ vepu121_0: video-codec@fdba0000 { > clock-names =3D "aclk", "hclk"; > iommus =3D <&vepu121_0_mmu>; > power-domains =3D <&power RK3588_PD_VDPU>; > + resets =3D <&cru SRST_A_JPEG_ENCODER0>, <&cru SRST_H_JPEG_ENCODER0>; > + reset-names =3D "axi", "ahb"; > }; > =20 > vepu121_0_mmu: iommu@fdba0800 { [Severity: High] Can adding these reset lines trigger an unrecoverable SError panic if hantro_watchdog() resets a VEPU121 core while concurrent MMIO accesses are in flight? Populating resets on vepu121_0 through vepu121_3 activates rockchip_vpu_enc_hw_reset(), which asserts the shared AXI and AHB resets while the core and vepu121_x_mmu are still runtime-active. Another V4L2 context mapping or unmapping a buffer can access the IOMMU in that window: CPU0 (kworker) CPU1 (V4L2 thread) hantro_watchdog() rockchip_vpu2_enc_reset() rockchip_vpu_enc_hw_reset() reset_control_assert(...) udelay(5) rk_iommu_map() ... rk_iommu_zap_iova() pm_runtime_get_if_in_use() rk_iommu_zap_lines() <-- MMIO in reset reset_control_deassert(...) rk_iommu_irq() is likewise not quiesced before reset_control_assert(), and rockchip_vpu2_enc_reset() masks VEPU_REG_INTERRUPT without disable_irq() or synchronize_irq() against an in-flight rockchip_vpu2_vepu_irq(). MMIO accesses to either block while its bus resets are asserted can cause an unrecoverable SError panic on RK3588, the same failure mode noted in commit "media: verisilicon: Don't hold the VPU in reset after remove". [Severity: High] Can a failed default-domain re-attach in hantro_iommu_restore() leave vepu121_x_mmu in bypass mode with vpu->iommu_lost still false? Enabling resets on vepu121_0 through vepu121_3 activates hantro_iommu_restore(), which checks iommu_attach_device() for empty_domain but then calls void iommu_detach_device(). That re-attaches the default domain through __iommu_group_set_domain_nofail(). Because the CRU reset leaves IOMMU paging disabled, the empty_domain attach skips stalling in rk_iommu_enable_stall() and enables paging. The re-attach inside iommu_detach_device() is the first transition that must stall, reset, and re-enable paging in rk_iommu_attach_device(). If rk_iommu_enable() fails there, rockchip-iommu reverts the device to rk_identity_domain (paging disabled) while __iommu_group_set_domain_nofail() only emits a WARN_ON and drops the error. hantro_iommu_restore() then returns 0 with vpu->iommu_lost still false, defeating the guard from commit "media: verisilicon: Reinitialize the IOMMU after resetting an encoder core". Later VEPU121 jobs then issue untranslated DMA with IOVAs treated as raw physical addresses. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261206-hantro-rob= ust-v4-0-b99d33a5ec6d@gmail.com?part=3D13