Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: make IB test synchronize with init for SRIOV(v2)

issue:
originally we kickoff IB test asynchronously with driver's
init, thus
the IB test may still running when the driver loading
done (modprobe amdgpu done).
if we shutdown VM immediately after amdgpu driver
loaded then GPU may
hang because the IB test is still running

fix:
flush the delayed_init routine at the bottom of device_init
to avoid driver loading done prior to the IB test completes

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Monk Liu and committed by
Alex Deucher
2c738637 5d7c6f18

+3
+3
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
··· 3295 3295 queue_delayed_work(system_wq, &adev->delayed_init_work, 3296 3296 msecs_to_jiffies(AMDGPU_RESUME_MS)); 3297 3297 3298 + if (amdgpu_sriov_vf(adev)) 3299 + flush_delayed_work(&adev->delayed_init_work); 3300 + 3298 3301 r = sysfs_create_files(&adev->dev->kobj, amdgpu_dev_attributes); 3299 3302 if (r) { 3300 3303 dev_err(adev->dev, "Could not create amdgpu device attr\n");