]> git.ipfire.org Git - thirdparty/linux.git/commit
gpu: nova-core: fix aux device registration for multi-GPU systems
authorJohn Hubbard <jhubbard@nvidia.com>
Sat, 21 Feb 2026 02:09:15 +0000 (18:09 -0800)
committerDanilo Krummrich <dakr@kernel.org>
Tue, 24 Feb 2026 14:44:51 +0000 (15:44 +0100)
commitd3f36fa57aa289c43e01da16c928a2cd971ad5dc
treebab8170b0885a1d223dd860c015a2a512d55e7bd
parent8d1a65c2defdc4213a49008d0531bd35d26fdf35
gpu: nova-core: fix aux device registration for multi-GPU systems

The auxiliary device registration was using a hardcoded ID of 0, which
caused probe() to fail on multi-GPU systems with:

   sysfs: cannot create duplicate filename '/bus/auxiliary/devices/NovaCore.nova-drm.0'

Fix this by using an atomic counter to generate unique IDs for each
GPU's aux device registration. The TODO item to eventually use XArray
for recycling aux device IDs is retained, but for now, this works very
nicely.

This has the side effect of making debugfs[1] work on multi-GPU systems.

[1] https://lore.kernel.org/20260203224757.871729-1-ttabi@nvidia.com

Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Link: https://patch.msgid.link/20260221020952.412352-2-jhubbard@nvidia.com
[ Use LKMM atomics; inline and slightly reword TODO comment. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
drivers/gpu/nova-core/driver.rs