[RFC PATCH 1/3] iommu/rockchip: Report the reserved regions from the devicetree
Chaoyi Chen
chaoyi.chen at rock-chips.com
Thu Dec 3 22:32:03 PST 2026
Hi,
On 12/4/2026 2:24 PM, Francesco Saverio Pavone wrote:
> The driver has no .get_resv_regions callback, so a reserved-memory node
> that lists a device in "iommu-addresses" is ignored: the region is
> neither kept out of the IOVA allocator nor mapped 1:1 in the default
> domain.
>
> This matters for the VOP when the bootloader leaves a window scanning
> out of its own framebuffer. On RK3588 the default DMA domain is
> installed on the VOP MMU as soon as the MMU is resumed, with an empty
> page table, and the running scanout faults. On a ROCK 5B+ started from
> EDK2 this shows as
>
> rk_iommu fdd97e00.iommu: Enable stall request timed out, status: 0x00001d
> rk_iommu fdd97e00.iommu: Enable stall request timed out, status: 0x00030b
>
> Use of_iommu_get_resv_regions() as the callback, so that the core maps
> such a region before the MMU is enabled: the probe does not touch the
> hardware, and the page table is first loaded from the runtime resume.
>
> The driver is devicetree only, and calling the OF helper directly,
> instead of going through iommu_dma_get_resv_regions(), lets a consumer
> read the regions on 32-bit ARM too, where IOMMU_DMA is not available.
> The default domain is not a DMA domain there, so the core maps nothing
> and this patch alone changes nothing on 32-bit ARM.
>
> The IOVA space of the driver is 32 bits wide, so a region above 4 GiB
> cannot be mapped 1:1. Nothing checks for that here.
Please consider condensing your commit message.
It only adds the get_resv_regions functionality. There is no need
to describe it at such length.
> Signed-off-by: Francesco Saverio Pavone <pavone.lawyer at gmail.com>
> ---
> drivers/iommu/rockchip-iommu.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
> index 1fa3110b142ad..757532a86975c 100644
> --- a/drivers/iommu/rockchip-iommu.c
> +++ b/drivers/iommu/rockchip-iommu.c
> @@ -20,6 +20,7 @@
> #include <linux/mm.h>
> #include <linux/init.h>
> #include <linux/of.h>
> +#include <linux/of_iommu.h>
> #include <linux/of_platform.h>
> #include <linux/platform_device.h>
> #include <linux/pm_runtime.h>
> @@ -1204,6 +1205,7 @@ static const struct iommu_ops rk_iommu_ops = {
> .probe_device = rk_iommu_probe_device,
> .release_device = rk_iommu_release_device,
> .device_group = generic_single_device_group,
> + .get_resv_regions = of_iommu_get_resv_regions,
> .of_xlate = rk_iommu_of_xlate,
> .default_domain_ops = &(const struct iommu_domain_ops) {
> .attach_dev = rk_iommu_attach_device,
--
Best,
Chaoyi
More information about the linux-arm-kernel
mailing list