]> git.ipfire.org Git - thirdparty/linux.git/commit
vfio/nvgrace-gpu: split the code to wait for GPU ready
authorAnkit Agrawal <ankita@nvidia.com>
Thu, 27 Nov 2025 17:06:30 +0000 (17:06 +0000)
committerAlex Williamson <alex@shazbot.org>
Fri, 28 Nov 2025 17:07:25 +0000 (10:07 -0700)
commit7d055071d73bac7acc3a0b441f0632f564f048fe
tree4354c7bd669d9c39e4d8f83f0c481c7d57976d40
parent7f5764e179c66f4d3776b4fcb78b383ebcd99fb3
vfio/nvgrace-gpu: split the code to wait for GPU ready

Split the function that check for the GPU device being ready on
the probe.

Move the code to wait for the GPU to be ready through BAR0 register
reads to a separate function. This would help reuse the code.

This also fixes a bug where the return status in case of timeout
gets overridden by return from pci_enable_device. With the fix,
a timeout generate an error as initially intended.

Fixes: d85f69d520e6 ("vfio/nvgrace-gpu: Check the HBM training and C2C link status")
Reviewed-by: Zhi Wang <zhiw@nvidia.com>
Reviewed-by: Shameer Kolothum <skolothumtho@nvidia.com>
Signed-off-by: Ankit Agrawal <ankita@nvidia.com>
Link: https://lore.kernel.org/r/20251127170632.3477-5-ankita@nvidia.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
drivers/vfio/pci/nvgrace-gpu/main.c