Skip to content

Commit 0b579de

Browse files
vprosyaklyndonli-amd
authored andcommitted
Revert "drm/amdgpu: TA unload messages are not actually sent to psp when amdgpu is uninstalled"
This reverts commit fac5347. The following change: move the drm_dev_unplug call after amdgpu_driver_unload_kms in amdgpu_pci_remove. The reason is the following: amdgpu_pci_remove calls drm_dev_unregister and it should be called first to ensure userspace can't access the device instance anymore. If we call drm_dev_unplug after amdgpu_driver_unload_kms then we observe IGT PCI software unplug test failure (kernel hung) for all ASICs. This is how this regression was found. After this revert, the following commands do work not, but it would be fixed in the next commit: - sudo modprobe -r amdgpu - sudo modprobe amdgpu Signed-off-by: Vitaly Prosyak <[email protected]> Reviewed-by Alex Deucher <[email protected]>
1 parent 166c089 commit 0b579de

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4072,7 +4072,8 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)
40724072

40734073
amdgpu_gart_dummy_page_fini(adev);
40744074

4075-
amdgpu_device_unmap_mmio(adev);
4075+
if (drm_dev_is_unplugged(adev_to_drm(adev)))
4076+
amdgpu_device_unmap_mmio(adev);
40764077

40774078
}
40784079

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2282,6 +2282,8 @@ amdgpu_pci_remove(struct pci_dev *pdev)
22822282
struct drm_device *dev = pci_get_drvdata(pdev);
22832283
struct amdgpu_device *adev = drm_to_adev(dev);
22842284

2285+
drm_dev_unplug(dev);
2286+
22852287
if (adev->pm.rpm_mode != AMDGPU_RUNPM_NONE) {
22862288
pm_runtime_get_sync(dev->dev);
22872289
pm_runtime_forbid(dev->dev);
@@ -2321,8 +2323,6 @@ amdgpu_pci_remove(struct pci_dev *pdev)
23212323

23222324
amdgpu_driver_unload_kms(dev);
23232325

2324-
drm_dev_unplug(dev);
2325-
23262326
/*
23272327
* Flush any in flight DMA operations from device.
23282328
* Clear the Bus Master Enable bit and then wait on the PCIe Device

0 commit comments

Comments
 (0)