drm/amdgpu: Use drm_dev_unplug in PCI .remove
authorAndrey Grodzovsky <andrey.grodzovsky@amd.com>
Thu, 30 Aug 2018 15:24:17 +0000 (11:24 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Sun, 2 Sep 2018 15:16:16 +0000 (10:16 -0500)
This at least allows to fail any subsequent IOCTLs with -ENODEV
after the device is gone.
Still this operation is not supported yet in graphic mode
and will lead at least to page faults and other issues.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

index d7d9a9d3238131a4c413fedc1ccb082999884769..a96ceff8abe36f3283eda47db1ecfd5d7d7210c8 100644 (file)
@@ -978,8 +978,8 @@ amdgpu_pci_remove(struct pci_dev *pdev)
 {
        struct drm_device *dev = pci_get_drvdata(pdev);
 
-       drm_dev_unregister(dev);
-       drm_dev_put(dev);
+       DRM_ERROR("Device removal is currently not supported outside of fbcon\n");
+       drm_dev_unplug(dev);
        pci_disable_device(pdev);
        pci_set_drvdata(pdev, NULL);
 }