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 9DFF7606A322 for ; Fri, 4 Dec 2026 06:24:37 +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=cBDUTD7K; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=gX/3Qyjr 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=2lppYAAK9w0VpOSI6NPBhMAeE06J2JhCezctDOYzHLw=; b=cBDUTD7K9X1iJWODy7z2ZxNkbg 0Hqht0UX+Pv6juS81yRBAlYCzfhkskwpH/f1yFvq8QQF7QN215pFGTKeCS2F4j8xNYbi9Tpd0z8dS ypUHVh77ukWpDc3UWgz6xRL4N7Wq/tS7QBFvDDxmXiLGiKZsdhVM8arw0Qtaj5/WjjyTuLAhdn63q kmKdzcNpcCZkxaaIytPIjxUFnsp5uLBgCuhhqXEIKvyM24wLKfoPijvv1ZCB985I+lalewRW513OV EMWLvJ7oapriIDR4fZtnHP8doywHWgi1Q+0+IMFimKi5Xc46Q6Ul6/YQbqX5zTrB9Q7kqERzscVfO 5xpoigvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZMib-0000000Gmme-1kwO; Fri, 04 Dec 2026 06:24:29 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZMiV-0000000GmkL-1z6M for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2026 06:24:28 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4bb6adaf0f1so3744215e9.0 for ; Thu, 03 Dec 2026 22:24:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796365462; x=1796970262; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=2lppYAAK9w0VpOSI6NPBhMAeE06J2JhCezctDOYzHLw=; b=gX/3QyjrSAzF67WZd9k+zbb9l2/M21aT7mis68J928YV+LgLI51irHOtIkF0bzEqxz oZ9l0D+lyDTeYbbOe/3Mf0RHwRvpEqWi02Xr34mPEyUaSFlM1jovuuyrDHo2oJtUKdGT +NrwB5gfVZQr+XtuXgLuUp8NTG0iuUeGN08TVo9epJg6PPq4IJ+7oPSS+rHzbXoduEjq Ou2m/QtOHQVmWZXVzyNuYe62Q9AkOaTdT/kLsM5SubjwHRoUMYm85eMh/lRWVDN17SzD /QcIhh45pUbVJ29CXZK1ViBQXunOP/YMOXuPSVAXLHVmlEodoEFNOeYaCP2ietkhxDwN 7r9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796365462; x=1796970262; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=2lppYAAK9w0VpOSI6NPBhMAeE06J2JhCezctDOYzHLw=; b=n28muwACVJ3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MC1dK3XTWFPO0Wp9aRRBkOx4ohLql0 /65x+pAkPaG+H+h5GtVHcsVYFeT8ncHdUdh/L5joRn1gJ+i0hPrnxH6UdAqN793sL2bKSzN/UAs 47lj5ZSMJcAvn+qVMmBySxzo+KZsMVdaKlYapxQlmNaq0sBt0xlUYYfUlLHgUKAEZA/E5SIg1u8 9qojN7cJCrCY= X-Received: by 2002:a05:600c:4e93:b0:4bb:818d:8d8f with SMTP id 5b1f17b1804b1-4bbeb8c4879mr15642085e9.23.1796365461529; Thu, 03 Dec 2026 22:24:21 -0800 (PST) Received: from localhost.localdomain ([151.43.68.108]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4d174c08b17sm3271445f8f.54.2026.12.03.22.24.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Dec 2026 22:24:21 -0800 (PST) From: Francesco Saverio Pavone To: Joerg Roedel , Will Deacon , Robin Murphy , Sandy Huang , Heiko Stuebner , Andy Yan , Chaoyi Chen Cc: Damon Ding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jiaxing Hu , iommu@lists.linux.dev, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 0/3] rockchip: keep the bootloader framebuffer mapped behind the VOP IOMMU Date: Fri, 4 Dec 2026 07:24:07 +0100 Message-ID: X-Mailer: git-send-email 2.56.1 X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261203_222426_471103_C2698739 X-CRM114-Status: GOOD ( 29.02 ) 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=-11.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,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 Hi, This is the series Chaoyi asked for in [1]. On a ROCK 5B+ (RK3588) started from EDK2 the firmware leaves one VOP2 window scanning out of its framebuffer, and the VOP MMU faults on it: first when the default DMA domain is installed with an empty page table and, with the fbdev client on, again when the VOP is moved to the private domain of the DRM driver. Patch 1 makes rockchip-iommu report the reserved regions from the devicetree, so the core maps them 1:1 in the default domain. Patch 2 lets a VOP2 node carry memory-region. Patch 3 gives the same regions a 1:1 mapping in the DRM domain and keeps them out of the drm_mm. Tested on v7.4-rc5 on the ROCK 5B+, with this node added to the board DTS by hand (not part of the series): reserved-memory { fw_fb: framebuffer@e6810000 { reg = <0x0 0xe6810000 0x0 0x00e10000>; iommu-addresses = <&vop 0x0 0xe6810000 0x0 0x00e10000>; }; }; &vop { memory-region = <&fw_fb>; }; Boots with rk_iommu errors in the log: fbdev client off fbdev client on v7.4-rc5 3 of 3 2 of 2 series, no node 2 of 2 2 of 2 series, node 0 of 4 0 of 4 The two "series" rows are the same kernel image with a different DTB. With the client off the errors are the two "Enable stall request timed out" lines at 0.2 s. With the client on the same two lines come back when the compositor starts, in all four boots, and there are one to three page faults on the firmware buffer (0xe6810000 and up), at 0.4 s and in two of the four boots again at that point. With the node, the VOP group lists the region 0xe6810000-0xe761ffff as direct in reserved_regions and the log has no rk_iommu line at all. I watched one boot with the series, the node and the client on: the TV shows the firmware logo, then the kernel console, then the desktop, and never loses the signal. Robin, on the points you raised in [2]: - rk_iommu_probe() does not touch the hardware. For the default domain the page table is first loaded from the runtime resume, when the VOP resumes through the device link, and by then the core has already created the direct mappings. rk_iommu_enable() still does a force reset first, with the window running; I have not changed that. - The switch to the DRM domain is different: it happens with the VOP active, so rk_iommu_attach_device() turns paging off, resets and loads the new table. Patch 3 has the region mapped in that table before the attach. The logs above show no fault across it, but the reset with a live window is still there. - The IOMMU starts runtime suspended and I found nothing that resumes it before the consumer link exists. On suspend the driver turns paging off, which for a 1:1 region addresses the same memory, and on resume it loads the same table again. What this does not cover, and where I would like your opinion: - Patch 1 uses of_iommu_get_resv_regions() directly, not iommu_dma_get_resv_regions(), so that patch 3 can read the regions on 32-bit ARM, where IOMMU_DMA is not there. On 32-bit ARM the core maps nothing (the default domain is the identity domain) and the ARM DMA mapping installed for the VOP is empty, so until the DRM attach nothing is mapped there. Compile-tested only on 32-bit ARM. - The region is reported as direct, so the core keeps it as a required direct mapping for the life of the device. Is that acceptable for a buffer that is only needed until the first frame? - The IOVA space is 32 bits. A buffer above 4 GiB cannot be mapped 1:1; patch 3 skips it with a warning, patch 1 does not check. - Patch 3 calls iommu_get_resv_regions() from a DRM driver, which no other driver does. Should this be a helper in the iommu core? - The mapping and the hole in the IOVA space stay until the domain is freed, because the driver does not know when the old buffer is read for the last time. - The power domain of the VOP is switched off as unused when the DRM driver binds late, as a module. The picture is lost then, whatever is mapped. I saw that on v7.4-rc4; not retested with the series. - Nothing in mainline writes the node. The address depends on the mode the firmware picked, so the firmware has to add it, the way the exynos7870 boards describe theirs for the decon. - VOP1 resets itself and turns its windows off at bind, so I left rockchip-vop.yaml alone. Not tested on VOP1 hardware. dt_binding_check is clean for rockchip-vop2.yaml (dtschema 2026.9), and so is CHECK_DTBS for the board DTB with the node added. The patches were written with Claude (Anthropic). I ran the boots above on my board and checked the logs. [1] https://lore.kernel.org/all/2148a630-6aec-40ee-9c82-3541c65e87bc@rock-chips.com/ [2] https://lore.kernel.org/all/2ea06ad1-779d-47fd-aa7a-20aba129d14e@arm.com/ Francesco Saverio Pavone (3): iommu/rockchip: Report the reserved regions from the devicetree dt-bindings: display: vop2: Allow memory-region drm/rockchip: Map the reserved regions 1:1 in the DRM IOMMU domain .../display/rockchip/rockchip-vop2.yaml | 6 + drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 121 ++++++++++++++++++ drivers/gpu/drm/rockchip/rockchip_drm_drv.h | 2 + drivers/iommu/rockchip-iommu.c | 2 + 4 files changed, 131 insertions(+) base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244 -- 2.54.0