From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF213606A321 for ; Wed, 25 Nov 2026 20:45:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=CH8KKz8M; dkim=pass (2048-bit key, unprotected) header.d=timsurber.de header.i=@timsurber.de header.a=rsa-sha256 header.s=MBO0001 header.b=MuC/HUpP DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=wFxbp9GWj8PRFEAiH5lFdlGEgH2PeiEbxgFBhgBZw8s=; b=CH8KKz8Mtgj05uPS4JgYdrKnIs I7uD2swbKorRfNE/3UpfwH9BpXyHrASnKPpw9ZkHk4daVZLARDUNS2GbDkG8M9gFx+ib10cWwOCX5 Dv3rbYi/w5wM6MA+LeEAENDr6auTUijjQT83/J1k3rv/UzF2mEqkaKPVv4lIGgV3BD1TGTH2QPSh+ KeZkvj2JSVWIUSUORIVHznGqyQlWfEmzG+GZibgDicgKN5+pBf5J442cQaDVGJ20xO9dxB5NPjPBt C/hmUjdMqe/M+Pzlt5p8naycSLgE/+RUSMPKlLwt9h9C7lP4etHIJODARXCU2L/jz/OlmT6VV/hwJ QUWARaaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xWJs3-0000000BIrD-3OKo; Wed, 25 Nov 2026 20:45:39 +0000 Received: from mout-p-202.mailbox.org ([80.241.56.172]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xWJrz-0000000BIqd-3qDu; Wed, 25 Nov 2026 20:45:37 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4jZWsQ2xwvzMlvw; Wed, 25 Nov 2026 21:45:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timsurber.de; s=MBO0001; t=1795639530; 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; bh=wFxbp9GWj8PRFEAiH5lFdlGEgH2PeiEbxgFBhgBZw8s=; b=MuC/HUpP+Qth1WdDD2K+Gla4bENN0jDjBLcnQT6FyWtM9x2rxJyd83UKS4U5UNTo/5Ugc2 5cw6wXtLKcaB1olb9XQeNaACNsIUvuFMr+LYppqgOppzNe/9NglaLe6T9hOrjzYV1gr3u3 OnWcpqazZWpu2Rh5NuNtDwyw3wxsU1Np9oiW+S/4zHYCNn7RY25LGq2I+ySeFFp8EvikJ+ K1CH8oHhOTsk8BSeZQTSkpN8ysfDPIg9lNK8FRWp6currzWHDZiW+RKgSEE91XpFCaZcK+ ybq2sB/Np2G5NwHfWhO1dPWsdf0hGWolgoyUZMAeBrBr1/NpNfhkXsdYi/5qaQ== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of me@timsurber.de designates 2001:67c:2050:b231:465::202 as permitted sender) smtp.mailfrom=me@timsurber.de From: Tim Surber To: Heiko Stuebner Cc: Tim Surber , Cristian Ciocaltea , Sandy Huang , Andy Yan , Andy Yan , Sebastian Reichel , Daniel Stone , Philipp Zabel , Nicolas Frattaroli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , 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] drm/rockchip: vop2: Reset the AXI master in vop2_enable() Date: Wed, 25 Nov 2026 21:45:08 +0100 Message-ID: <20261125204511.2867433-1-me@timsurber.de> X-Mailer: git-send-email 2.55.0 X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4jZWsQ2xwvzMlvw X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261125_124536_412148_8A03E0CE X-CRM114-Status: GOOD ( 14.53 ) X-Spam-Score: -2.8 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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. Do the reset in vop2_enable() instead, before the IOMMU is attached, where the AXI master is idle. Fixes: 67a391e50271 ("drm/rockchip: vop2: Reset AXI and DCLK to improve robustness") Signed-off-by: Tim Surber --- On my RK3588 board (FriendlyElec CM3588) the AXI reset in vop2_disable() sometimes hangs the SoC hard when the last CRTC is switched off. Without the reset there, it does not happen. Here is a minimal reproducer. Run it as root, 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 Without this patch the board hangs within a few blank cycles. With it, 300 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..a86ac9173aac 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -913,6 +913,9 @@ static int vop2_enable(struct vop2 *vop2) if (ret) goto err_put_pm; + /* Reset while idle; doing it in vop2_disable() can hang the SoC */ + vop2_reset_assert_deassert(vop2, vop2->axi_rst); + ret = rockchip_drm_dma_attach_device(vop2->drm, vop2->dev); if (ret) { drm_err(vop2->drm, "failed to attach dma mapping: %d\n", ret); @@ -973,8 +976,6 @@ 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); regcache_drop_region(vop2->map, 0, vop2_regmap_config.max_register); base-commit: 479e381e77dcde0dfcc9d51e89ff3273da199804 -- 2.55.0