All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mikko Perttunen" <mperttunen@nvidia.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 19/19] drm/nouveau/tegra: Add device tree compatible for GV11B
Date: Wed, 02 Dec 2026 05:51:29 +0000	[thread overview]
Message-ID: <sashiko-outbox-244929@kernel.org> (raw)
In-Reply-To: <20261202-nouveau-gv11b-v1-19-758af3553ef6@nvidia.com>

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 <mperttunen@nvidia.com>

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_platform_data = {
>  	.require_vdd = false,
>  };
>  
> +static const struct nvkm_device_tegra_func gv11b_platform_data = {
> +	.dma_bits = 38,
> +};

[Severity: Medium]
Does leaving .iommu_bit at 0 with .dma_bits = 38 restrict GV11B instance
memory allocations to a 32-bit coherent_dma_mask?

With .iommu_bit == 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[] = {
>  	{
>  		.compatible = "nvidia,gk20a",
> @@ -91,6 +95,10 @@ static const struct of_device_id nouveau_platform_match[] = {
>  		.compatible = "nvidia,gp10b",
>  		.data = &gp10b_platform_data,
>  	},
> +	{
> +		.compatible = "nvidia,gv11b",
> +		.data = &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 = 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 |= 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 = drm->ttm.type_ncoh[!!mem->kind];
	else
		type = drm->ttm.type_host[0];

	if (mem->kind && !(mmu->type[type].type & NVIF_MEM_KIND))
		mem->comp = mem->kind = 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.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202-nouveau-gv11b-v1-0-758af3553ef6@nvidia.com?part=19

      reply	other threads:[~2026-12-02  5:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  5:24 [PATCH 00/19] drm/nouveau: Enable the GV11B GPU on Tegra194 Mikko Perttunen
2026-12-02  5:24 ` [PATCH 01/19] drm/nouveau/fault: Widen engine field Mikko Perttunen
2026-12-02  5:43   ` sashiko-bot
2026-12-02  5:24 ` [PATCH 02/19] drm/nouveau/fault: Mask off instance aperture bits in GV100 fault-buffer entries Mikko Perttunen
2026-12-02  5:33   ` sashiko-bot
2026-12-02  5:24 ` [PATCH 03/19] drm/nouveau: Add helpers for getting memory target's aperture Mikko Perttunen
2026-12-02  5:24 ` [PATCH 04/19] drm/nouveau: Program aperture field where necessary Mikko Perttunen
2026-12-02  5:24 ` [PATCH 05/19] drm/nouveau: Supply aperture to FECS context methods Mikko Perttunen
2026-12-02  5:24 ` [PATCH 06/19] drm/nouveau/mmu: Set cpu_coherent flag at runtime for Tegra Mikko Perttunen
2026-12-02  5:47   ` sashiko-bot
2026-12-02  5:24 ` [PATCH 07/19] drm/nouveau/instmem: Use the coherent aperture for DMA-coherent Tegra allocations Mikko Perttunen
2026-12-02  5:24 ` [PATCH 08/19] drm/nouveau: Use coherent firmware mappings on coherent Tegra devices Mikko Perttunen
2026-12-02  5:24 ` [PATCH 09/19] drm/nouveau/fifo: Allow coherent host pages for USERD Mikko Perttunen
2026-12-02  5:24 ` [PATCH 10/19] drm/nouveau: Allocate Volta USERD in host memory on VRAM-less GPUs Mikko Perttunen
2026-12-02  5:24 ` [PATCH 11/19] drm/nouveau/bar: Add a GPU-only BAR2 address space for GV11B Mikko Perttunen
2026-12-02  5:24 ` [PATCH 12/19] drm/nouveau/fifo: Map Volta copy-engine method buffers in GPU-only BAR2 Mikko Perttunen
2026-12-02  5:24 ` [PATCH 13/19] drm/nouveau/fault: Support physical addresses for GV100 fault buffers Mikko Perttunen
2026-12-02  5:24 ` [PATCH 14/19] drm/nouveau: Add GV11B chipset/MMU/devfreq configuration data Mikko Perttunen
2026-12-02  5:24 ` [PATCH 15/19] drm/nouveau: Add ACR loader and PMU firmware boot on GV11B Mikko Perttunen
2026-12-02  5:24 ` [PATCH 16/19] drm/nouveau/gr: Wait for FECS watchdog timeout init completion Mikko Perttunen
2026-12-02  5:24 ` [PATCH 17/19] drm/nouveau: Add GR firmware and context support for GV11B Mikko Perttunen
2026-12-02  5:24 ` [PATCH 18/19] drm/nouveau/tegra: Separate DMA mask width from the IOMMU address bit Mikko Perttunen
2026-12-02  5:24 ` [PATCH 19/19] drm/nouveau/tegra: Add device tree compatible for GV11B Mikko Perttunen
2026-12-02  5:51   ` 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-244929@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=mperttunen@nvidia.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.