diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c index 88e28649c4002d0a8631ae4189f552a2d82a0f6d..3474b5c9f1740b2ef76835e5ab9aa9339b73cde3 100644 --- a/drivers/gpu/drm/xe/xe_pci.c +++ b/drivers/gpu/drm/xe/xe_pci.c @@ -364,6 +364,7 @@ static void xe_pci_remove(struct pci_dev *pdev) return; xe_device_remove(xe); + xe_pm_runtime_fini(xe); pci_set_drvdata(pdev, NULL); } diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c index fb0355530e7bdd955e194aa0d1c3e8cdbf617aed..0ef92b746595de2905488556d95fd450778b21bd 100644 --- a/drivers/gpu/drm/xe/xe_pm.c +++ b/drivers/gpu/drm/xe/xe_pm.c @@ -117,6 +117,14 @@ void xe_pm_runtime_init(struct xe_device *xe) pm_runtime_put_autosuspend(dev); } +void xe_pm_runtime_fini(struct xe_device *xe) +{ + struct device *dev = xe->drm.dev; + + pm_runtime_get_sync(dev); + pm_runtime_forbid(dev); +} + int xe_pm_runtime_suspend(struct xe_device *xe) { struct xe_gt *gt; diff --git a/drivers/gpu/drm/xe/xe_pm.h b/drivers/gpu/drm/xe/xe_pm.h index b8c5f9558e26379ae048b1927f5476d8d5c967c7..6a885585f65349dfa5591ba9e31c8c80d01edde5 100644 --- a/drivers/gpu/drm/xe/xe_pm.h +++ b/drivers/gpu/drm/xe/xe_pm.h @@ -14,6 +14,7 @@ int xe_pm_suspend(struct xe_device *xe); int xe_pm_resume(struct xe_device *xe); void xe_pm_runtime_init(struct xe_device *xe); +void xe_pm_runtime_fini(struct xe_device *xe); int xe_pm_runtime_suspend(struct xe_device *xe); int xe_pm_runtime_resume(struct xe_device *xe); int xe_pm_runtime_get(struct xe_device *xe);