From: Tim Surber <me@timsurber.de>
To: Heiko Stuebner <heiko@sntech.de>
Cc: Tim Surber <me@timsurber.de>,
Chaoyi Chen <chaoyi.chen@rock-chips.com>,
Cristian Ciocaltea <cristian.ciocaltea@collabora.com>,
Sandy Huang <hjc@rock-chips.com>, Andy Yan <andyshrk@163.com>,
Andy Yan <andy.yan@rock-chips.com>,
Sebastian Reichel <sebastian.reichel@collabora.com>,
Daniel Stone <daniel@fooishbar.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Nicolas Frattaroli <nicolas.frattaroli@collabora.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
kernel@collabora.com, dri-devel@lists.freedesktop.org,
linux-rockchip@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2] drm/rockchip: vop2: Reset the AXI master after detaching the IOMMU
Date: Wed, 2 Dec 2026 21:00:35 +0100 [thread overview]
Message-ID: <20261202200037.309413-1-me@timsurber.de> (raw)
Asserting the AXI reset in vop2_disable(), while the IOMMU is still
attached, can hang RK3588 hard when buffers are mapped into or unmapped
from the VOP's IOMMU domain at the same time, e.g. when a KMS client
exits and fbcon takes the display back.
Assert the reset after the IOMMU is detached instead. Mapping and
unmapping buffers then no longer goes through the VOP's IOMMU, so it
cannot race with the reset.
Fixes: 67a391e50271 ("drm/rockchip: vop2: Reset AXI and DCLK to improve robustness")
Signed-off-by: Tim Surber <me@timsurber.de>
---
Changes in v2:
- Keep the reset in vop2_disable(), after the IOMMU is detached, instead
of moving it to vop2_enable() (Chaoyi Chen)
- Link to v1: https://lore.kernel.org/linux-rockchip/20261125204511.2867433-1-me@timsurber.de/
Reproducer, as root on RK3588 with a display on HDMI and fbcon on it:
python3 - <<'EOF' &
import fcntl, os, struct
fd = os.open("/dev/dri/by-path/platform-display-subsystem-card", os.O_RDWR)
try:
fcntl.ioctl(fd, 0x641F) # DRM_IOCTL_DROP_MASTER: leave KMS to fbcon
except OSError:
pass
while True:
b = bytearray(struct.pack("6IQ", 2160, 3840, 32, 0, 0, 0, 0))
fcntl.ioctl(fd, 0xC02064B2, b) # DRM_IOCTL_MODE_CREATE_DUMB
handle = struct.unpack("6IQ", b)[4]
fcntl.ioctl(fd, 0xC00464B4, struct.pack("I", handle)) # DRM_IOCTL_MODE_DESTROY_DUMB
EOF
while :; do
echo 4 > /sys/class/graphics/fb0/blank; sleep 0.3
echo 0 > /sys/class/graphics/fb0/blank; sleep 0.7
done
Tested on a FriendlyElec CM3588: without this patch the board hangs
within about a minute; with it, 300 blank cycles ran without a hang.
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
index 76d151b8bc52..539181570127 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
@@ -973,10 +973,11 @@ static int vop2_enable(struct vop2 *vop2)
static void vop2_disable(struct vop2 *vop2)
{
- vop2_reset_assert_deassert(vop2, vop2->axi_rst);
-
rockchip_drm_dma_detach_device(vop2->drm, vop2->dev);
+ /* Resetting with the IOMMU still attached can hang the SoC */
+ vop2_reset_assert_deassert(vop2, vop2->axi_rst);
+
regcache_drop_region(vop2->map, 0, vop2_regmap_config.max_register);
vop2_core_clks_disable_unprepare(vop2);
base-commit: 479e381e77dcde0dfcc9d51e89ff3273da199804
--
2.55.0
reply other threads:[~2026-12-02 20:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261202200037.309413-1-me@timsurber.de \
--to=me@timsurber.de \
--cc=airlied@gmail.com \
--cc=andy.yan@rock-chips.com \
--cc=andyshrk@163.com \
--cc=chaoyi.chen@rock-chips.com \
--cc=cristian.ciocaltea@collabora.com \
--cc=daniel@fooishbar.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=hjc@rock-chips.com \
--cc=kernel@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nicolas.frattaroli@collabora.com \
--cc=p.zabel@pengutronix.de \
--cc=sebastian.reichel@collabora.com \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox