All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dave Airlie" <airlied@redhat.com>,
	"Lyude Paul" <lyude@redhat.com>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>
Cc: dri-devel@lists.freedesktop.org, nova-gpu@lists.linux.dev
Subject: Re: [PATCH v4 1/2] drm/nouveau: leave GSP-capable GPUs to nova-core when requested
Date: Thu, 03 Dec 2026 04:41:58 +0000	[thread overview]
Message-ID: <sashiko-outbox-247159@kernel.org> (raw)
In-Reply-To: <20261203-nova-nouveau-gsp-v4-1-eb3e5e111968@redhat.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/nouveau: nouveau_register_dsm_handler() mutates rejected
  GSP GPUs
--

commit 9ca41183c261ddad149f42829e0a7497b70fd715
Author: Dave Airlie <airlied@redhat.com>

drm/nouveau: leave GSP-capable GPUs to nova-core when requested

This commit adds a bind_gsp module parameter (defaulting to the inverse of
CONFIG_NOVA_CORE_BIND_GSP) so nouveau rejects Turing and later PCI GPUs in
nvkm_device_ctor() before subdev construction, and adds nvkm_device_dtor()
to unwind partially constructed devices on failure.

> diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
> index 5e1336615cf6d..6f279d78066c2 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_drm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c

[ ... ]

> @@ -881,7 +887,8 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
>  	/* We need to check that the chipset is supported before booting
>  	 * fbdev off the hardware, as there's no way to put it back.
>  	 */
> -	ret = nvkm_device_pci_new(pdev, nouveau_config, nouveau_debug, &device);
> +	ret = nvkm_device_pci_new(pdev, nouveau_config, nouveau_debug,
> +				  nouveau_bind_gsp, &device);
>  	if (ret)
>  		return ret;
>  

[Severity: Medium]
Does nouveau_register_dsm_handler() still mutate PCI PM state and claim the
global vga_switcheroo handler slot for GSP-capable GPUs rejected here?

nouveau_drm_init() calls nouveau_register_dsm_handler() before
pci_register_driver(), so it runs before nouveau_drm_probe() rejects a GPU
under bind_gsp=0.

In nouveau_dsm_detect() -> nouveau_dsm_pci_probe(), any NVIDIA display
device whose upstream bridge has !bridge_d3 gets pci_d3cold_disable(pdev).
Since nouveau never calls pci_d3cold_enable() and pdev->no_d3cold cannot be
cleared from sysfs, the handed-off GPU stays capped at D3hot.

On Optimus laptops, nouveau_register_dsm_handler() also claims the exclusive
vgasr_priv.handler slot via vga_switcheroo_register_handler().  After
nouveau_drm_probe() returns -ENODEV, nouveau remains loaded with zero bound
devices while occupying that slot, making later registrations return -EINVAL.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203-nova-nouveau-gsp-v4-0-eb3e5e111968@redhat.com?part=1

  reply	other threads:[~2026-12-03  4:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  4:21 [PATCH v4 0/2] nova/nouveau: add configs/module options to control binding behaviour Dave Airlie via B4 Relay
2026-12-03  4:21 ` Dave Airlie
2026-12-03  4:21 ` [PATCH v4 1/2] drm/nouveau: leave GSP-capable GPUs to nova-core when requested Dave Airlie via B4 Relay
2026-12-03  4:21   ` Dave Airlie
2026-12-03  4:41   ` sashiko-bot [this message]
2026-12-03  4:21 ` [PATCH v4 2/2] nova-core: only bind to GPUs when explicitly requested Dave Airlie via B4 Relay
2026-12-03  4:21   ` Dave Airlie
2026-12-03  4:37   ` sashiko-bot

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-247159@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@redhat.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lyude@redhat.com \
    --cc=nova-gpu@lists.linux.dev \
    --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.