From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35B5B47D456 for ; Mon, 5 Oct 2026 11:04:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791198276; cv=none; b=trxCsFFJWBHHK51f9vGZZO7bLuP/E2o6UgnD2TlnMiEWlF1w/hEPkMZrDcT4DarVBVqk6+54AV0yX8fYETyyOebDvLWuGsWHHT6nb7x4vH9WegcPUBzNRmEUnQPDuN4P1MfRnt/EiW3q7N4zvKUtyLibP8XvF3FGw/Rf2ovU4/s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791198276; c=relaxed/simple; bh=cLnVbSzXmcf7qdo5sG4C7PT6pFLAkJEH/Z2HJd1r/QA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=upfNh2Knows9eJDQjAlYIBpSzpXKnaPYEO/YHkZz/aOonfjdEiT8p9sq1ti26eLD6cH4eO+MjpnhPgfX4vMRrWzqJ09lRPVJPuxdooQV0mJAaxukviZi+iWOvYGO+aCzB+6EylZMSfvOLbyq9lmRR9ivKPKYS+CMMi4e78xdszk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=pZIpAmPs; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="pZIpAmPs" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 32B69152B; Mon, 5 Oct 2026 04:04:31 -0700 (PDT) Received: from [10.57.78.53] (unknown [10.57.78.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0C3E03FA7A; Mon, 5 Oct 2026 04:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1791198274; bh=cLnVbSzXmcf7qdo5sG4C7PT6pFLAkJEH/Z2HJd1r/QA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=pZIpAmPssATGP/Dwrj5TIgau4OLpuEGhl6Q1wxJvb6AFh3UcaztvqOe1D865Gx/+C 7j0F/eV/WHBfzRzxM8n08FjK/CChgv0j3Aop9BKziMgONjzMqsdKCoJCZlLt78gmcG o8mwtG5OMYAhXlVSyaMu2zeQiNyIxsaQkMIg5buw= Message-ID: Date: Mon, 5 Oct 2026 12:03:29 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 5/5] drm/panthor: Remove redundant panthor_fix_sparse_map_offset() call To: Boris Brezillon , Liviu Dudau , =?UTF-8?Q?Adri=C3=A1n_Larumbe?= , Akash Goel Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20260924-panthor-fix-partial-unmap-v2-0-59a68a1f9e14@collabora.com> <20260924-panthor-fix-partial-unmap-v2-5-59a68a1f9e14@collabora.com> From: Steven Price Content-Language: en-GB In-Reply-To: <20260924-panthor-fix-partial-unmap-v2-5-59a68a1f9e14@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 > Closes: https://lore.kernel.org/dri-devel/b85679e3-5ca2-4d36-8675-2b968d97cb5b@arm.com/ > Signed-off-by: Boris Brezillon Reviewed-by: Steven Price > --- > 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) >