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 2F07B606A31C for ; Mon, 30 Nov 2026 02:05:00 +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=4gq8v8ZQ; dkim=pass (2048-bit key, unprotected) header.d=gahingwoo.com header.i=@gahingwoo.com header.a=rsa-sha256 header.s=fm2 header.b=jk2ZToKi; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=PRlLgMeF 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: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=/WcThih9kPoG93g21Gz1lZM76fDeBKGf+vUxDg0Au0E=; b=4gq8v8ZQIDBaCr H8vjGTteDKth7TFtc8ejiJUt+hNeWVuXpuyNYhpG3UtGERXXcav26aHY4qfKTQhlc3jzbloIB3s02 k/pg+K8nIKw/Ac2tvhmroP+nXFteft3/6YNnW6yVaFAKWng2VNBL8Oc5YAT3Lsu9QhNPHOIh3KA9+ w38xr6TcaezPka2J4THcBfpMq++f381yTDChJSlpIOPMKSfFeuyzO8dPt0Qw/En3j8iG+Nneq4Tgj w4S3aMF3HoqzMeJkMTRZcPzDaKoy/++Zuff2gY5qcudV6hRKRFtEQS76wp3zBJgNiyhpZ/wVrlgNw lYrHg8hsCUGhYNn5jH1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXql5-00000002tJt-3JLN; Mon, 30 Nov 2026 02:04:47 +0000 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXql0-00000002tIb-3bQh for linux-arm-kernel@lists.infradead.org; Mon, 30 Nov 2026 02:04:46 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id D97627A051F for ; Sun, 29 Nov 2026 21:04:41 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Sun, 29 Nov 2026 21:04:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gahingwoo.com; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm2; t=1796004279; x=1796090679; bh=/WcThih9kPoG93g21Gz1lZM76fDeBKGf +vUxDg0Au0E=; b=jk2ZToKiVfhjyRD8NGd1iPSf+I84tot9+P6vMo6lq1UWcGGB azGj4XA9YIiHKgs7PWembKdA+ZbHgjxl4AnVMSrIoMWgEyBOWHHeDoIqGs+iwoWC JKRhF8pPHJ0NwUaIlNuFkNfsvquJxpQZOew7AzNyT56yMIJlwlaLOypuZMe/TR7m ftqFlfjuLdSc69alo5e0+1dNJDD9/cmOrOSyLQokrQzutyCO61VToFzyoU+xdFV4 K8rXyygY1PScCFnCeRxSlj48qWh844YKozJx4VxG9eiE8MZvuVlRkXla3A4tVjlT eGfViGCCiNUciWlsW/QX7NbFBTouSyKrWJm+Jg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1796004279; x= 1796090679; bh=/WcThih9kPoG93g21Gz1lZM76fDeBKGf+vUxDg0Au0E=; b=P RlLgMeFbgfmGi5SM2+rTOie4lZR0c0N1j7gQ8fgLflVnrrHt8rrkVi5k3gXhLBIP AziNrbxJSNcWw8OIj5r968ggochn+bHfI5Ohege1B5NvREsEajBvyrG4vZG+psIt 9Omskmcd1e9ru48cvw1EWxqdY6GiHIWMfC3zlz4idXOr9DVvPf3ArnMeR4ow/LT5 PBmGAwxqku6eSCck+BHnSEpb9LrrURvlQ9YU7M8InUxxxOxDqA/znVRfhctV//4w ok7xLhyjAtxH6DiVAGe9bXZpzdKKwnahmf8fkbRJj9EZzgIqb13KX+lptWEhchwS Lo7IcIAS8TRkEMnm7X5OQ== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=gahingwoo.com a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796004279; d=gahingwoo.com; mf=PGdhaGluZ0BnYWhpbmd3b28uY29tPg==; rt=PGxpbnV4LWFybS1rZXJuZWxAbGlzdHMuaW5mcmFkZWFkLm9yZz4=; s=fm2:rsa-sha256:C4PyPxOEYMBQk16/FM5H1dbe4cMuEGOUGGSFRQNCcJEiQ1+ Ue4UEzxcVRdpTeWGF/OG8DkPR8kK8sjGyTXU/4WaAVNG4ta1/y4WFxFVudSo3A6d WhX82Xfva09CDxYAjeiy/+gh1OOXpFBGpoXoQUjjxCpwlC7FsFfmJVhTMcFgx11b 4TulR1gGtI/jeoMR8xiUibqXDNvpnpAcH6bsRBg2YDwZ1UwUxMIvRXB3H3fyJywc yv/nAFr3tv0i4HH20ZwhdnRjXiYlolq7JYgJuAjnBgRqtp3gJXuXdQNU8sFPI54o Z9Q4+fgCRYkxvxkkU8rhlADq5O+f9jtPDF3atRw==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-transfer-encoding,content-type,date,feedback-id, from,in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:C9eUxrLekGFJ3vmKYkvC/U4ZldDbgq9JoGNdxcVH4os=:HuTepuSa8MFfnT0DNZca5jzJ0gWd6wrf3+3+j5GHxM8=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEQFLNEiU+eHOq6GyvtVz8tr2A4v3Vu27rUi/q/6o8kq9va1scR+fk0jqg+ddvYvD 7djozbQAEaiRSkAMqvxKbiGa8QjpyyMnSbICXeWmKdts/jh0BlRvZTSXEc1UcKvfG0KdpK YJPErh9iPAxxKfBgIR1AGaQL9Qa468hxTBkh1GMLYLP7sS6G4F0llbeKKwSgmnnTEa7FPT GF7632z+xynFAdlO/F1cyk71Ic04v0/v/Xry2e3nPbG/r2lB/vxAsfdyZ984LL7HK6/vNO D0bmw8T++Orahd6G6LQHTQGfHJNiyorb7JYtS1H8P8uAwJEkQVFdrvDFe+8ozJZSRm2lft dei7X5i1tA4Oj7lNKzu8gW8wriOuA93pHVBvxYAnH+/PD69xwhx6MKm2Dx1B9rNk0R/KDl CH6Bdo0AThouY4CSRyZx5dSD+vGiIVA4v+KfbzwvplMtstyjPqaDa8xNMQiJbNNYrbHlkn IfSbDLbIuNhebqU7IhFmJTP0RFcFys9K/M6NOJQR3HtvGqAIauRBwT0Rr+4c6uv/g0+SFw 86eGf5Sz1HLCrlHA+jUFRMvdq2b1oSJSoyGDu31fPR6LiKtw2JaT34maRnRDOZUNxxce4O vhtZ+yT+m4YGzhzMWnrNBiUZl9LL67eTjMUe33VxDz32HaNZCWXGRWBytLBA X-ME-Proxy: Feedback-ID: i7a5e4b5f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 29 Nov 2026 21:04:33 -0500 (EST) From: Jiaxing Hu To: Chaoyi Chen Cc: Francesco Saverio Pavone , Joerg Roedel , Will Deacon , Robin Murphy , Heiko Stuebner , Sandy Huang , Andy Yan , Damon Ding , Jagan Teki , Lucas Tanure , Sebastian Reichel , Cristian Ciocaltea , iommu@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: rk3588: VOP IOMMU faults at boot while the firmware window is on Date: Mon, 30 Nov 2026 15:04:31 +1300 Message-ID: <20261130020431.487169-1-gahing@gahingwoo.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <1c5a8286-d61f-4c7c-b2ff-33aac9018abe@rock-chips.com> References: <16FDB47B-9986-417E-B081-89A381BE9411@gmail.com> <20261129100436.290926-1-gahing@gahingwoo.com> <47C82988-469A-4998-97EE-1D7E770C4EFB@gmail.com> <1c5a8286-d61f-4c7c-b2ff-33aac9018abe@rock-chips.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261129_180443_055776_E5A17A9D X-CRM114-Status: GOOD ( 16.36 ) X-Spam-Score: -2.1 (--) 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=-13.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,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 Hi Chaoyi, On 11/30/2026 9:49 AM, Chaoyi Chen wrote: > For clk_ignore_unused and pd_ignore_unused, see this series: > > https://lore.kernel.org/linux-clk/20260626-clk-sync-state-v1-0-4156d8196dc8@redhat.com/ Thanks, that explains why the module case only stays clean by luck of timing. > This looks more like some kind of hack. > Why not just use iommu_map() to establish a 1:1 mapping? That is actually what I ended up doing in my Windows display driver on RK3576 [1]. Before enabling translation in the VOP's IOMMU, it maps the firmware framebuffer pages 1:1 at their own physical addresses so the active scanout window keeps hitting valid memory once paging turns on. I've had this enabled by default since Nov 21. Here is the relevant snippet from scanout.c [2]: /* at load: the firmware framebuffer at its own address */ for (ULONG64 p = fb & ~0xFFFull; p < fb + A->FbSize; p += PAGE_SIZE) if (!Enter(A, (ULONG)p, p)) goto fail; /* later, with the window still scanning: tables in, paging on */ ULONG dte = Entry((ULONG64)A->ScanTablesPa.QuadPart, 1); for (ULONG m = VOP_MMU0; m <= VOP_MMU1; m += VOP_MMU1 - VOP_MMU0) { W(A, m + VMMU_DTE_ADDR, dte); W(A, m + VMMU_COMMAND, VMMU_CMD_ZAP_CACHE); W(A, m + VMMU_INT_MASK, 0); W(A, m + VMMU_AUTO_GATING, R(A, m + VMMU_AUTO_GATING) | 0x80000000u); } W(A, VOP_MMU0 + VMMU_COMMAND, VMMU_CMD_ENABLE_PAGING); W(A, VOP_MMU1 + VMMU_COMMAND, VMMU_CMD_ENABLE_PAGING); Looking at rockchip_drm_drv.c, the domain gets allocated in rockchip_drm_init_iommu() and the VOP attaches to it during bind. Calling iommu_map() for a 1:1 mapping of the firmware framebuffer right before that first attach should keep the live window happy. On EFI boots the address would have to come from screen_info, since there is no simple-framebuffer node, and it would need checking against the window the VOP is actually scanning before it is trusted. One gotcha I ran into on the Windows side: the 1:1 mapping has to outlive the initial modeset. The VOP keeps scanning out from the old address until the next frame start, so tearing down the entries right after programming the flip triggered the exact same 0x40b fault. Any unmap on Linux would need to wait until the next vblank after the window actually switches over; in my driver, I just leave the entries mapped. Here is the note I left myself when debugging it [3]: /* The entries stay. The window moves at the next frame start, and * until then the VOP2 is still reading this primary: with the entries * cleared it faulted (IOMMU status 0x40b, seen when dwm.exe was ended * a dozen times in a row). */ Francesco, thanks for running those module tests. Good to confirm it's the power domain rather than the clocks. In the meantime, I'll go ahead and quiesce the HDMI path in my firmware the same way I did for DSI until a proper kernel-side fix lands. Thanks, Jiaxing [1] https://github.com/gahingwoo/wddm-mali-g52 [2] https://github.com/gahingwoo/wddm-mali-g52/blob/906abc21eda0/drivers/maliwddm/scanout.c#L213-L216 https://github.com/gahingwoo/wddm-mali-g52/blob/906abc21eda0/drivers/maliwddm/scanout.c#L636-L648 [3] https://github.com/gahingwoo/wddm-mali-g52/blob/906abc21eda0/drivers/maliwddm/scanout.c#L607-L612