Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Francesco Saverio Pavone" <pavone.lawyer@gmail.com>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [RFC PATCH 3/3] drm/rockchip: Map the reserved regions 1:1 in the DRM IOMMU domain
Date: Fri, 04 Dec 2026 06:48:35 +0000	[thread overview]
Message-ID: <sashiko-outbox-249247@kernel.org> (raw)
In-Reply-To: <43f9ba0b26794fc58762d4e3188796fbf92becd2.1796334467.git.pavone.lawyer@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/rockchip: rockchip_drm_collect_resv_regions() ignores
  IOMMU_RESV_RESERVED
--

commit 7e781ea37d24b597e54bf98cdf417ce94c06861d
Author: Francesco Saverio Pavone <pavone.lawyer@gmail.com>

drm/rockchip: Map the reserved regions 1:1 in the DRM IOMMU domain

This commit collects direct-mapped IOMMU reserved regions from bound VOP
devices, maps them 1:1 in the DRM IOMMU domain, and reserves their IOVA
ranges in private->mm.

> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> index ba417f7e9e474..aed22787c05e2 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> @@ -88,6 +88,121 @@ void rockchip_drm_dma_detach_device(struct drm_device *drm_dev,

[ ... ]

> +static void rockchip_drm_collect_resv_regions(struct drm_device *drm_dev,
> +					      struct device *dev)
> +{
> +	struct rockchip_drm_private *private = drm_dev->dev_private;
> +	struct iommu_resv_region *region;
> +	struct rockchip_drm_resv *resv;
> +	LIST_HEAD(regions);
> +
> +	iommu_get_resv_regions(dev, &regions);
> +
> +	list_for_each_entry(region, &regions, list) {
> +		if (region->type != IOMMU_RESV_DIRECT &&
> +		    region->type != IOMMU_RESV_DIRECT_RELAXABLE)
> +			continue;

[Severity: Medium]
Should rockchip_drm_collect_resv_regions() also record IOMMU_RESV_RESERVED
regions instead of skipping them?

Commit "iommu/rockchip: Report the reserved regions from the devicetree"
wires of_iommu_get_resv_regions() into rk_iommu_ops, which emits
IOMMU_RESV_RESERVED for an iommu-addresses memory-region without a reg
property.  Dropping those regions leaves them unreserved in private->mm,
so rockchip_gem_iommu_map() can allocate and map GEM buffer IOVAs inside
ranges that the IOMMU API contract forbids mapping.

Reserving IOMMU_RESV_RESERVED ranges in private->mm (and removing them on
teardown) without calling iommu_map() or iommu_unmap() would avoid handing
out those IOVAs.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1796334467.git.pavone.lawyer@gmail.com?part=3

      reply	other threads:[~2026-12-04  6:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  6:24 [RFC PATCH 0/3] rockchip: keep the bootloader framebuffer mapped behind the VOP IOMMU Francesco Saverio Pavone
2026-12-04  6:24 ` [RFC PATCH 1/3] iommu/rockchip: Report the reserved regions from the devicetree Francesco Saverio Pavone
2026-12-04  6:32   ` Chaoyi Chen
2026-12-04  6:44   ` sashiko-bot
2026-12-04  6:24 ` [RFC PATCH 2/3] dt-bindings: display: vop2: Allow memory-region Francesco Saverio Pavone
2026-12-04  6:24 ` [RFC PATCH 3/3] drm/rockchip: Map the reserved regions 1:1 in the DRM IOMMU domain Francesco Saverio Pavone
2026-12-04  6:48   ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-249247@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=pavone.lawyer@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox