Skip to contentSkip to conversation

drm/amdgpu: Use drm_dev_unplug in PCI .remove

PATCH In review Andrey Grodzovsky 2 participants 2 messages Aug 31, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Use drm_dev_unplug in PCI .remove

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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 -2
index d7d9a9d..66d14d3 100644
@@ -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_INFO("Device removal is currently not supported outside of fbcon\n");
+	drm_dev_unplug(dev);
 	pci_disable_device(pdev);
 	pci_set_drvdata(pdev, NULL);
 }
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1535731995-3343-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Am 31.08.2018 um 18:13 schrieb Andrey Grodzovsky:

Quoted 6 lines

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.

Well it is a start, Reviewed-by: Christian König <[email protected]>.

Quoted 9 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index d7d9a9d..66d14d3 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c amdgpu_pci_remove(struct pci_dev *pdev) · line 985

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 -2
@@ -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_INFO("Device removal is currently not supported outside of fbcon\n");
+	drm_dev_unplug(dev);
  	pci_disable_device(pdev);
  	pci_set_drvdata(pdev, NULL);
  }

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx