From: Steven Price <steven.price@arm.com>
To: "Boris Brezillon" <boris.brezillon@collabora.com>,
"Liviu Dudau" <liviu.dudau@arm.com>,
"Adrián Larumbe" <adrian.larumbe@collabora.com>,
"Akash Goel" <akash.goel@arm.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/5] drm/panthor: Remove redundant panthor_fix_sparse_map_offset() call
Date: Mon, 5 Oct 2026 12:03:29 +0100 [thread overview]
Message-ID: <cf996cfc-dbd4-458f-a656-d85e9014d6c5@arm.com> (raw)
In-Reply-To: <20260924-panthor-fix-partial-unmap-v2-5-59a68a1f9e14@collabora.com>
On 24/09/2026 12:04, Boris Brezillon wrote:
> op->remap.next->gem.offset is adjusted twice in
> panthor_gpuva_sm_step_remap() (once on the remap.next object, and once on
> the local map_op). Let's do it only once, and move this adjusment closer
> to the place it matters.
>
> Reported-by: Akash Goel <akash.goel@arm.com>
> Closes: https://lore.kernel.org/dri-devel/b85679e3-5ca2-4d36-8675-2b968d97cb5b@arm.com/
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
> ---
> drivers/gpu/drm/panthor/panthor_mmu.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c
> index 01564d250adf..d8fb29ace5c4 100644
> --- a/drivers/gpu/drm/panthor/panthor_mmu.c
> +++ b/drivers/gpu/drm/panthor/panthor_mmu.c
> @@ -2397,11 +2397,6 @@ static int panthor_gpuva_sm_step_remap(struct drm_gpuva_op *op,
>
> drm_gpuva_op_remap_to_unmap_range(&op->remap, &unmap_start, &unmap_range);
>
> - /* op->remap.prev's BO offset is always the same as the unmap va's, but
> - * that of op->remap.next must be adjusted so as to remain < SZ_2M
> - */
> - panthor_fix_sparse_map_offset(op->remap.next, unmap_vma->flags);
> -
> if (!unmap_vma->evicted) {
> /*
> * ARM IOMMU page table management code disallows partial unmaps of huge pages,
> @@ -2447,6 +2442,12 @@ static int panthor_gpuva_sm_step_remap(struct drm_gpuva_op *op,
> u64 addr = op->remap.next->va.addr;
> u64 size = unmap_start + unmap_range - op->remap.next->va.addr;
>
> + /* op->remap.prev's BO offset is always the same as the unmap
> + * va's, but that of op->remap.next must be adjusted so as to
> + * remain < SZ_2M
> + */
> + panthor_fix_sparse_map_offset(op->remap.next, unmap_vma->flags);
> +
> if (!unmap_vma->evicted && size > 0) {
> struct drm_gpuva_op_map map_op = {
> .va.addr = addr,
> @@ -2454,7 +2455,6 @@ static int panthor_gpuva_sm_step_remap(struct drm_gpuva_op *op,
> .gem.obj = op->remap.next->gem.obj,
> .gem.offset = op->remap.next->gem.offset,
> };
> - panthor_fix_sparse_map_offset(&map_op, unmap_vma->flags);
>
> ret = panthor_vm_exec_map_op(vm, unmap_vma->flags, &map_op);
> if (ret)
>
next prev parent reply other threads:[~2026-10-05 11:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 11:04 [PATCH v2 0/5] drm/panthor: Fix partial unmaps, again Boris Brezillon
2026-09-24 11:04 ` [PATCH v2 1/5] drm/panthor: Avoid false positives in iova_mapped_as_huge_page() Boris Brezillon
2026-10-05 10:27 ` Steven Price
2026-09-24 11:04 ` [PATCH v2 2/5] drm/panthor: Fix iova_mapped_as_huge_page() for imported BOs Boris Brezillon
2026-10-05 10:28 ` Steven Price
2026-09-24 11:04 ` [PATCH v2 3/5] drm/panthor: Consolidate the is-huge-page-mapping test Boris Brezillon
2026-10-05 10:50 ` Steven Price
2026-09-24 11:04 ` [PATCH v2 4/5] drm/panthor: Actually check huge-page mapping on sparse regions Boris Brezillon
2026-10-01 23:04 ` Adrián Larumbe
2026-10-05 11:03 ` Steven Price
2026-10-05 11:53 ` Boris Brezillon
2026-10-05 15:31 ` Steven Price
2026-10-05 15:48 ` Boris Brezillon
2026-09-24 11:04 ` [PATCH v2 5/5] drm/panthor: Remove redundant panthor_fix_sparse_map_offset() call Boris Brezillon
2026-10-05 11:03 ` Steven Price [this message]
2026-10-01 22:49 ` [PATCH v2 0/5] drm/panthor: Fix partial unmaps, again Adrián Larumbe
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=cf996cfc-dbd4-458f-a656-d85e9014d6c5@arm.com \
--to=steven.price@arm.com \
--cc=adrian.larumbe@collabora.com \
--cc=airlied@gmail.com \
--cc=akash.goel@arm.com \
--cc=boris.brezillon@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®