From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796365463; b=jiqzFJdzawT7fyBEKtmBOwHmhaxRJT7Rm35KdihvwdFIAV0cD+dRGf6enAzVs++Eh00/ WGU0beuCuL80mGL6jMGYAcLnQD8xVc9oEjRPh3IyvolkzKc1Hh62X05Ls7XjNRTSUeVnG TRTWLSQ/uE4/y9yaGFeeOBvddjsL6uge2qStZEZP8JQAGKtFcCg+M+XWUwO6vTMWBjUh8 9jOkMTYaXtHhS4Y1f4cH6rhpvHl5j3raUn+QL7C4UZfvZZEXOTiG9CKDX7aKqra2ExVCr ZOacw7PCD+3qxndZnVDRerGQodNq9elxB7aaZGy837HASZRzNkX6wCShqBL7kB37IDA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796365463; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=2lppYAAK9w0VpOSI6NPBhMAeE06J2JhCezctDOYzHLw=; b=x3UnNSZisRpQxRibj1AOMtbEEPZj1wGnxfKzlS1oVPTSK8vAbk7nvG89IlLvsWepHHoJ by6hruL/HmSu9WR+7ywECH+Lj63jpME99ikzo/alRO1Fd4QKCnUOHGwEql+bh+p4KetKb 8l2dBfQOk6C81D9R3mPyAT0LWmGT9RVtATEqcwg79vAAS6IuwwqiOA5qG2kvHWvsfXeLz nFOHsEK9H/98ytbqt6OVNN2bCbPyvc3xfSQnRHQtlhetsoTnGdK4btruLe73qeqv+Y9VL LBaQ9FJNKjCB6WB+PJROWENRFQD5xkCyYM5fp3GAdMEqYJmx03YaNZIwh0TaXuPuoSQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=D5lPq3z5; arc=none smtp.remote-ip=209.85.128.51 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FC45606A32D for ; Fri, 4 Dec 2026 06:24:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1FC45606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=D5lPq3z5 Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4bb6057b333so2249015e9.3 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=vger.kernel.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=D5lPq3z5+YDFT9m/N3h8TESA6jXFvXQS303lwiQaKG/Fi+lqDk0Dk8ejwMZfsCw3P7 gWpb1NqOWVtsNBVfVr31prh+oRsnQ4UrbGa3kQgZlpHEGjIXUbdaJGnGkGqSsm213u0K UBm0J7b6svbXJ7NKIzgUzBna901FmyZArFXsF8IY5dMcwTYHCOJg+XFo6/5EGWILdGsg kyzWRH11KpE/0F0A8gmu114dyzdJLUhFI6dOZMorjwyZ1FmZjhp58MOfSmBEv4/ZO/2E 3ZEKKfcPLT27dAScLAyRN7Pz3HzaXJf2HJ3IgRqJU3QPKt40WLo0MiFyT8QRubUKCaoa FNEQ== 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=YXp5h3jwo1fBNT36U2jaYA6Ix3CX2sW4qL3z4/jR3e2xvivkaLLojwWG1Y0QuLCPbO CIITOSKMjeEB3c5Cw5WSfxWnRp0WupO6nS667/aRLvld2WlTYQA74mXWjnov7MBg9N/H +pFu62uxnhuyV3R5twP4icMJ8R7ejaTqTufjPK7qyiXdjRCVCW4+FjYIyLRHw/fbqfsQ d1bKVQbyyuKBeu2S+9cF9yZ+CYX20TvgA4ATgM9StWvQdc+YdqKZYkEjNr2UzHfurMQh 6GeihUxxiwMiYJGJP2k8DBeXZB6ULn5F/ZbkxDmdUyAXqSyle3v06Gie+VRLAzAXKRLz w20w== X-Forwarded-Encrypted: i=1; AL+hErHfaf5cdAi18hXw6P0lBKfu71iGO2qt43X6xtucWpt76ZbRc4AJdDQ/cTz9Fo8+GVA+UrVtWfnzOQiY@vger.kernel.org X-Gm-Message-State: APuU4Z8t5DS37AlqH+bZfh1ucCibo8LB8l7YGTKdVugJ2n/fZHObU2ca 4al7rx8ZPSknOhdIq/ui6pM8UEpbcdpDc5sDY8+xBX0PsKh4rnHYNnw= X-Gm-Gg: AZFdTZelvjw3LshJhUjLj+ZH3rGTv5SalOfr/OEAifPrIyhrEfgdXAU/sxQKh5tC4zx jYnMhg7LRZMikIutYrGGeAtztSsSpRLlqZuWctcZrtnklQ5AzZ4EMb3Q1DknEtPir0NDbV1wRdF dyxbhqx6nVGT37kD7/nOIoYc+E93BIBevQPEin/EOyDB9+zoI1YDBo6TL5F0hgQLZqLb0ZwXhLE cOIimF4sJcpyO2hkwOJRLuYnk21OHDABQWYxhthHTKA5NlikNMsBjAbBbcxKtWSOh15BkpROXlO Bo0NPoI+H6qKnXgjil2lIcVyM+Y7OKr/0RzNh8X1twm3wHV02r5ERZnQ/I1BvA+GYNnY5cqWrSW BYxJRsXcCzLvQFZRqi7xJJDyRDJNMs0PWruHqFJ6aD/Qz3/AG6y41WZ+6cIPfqztwWIZ84+o792 fGk1DW2FBQVok9TKcW0DeIreko13LZSzGRwDW7XJI54qAq3feTjpfQfOSdV8QxN0hueZ5lHp4wT udNzPNQLY419gdQW9MtYTKI2GkXDQD1Ng2zSOmqorv2l6YlgvDHtJf+a7nMkwpAp5uOquhDYd35 JKjIM9Ro3Lv7xzdIpmzxR9CbrO1z8cKlUWd74Wb4Zr2wLU0aB1NABtorOoXleNSZyrcjaUkwpjq QnjT6AvqpC8w= 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-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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