From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7646930FF20 for ; Thu, 16 Apr 2026 07:03:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776323007; cv=none; b=eNDi1AEKxNskut0EAnaGzpC/3TzREow/k4y2vIsB57gRBCeaYXjDk57e4+PBbDzSIu7wzCMkY3G5GdHVhKG0cC9yWuC/A4xoRsiwR7IIBTu7AWZ3Iz1GtHHrQ+5KbafHg+/sQapemdMEiE6zGcF2nfgZ+/p+r0LJlaJkyChWV4k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776323007; c=relaxed/simple; bh=qq0hjoM+THKl+PMzCFoOnizTUcRyZ3f6FubUQkOjKtg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ABdzLx/D7qcxCmfwDVom/JNoDtS1fGLvRY6q0Ml7P6uXw23LU4vPDIXImxWr52E9wVn/xZVi2OxbBcxrgUY9QUF4pyR+o4trIVIqpykvL6D5HcEsgSoUiGyVU4g6J9S10hk9XRn5CUAEtYuvMRSZSspnll1ioZZeMMv+KK1Zr7E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=NPgQ3dEO; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="NPgQ3dEO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1776323004; bh=qq0hjoM+THKl+PMzCFoOnizTUcRyZ3f6FubUQkOjKtg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NPgQ3dEOQ0NEkmS+H68HBUqe1pazp/7RrMt8hYoXPz94U/u3QyX236AcL0zPMjCc3 2/XI4ag0glu9B1wEgEB/fppv3LV6e1zf+LDmOc6pAzEb/dEB3d7cTvAfy3Za0rzbSU yYAhE6RoRF8sMkacGv5GvgO/jrVGMVwMY80VCr7T7vhhdepo8SrkjXj76Xig3FEwbc 2jbCpVDQFTzb/3Vvy6hxBl+wuUEM3KS3JMAzGKLcaVpXCt6PQ+8+xKOAsGIUP5h9sz hVB/E5gaJOsbzyzhp2L2h2kOaVJS9W5Pff+aKLJkO9+xijwzwxRu9onuJpUmDS7EUZ yDqMH5j2rFb4w== Received: from fedora (unknown [100.64.0.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by bali.collaboradmins.com (Postfix) with ESMTPSA id 441B617E0CA9; Thu, 16 Apr 2026 09:03:24 +0200 (CEST) Date: Thu, 16 Apr 2026 09:03:20 +0200 From: Boris Brezillon To: =?UTF-8?B?QWRyacOhbg==?= Larumbe Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Steven Price , kernel@collabora.com, Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Daniel Almeida , Alice Ryhl Subject: Re: [PATCH v7 5/6] drm/panthor: Support sparse mappings Message-ID: <20260416090320.381043c6@fedora> In-Reply-To: References: <20260415112900.681834-1-adrian.larumbe@collabora.com> <20260415112900.681834-6-adrian.larumbe@collabora.com> <20260415171247.3701e116@fedora> Organization: Collabora X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 15 Apr 2026 23:09:17 +0100 Adri=C3=A1n Larumbe wrote: > > > +static int > > > +panthor_vm_exec_map_op(struct panthor_vm *vm, u32 flags, > > > + const struct drm_gpuva_op_map *op) > > > +{ > > > + struct panthor_gem_object *bo =3D to_panthor_bo(op->gem.obj); > > > + int prot =3D flags_to_prot(flags); > > > + > > > + if (!op->va.range) > > > + return 0; =20 > > > > Do we really expect a range of zero here? If not, I'd either drop > > the check, or at the very least, make it a drm_WARN_ON_ONCE(). =20 >=20 > IIRC it can happen when panthor_vm_exec_map_op() is called from panthor_g= puva_sm_step_remap(), > and the remap's unmap didn't have to be expanded to account for a THP. Can't we just replace that by an extra size > 0 check before calling panthor_vm_exec_map_op() in the remap() path? I mean, we already have an !evicted check there. if (!unmap_vma->evicted && size) { ret =3D panthor_vm_exec_map_op() ... } > Although in that case, > the check being done inside panthor_vm_map_pages() should be enough.