From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A527606A322 for ; Wed, 2 Dec 2026 05:51:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CfoD8hzJ Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9FE1710E288; Wed, 2 Dec 2026 05:51:37 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 41F6B10E288 for ; Wed, 2 Dec 2026 05:51:31 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 24C8F611CE; Wed, 2 Dec 2026 05:51:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF3D11F00897; Wed, 2 Dec 2026 05:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796190689; bh=DS/163b7a2yUaK5cyDitRJ10ZoPB7+h/99Movd5kWq4=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=CfoD8hzJI5hR0Ncf7bCqAx+oveZyeXqQZVzIHEoa+RgKh5HHMZB+yH600fHhJyEZf 0M/L6gW/ITIWzEGu1oETthHb1h6TbGMbX+bbP2UOM49d0SEGaSTJpz3FGfLeaPK6jZ xT0eV8RDcNSKv5smGBuiivUqn1twUb4swpTvzf6uTlsvELnaLa3Afq4GY74PGrfCMy hykj3gJx+wvS/Oluc4t7ZXCKZStC8v5Ld77Clpsxyhsc5OPjuCA8NRpmWN8mkuHDW4 g0c72XvuXbxhqqD+LxVWaIo0BFI1jGOlohFyAYphn88zD0LyE3BAYHb4ATDu5eKCqe CvH9JVU91P3Tw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 19/19] drm/nouveau/tegra: Add device tree compatible for GV11B To: "Mikko Perttunen" Cc: dri-devel@lists.freedesktop.org In-Reply-To: <20261202-nouveau-gv11b-v1-19-758af3553ef6@nvidia.com> References: <20261202-nouveau-gv11b-v1-0-758af3553ef6@nvidia.com> <20261202-nouveau-gv11b-v1-19-758af3553ef6@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 05:51:29 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [High] drm/nouveau: nouveau_mem_host() strips mem->kind on coherent Tegra GV11B - [Medium] drm/nouveau/tegra: dma_set_mask() in nvkm_device_tegra_new() leaves 32-bit coherent_dma_mask -- commit e289bf50b9036cbe5f5e82400aac0bfdb50c7154 Author: Mikko Perttunen drm/nouveau/tegra: Add device tree compatible for GV11B This commit adds the "nvidia,gv11b" device tree compatible string and its platform data with a 38-bit DMA mask and IOMMU disabled. > diff --git a/drivers/gpu/drm/nouveau/nouveau_platform.c b/drivers/gpu/drm= /nouveau/nouveau_platform.c > index 9ca6272ce809f..56a482dae2318 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_platform.c > +++ b/drivers/gpu/drm/nouveau/nouveau_platform.c > @@ -78,6 +78,10 @@ static const struct nvkm_device_tegra_func gp10b_platf= orm_data =3D { > .require_vdd =3D false, > }; > =20 > +static const struct nvkm_device_tegra_func gv11b_platform_data =3D { > + .dma_bits =3D 38, > +}; [Severity: Medium] Does leaving .iommu_bit at 0 with .dma_bits =3D 38 restrict GV11B instance memory allocations to a 32-bit coherent_dma_mask? With .iommu_bit =3D=3D 0, tdev->iommu.domain is NULL and gk20a_instmem_new() uses gk20a_instobj_ctor_dma(), which allocates GPU instance memory via dma_alloc_attrs(). However, nvkm_device_tegra_new() only calls dma_set_mask(&pdev->dev, DMA_BIT_MASK(func->dma_bits)) instead of dma_set_mask_and_coherent(), leaving pdev->dev.coherent_dma_mask at the default 32-bit mask and constraining dma_alloc_attrs() allocations to 32-bit addresses. > + > static const struct of_device_id nouveau_platform_match[] =3D { > { > .compatible =3D "nvidia,gk20a", > @@ -91,6 +95,10 @@ static const struct of_device_id nouveau_platform_matc= h[] =3D { > .compatible =3D "nvidia,gp10b", > .data =3D &gp10b_platform_data, > }, > + { > + .compatible =3D "nvidia,gv11b", > + .data =3D &gv11b_platform_data, > + }, > { } > }; [Severity: High] Will probing GV11B cause nouveau_mem_host() to strip mem->kind to 0 on every tiled buffer object? The nvidia,gv11b node in tegra194.dtsi carries dma-coherent, so nvkm_device_tegra_new() sets tdev->device.cpu_coherent =3D true. In nvkm_mmu_host(), the coherent cached host memory type is registered with NVKM_MEM_KIND cleared: drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c:nvkm_mmu_host() { ... type |=3D NVKM_MEM_COHERENT; if (device->cpu_coherent) nvkm_mmu_type(mmu, heap, type & ~NVKM_MEM_KIND); } Because that type becomes drm->ttm.type_host[0] without NVIF_MEM_UNCACHED, nouveau_drm_use_coherent_gpu_mapping(drm) returns true on GV11B. nouveau_mem_host() then selects drm->ttm.type_host[0] regardless of mem->kind and clears mem->kind because type_host[0] lacks NVIF_MEM_KIND: drivers/gpu/drm/nouveau/nouveau_mem.c:nouveau_mem_host() { ... if (!nouveau_drm_use_coherent_gpu_mapping(drm)) type =3D drm->ttm.type_ncoh[!!mem->kind]; else type =3D drm->ttm.type_host[0]; if (mem->kind && !(mmu->type[type].type & NVIF_MEM_KIND)) mem->comp =3D mem->kind =3D 0; ... } All GEM buffers on GV11B live in system memory, so block-linear tiled surfaces will be mapped into the GPU VMM as pitch-linear (kind 0), breaking tiled rendering. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202-nouveau-gv= 11b-v1-0-758af3553ef6@nvidia.com?part=3D19