aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Herring <[email protected]>2019-08-22 21:12:09 -0500
committerRob Herring <[email protected]>2019-08-23 11:54:06 -0500
commit593bc4d008cf75daa924f73bd39b34dd03c4e8de (patch)
tree0d7ff171c4ca2e9907f376226fbfb946c424a0ee
parent97588c89993d1fb6bf4026984c0c099a5122b0b2 (diff)
drm/panfrost: Fix possible suspend in panfrost_remove
Calls to panfrost_device_fini() access the h/w, but we already done a pm_runtime_put_sync_autosuspend() beforehand. This only works if the autosuspend delay is long enough. A 0ms delay will hang the system when removing the device. Fix this by moving the pm_runtime_put_sync_suspend() after the panfrost_device_fini() call. Cc: Tomeu Vizoso <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Steven Price <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/panfrost/panfrost_drv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index 44a558c6e17e..d74442d71048 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -570,11 +570,13 @@ static int panfrost_remove(struct platform_device *pdev)
drm_dev_unregister(ddev);
panfrost_gem_shrinker_cleanup(ddev);
+
pm_runtime_get_sync(pfdev->dev);
- pm_runtime_put_sync_autosuspend(pfdev->dev);
- pm_runtime_disable(pfdev->dev);
panfrost_devfreq_fini(pfdev);
panfrost_device_fini(pfdev);
+ pm_runtime_put_sync_suspend(pfdev->dev);
+ pm_runtime_disable(pfdev->dev);
+
drm_dev_put(ddev);
return 0;
}