* rk3588: VOP IOMMU faults at boot while the firmware window is on
@ 2026-11-29 9:38 Francesco Saverio Pavone
2026-11-29 10:04 ` Jiaxing Hu
0 siblings, 1 reply; 6+ messages in thread
From: Francesco Saverio Pavone @ 2026-11-29 9:38 UTC (permalink / raw)
To: Joerg Roedel, Will Deacon, Robin Murphy, Heiko Stuebner,
Sandy Huang, Andy Yan
Cc: Chaoyi Chen, Damon Ding, Jagan Teki, Lucas Tanure, Jiaxing Hu,
Sebastian Reichel, Cristian Ciocaltea, iommu, dri-devel,
linux-rockchip, linux-arm-kernel
Hi,
On a ROCK 5B+ (RK3588) booted from EDK2 with the display on, plain
v7.4-rc4 logs this around the VOP bind:
platform fdd90000.vop: Adding to iommu group 7
...
rk_iommu fdd97e00.iommu: Enable stall request timed out, status: 0x00001d
rk_iommu fdd97e00.iommu: Enable stall request timed out, status: 0x00030b
rockchip-drm display-subsystem: bound fdd90000.vop (ops vop2_component_ops)
rk_iommu fdd97e00.iommu: Page fault at 0x00000000e6810000 of type read
Bank 0 stalls. Bank 1 is paging with a page fault active, bus id 0xc,
and never stalls. The stall lines and a page fault come once more
about 13 s into the boot.
This looks like what Jagan Teki reported for RK3328 in 2023 [1], where
Robin pointed out that resetting the IOMMU while bootloader framebuffer
traffic is still going through is a problem of its own. Lucas Tanure's
PX30 patch from 14 Nov [2] deals with the same kind of master at reboot.
What I traced here: the firmware leaves one window enabled (Esmart2 on
VP2) and it keeps reading its framebuffer. Paging is first enabled from
the IOMMU's runtime resume, the read faults because that address is not
mapped, and the stall times out. b10d5920cafa acks the stale fault, but
the window is still running and faults again at once. A 7.2-rc5 tree
without that commit logs the same two lines. Jiaxing Hu's patch from
23 Nov [3] does not change them either: both banks report paging
enabled, so its check does not trigger.
As an experiment, on a tree with Collabora's rockchip-devel on top, I
disabled that window, put VP2 in standby and waited for it before
letting the IOMMU enable paging. That took 22 and 31 ms in two boots
and the two lines were gone in both. The hack does it from
rockchip-iommu.c by writing VOP registers, so it is not a patch. I can
post it for reference.
Where should this be handled? The driver has no get_resv_regions, so
iommu-addresses on a firmware framebuffer node would not help today.
The reset that Collabora's tree does in vop2_bind() comes after the
first paging enable: with it the page fault line is gone, the two stall
lines stay. Or is the firmware expected to turn the display
off?
One board, one firmware (EDK2 v1.1.1 for the ROCK 5B+). The plain
v7.4-rc4 log is from a single boot; the Collabora-based tree shows the
two stall lines on every boot.
LLM agents (OpenAI Codex and Hermes) wrote the instrumentation and ran
the boots on my board, and Claude helped write this mail. I went
through the traces quoted here.
Francesco
[1] https://lore.kernel.org/all/20230330131746.1475514-2-jagan@amarulasolutions.com/
[2] https://lore.kernel.org/all/20261114133738.52817-1-tanure@linux.com/
[3] https://lore.kernel.org/all/20261123235154.315460-1-gahing@gahingwoo.com/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: rk3588: VOP IOMMU faults at boot while the firmware window is on
2026-11-29 9:38 rk3588: VOP IOMMU faults at boot while the firmware window is on Francesco Saverio Pavone
@ 2026-11-29 10:04 ` Jiaxing Hu
2026-11-29 16:40 ` Francesco Saverio Pavone
0 siblings, 1 reply; 6+ messages in thread
From: Jiaxing Hu @ 2026-11-29 10:04 UTC (permalink / raw)
To: Francesco Saverio Pavone
Cc: Joerg Roedel, Will Deacon, Robin Murphy, Heiko Stuebner,
Sandy Huang, Andy Yan, Chaoyi Chen, Damon Ding, Jagan Teki,
Lucas Tanure, Sebastian Reichel, Cristian Ciocaltea, iommu,
dri-devel, linux-rockchip, linux-arm-kernel
Hi Francesco,
I am seeing the same behavior on RK3576 with my EDK2 port
(edk2-rk3576, https://github.com/gahingwoo/edk2-rk3576). When booting
Armbian 7.3.4-edge (with rockchipdrm built in) on a TaishanPi 3M, the
firmware hands over control while Esmart0 on VP0 is still scanning out
the HDMI framebuffer at 0xff190000. Shortly after the VOP binds, when
it is first enabled, the kernel logs:
rk_iommu 27d07e00.iommu: Enable stall request timed out, status: 0x00040b
rk_iommu 27d07e00.iommu: Enable stall request timed out, status: 0x00001d
rockchip-drm display-subsystem: [drm] *ERROR* POST_BUF_EMPTY irq err at vp0
This happened in 2 out of 3 HDMI boots where the VOP managed to bind.
The 0x40b status matches your 0x30b (just with bus ID 0x10), meaning
paging is enabled with an active page fault. On a DSI boot before my
fix, the same pair of timeouts came on every DRM enable, and later a
BUS_ERROR.
To work around this on the DSI path, I added a quirk at
ExitBootServices when booting Linux: it turns off the window, puts the
VP into standby, and waits for DSP_HOLD_VALID. Essentially, it is your
experiment implemented in the firmware. Across 32 DSI Linux boots since
that change, I haven't seen a single rk_iommu error. Take that with a
grain of salt, though, as most of those runs only captured partial
serial logs. The HDMI path still hands over a live window for now, and
I plan to quiesce it the same way.
Regarding my IOMMU patch from Nov 23 [1]: that originated from an
RK3576 NPU issue, where one bank kept paging after a core reset while
the other didn't, causing the all-banks guards to skip the stall and
breaking the force reset. You're right that it doesn't help here when
both banks are paging.
One data point from the OS side: my Windows display driver takes over
the live window without tearing it down first. It avoids faulting by
identity-mapping the firmware framebuffer in the VOP IOMMU right before
enabling paging. Getting that seamless handover on Linux would need
something like get_resv_regions in rockchip-iommu, so that
iommu-addresses on the framebuffer node is honored. Quiescing in
firmware works today without kernel changes, at the cost of blanking
the screen until KMS sets a mode.
A CM5-IO running Fedora (where rockchipdrm is built as a module) showed
none of these faults across 16 boots in September (7.3.0-rc3-next). I
suspect clk_disable_unused gates the VOP clocks before the module gets
a chance to load, though I haven't verified that yet.
Thanks,
Jiaxing
[1] https://lore.kernel.org/all/20261123235154.315460-1-gahing@gahingwoo.com/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: rk3588: VOP IOMMU faults at boot while the firmware window is on
2026-11-29 10:04 ` Jiaxing Hu
@ 2026-11-29 16:40 ` Francesco Saverio Pavone
2026-11-30 1:48 ` Chaoyi Chen
0 siblings, 1 reply; 6+ messages in thread
From: Francesco Saverio Pavone @ 2026-11-29 16:40 UTC (permalink / raw)
To: Jiaxing Hu
Cc: Joerg Roedel, Will Deacon, Robin Murphy, Heiko Stuebner,
Sandy Huang, Andy Yan, Chaoyi Chen, Damon Ding, Jagan Teki,
Lucas Tanure, Sebastian Reichel, Cristian Ciocaltea, iommu,
dri-devel, linux-rockchip, linux-arm-kernel
Hi Jiaxing,
Thanks, that fills in a lot.
> A CM5-IO running Fedora (where rockchipdrm is built as a module) showed
> none of these faults across 16 boots in September (7.3.0-rc3-next). I
> suspect clk_disable_unused gates the VOP clocks before the module gets
> a chance to load, though I haven't verified that yet.
With rockchipdrm built in, the VOP here binds at 0.23 s, with the two
stall timeouts, long before the late initcalls that switch off unused
clocks and power domains (around 2.8 s). So I built plain v7.4-rc4 with
DRM_ROCKCHIP=m and booted it three times on the ROCK 5B+, changing only
the command line:
(nothing added) no rk_iommu errors
clk_ignore_unused no rk_iommu errors
pd_ignore_unused two stall timeouts and a page fault at 13 s
In all three the module binds the VOP about 0.5 s after the late
initcalls, and the bind itself is clean. So with a module it looks like
the power domain being switched off, not the clocks, is what stops the
firmware window. One boot each, and all three had
drm_client_lib.active= set; a built-in kernel with that option still
shows the timeouts at bind.
I have not seen POST_BUF_EMPTY or a bus error here, only the timeouts,
plus the page fault line on plain mainline. On mainline the same pair
comes back once about 13 s into the boot, which may be your "on every
DRM enable".
Quiescing at ExitBootServices sounds like the practical fix for now,
and it is probably worth raising with the firmware project for this
board too. The identity mapping would be nicer, since it keeps the
picture, but that is the get_resv_regions work in rockchip-iommu, and I
would rather hear from Robin or Joerg whether they want it done that
way.
Francesco
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: rk3588: VOP IOMMU faults at boot while the firmware window is on
2026-11-29 16:40 ` Francesco Saverio Pavone
@ 2026-11-30 1:48 ` Chaoyi Chen
2026-11-30 2:04 ` Jiaxing Hu
0 siblings, 1 reply; 6+ messages in thread
From: Chaoyi Chen @ 2026-11-30 1:48 UTC (permalink / raw)
To: Francesco Saverio Pavone, Jiaxing Hu
Cc: Joerg Roedel, Will Deacon, Robin Murphy, Heiko Stuebner,
Sandy Huang, Andy Yan, Damon Ding, Jagan Teki, Lucas Tanure,
Sebastian Reichel, Cristian Ciocaltea, iommu, dri-devel,
linux-rockchip, linux-arm-kernel
Hi,
On 11/30/2026 12:40 AM, Francesco Saverio Pavone wrote:
> Hi Jiaxing,
>
> Thanks, that fills in a lot.
>
>> A CM5-IO running Fedora (where rockchipdrm is built as a module) showed
>> none of these faults across 16 boots in September (7.3.0-rc3-next). I
>> suspect clk_disable_unused gates the VOP clocks before the module gets
>> a chance to load, though I haven't verified that yet.
>
> With rockchipdrm built in, the VOP here binds at 0.23 s, with the two
> stall timeouts, long before the late initcalls that switch off unused
> clocks and power domains (around 2.8 s). So I built plain v7.4-rc4 with
> DRM_ROCKCHIP=m and booted it three times on the ROCK 5B+, changing only
> the command line:
>
> (nothing added) no rk_iommu errors
> clk_ignore_unused no rk_iommu errors
> pd_ignore_unused two stall timeouts and a page fault at 13 s
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/
>
> In all three the module binds the VOP about 0.5 s after the late
> initcalls, and the bind itself is clean. So with a module it looks like
> the power domain being switched off, not the clocks, is what stops the
> firmware window. One boot each, and all three had
> drm_client_lib.active= set; a built-in kernel with that option still
> shows the timeouts at bind.
>
> I have not seen POST_BUF_EMPTY or a bus error here, only the timeouts,
> plus the page fault line on plain mainline. On mainline the same pair
> comes back once about 13 s into the boot, which may be your "on every
> DRM enable".
>
> Quiescing at ExitBootServices sounds like the practical fix for now,
> and it is probably worth raising with the firmware project for this
> board too. The identity mapping would be nicer, since it keeps the
> picture, but that is the get_resv_regions work in rockchip-iommu, and I
> would rather hear from Robin or Joerg whether they want it done that
> way.
This looks more like some kind of hack.
Why not just use iommu_map() to establish a 1:1 mapping?
--
Best,
Chaoyi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: rk3588: VOP IOMMU faults at boot while the firmware window is on
2026-11-30 1:48 ` Chaoyi Chen
@ 2026-11-30 2:04 ` Jiaxing Hu
2026-11-30 11:13 ` Francesco Saverio Pavone
0 siblings, 1 reply; 6+ messages in thread
From: Jiaxing Hu @ 2026-11-30 2:04 UTC (permalink / raw)
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,
dri-devel, linux-rockchip, linux-arm-kernel
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: rk3588: VOP IOMMU faults at boot while the firmware window is on
2026-11-30 2:04 ` Jiaxing Hu
@ 2026-11-30 11:13 ` Francesco Saverio Pavone
0 siblings, 0 replies; 6+ messages in thread
From: Francesco Saverio Pavone @ 2026-11-30 11:13 UTC (permalink / raw)
To: Jiaxing Hu, Chaoyi Chen
Cc: Joerg Roedel, Will Deacon, Robin Murphy, Heiko Stuebner,
Sandy Huang, Andy Yan, Damon Ding, Jagan Teki, Lucas Tanure,
Sebastian Reichel, Cristian Ciocaltea, iommu, dri-devel,
linux-rockchip, linux-arm-kernel
Hi Chaoyi, Jiaxing,
Chaoyi wrote:
> Why not just use iommu_map() to establish a 1:1 mapping?
I tried that on the ROCK 5B+ with v7.4-rc4. It gets rid of the errors
here, but it takes two mappings.
The stall timeouts at 0.23 s come before the DRM driver has a domain.
The VOP is in the default DMA domain by then. So there are two changes:
1. rockchip-iommu: .get_resv_regions = iommu_dma_get_resv_regions, so
the core maps into the default domain a reserved-memory region that
the VOP points at with memory-region and that names the VOP in
iommu-addresses;
2. rockchip_drm_init_iommu(): map the same direct regions 1:1 in the
DRM domain and reserve them in the drm_mm, before the first attach.
To test them I added a node for the EDK2 buffer to the board DTS by
hand (0xe6810000, 2560x1440x4). Boots with rk_iommu errors:
fbdev client off fbdev client on
plain v7.4-rc4 10 of 10 -
1+2, node removed 7 of 8 -
1 only, node 0 of 2 2 of 2
1+2, node 0 of 6 0 of 2
"Client off" is drm_client_lib.active=, where the first modeset is the
compositor's. With the client on and only patch 1, the timeouts at
0.23 s are gone, but the VOP faults on the firmware buffer at the fbdev
modeset, 0.39 to 0.40 s:
rk_iommu fdd97e00.iommu: Page fault at 0x00000000e6810400 of type read
and again at 14 to 15 s, together with the two timeouts. So the second
mapping is needed, and the window is still being read long after the
first modeset. I have not looked at why patch 1 alone is enough with
the client off, and I do not know why one of the eight boots without
the node was clean. With the node and both patches the picture stayed
on the TV through the boot, with no black screen.
Jiaxing wrote:
> On EFI boots the address would have to come from screen_info
As far as I can tell there is none to read on this board. It boots
EDK2, then GRUB with a DTB loaded by GRUB, and no efifb or simpledrm
comes up, with the TV on or off. I have not found out why. So here the
node would have to be written by the firmware, and I only know the
address for this one mode.
> the 1:1 mapping has to outlive the initial modeset
I keep it until the domain is freed.
Still open: the VOP bindings do not allow memory-region; with
IOMMU_DMA=n (32-bit ARM) both changes do nothing; and only the first
VOP is asked for its regions, which is wrong for RK3399. If this is the
direction you want, I can fix those and send the two as an RFC with a
binding patch. I have not tested with the clk sync_state series.
The two patches were written with Claude (Anthropic). I ran the boots
above on my board and checked the logs quoted here.
Francesco
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-11-30 11:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 9:38 rk3588: VOP IOMMU faults at boot while the firmware window is on Francesco Saverio Pavone
2026-11-29 10:04 ` Jiaxing Hu
2026-11-29 16:40 ` Francesco Saverio Pavone
2026-11-30 1:48 ` Chaoyi Chen
2026-11-30 2:04 ` Jiaxing Hu
2026-11-30 11:13 ` Francesco Saverio Pavone
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox