Skip to content

Commit 876b15d

Browse files
stevenprice-armbbrezillon
authored andcommitted
drm/panfrost: Fix module unload
When unloading the call to pm_runtime_put_sync_suspend() will attempt to turn the GPU cores off, however panfrost_device_fini() will have turned the clocks off. This leads to the hardware locking up. Instead don't call pm_runtime_put_sync_suspend() and instead simply mark the device as suspended using pm_runtime_set_suspended(). And also include this on the error path in panfrost_probe(). Fixes: aebe8c2 ("drm/panfrost: Fix possible suspend in panfrost_remove") Signed-off-by: Steven Price <steven.price@arm.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201030145833.29006-1-steven.price@arm.com
1 parent 7d2d6d0 commit 876b15d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/gpu/drm/panfrost/panfrost_drv.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ static int panfrost_probe(struct platform_device *pdev)
626626
err_out1:
627627
pm_runtime_disable(pfdev->dev);
628628
panfrost_device_fini(pfdev);
629+
pm_runtime_set_suspended(pfdev->dev);
629630
err_out0:
630631
drm_dev_put(ddev);
631632
return err;
@@ -640,9 +641,9 @@ static int panfrost_remove(struct platform_device *pdev)
640641
panfrost_gem_shrinker_cleanup(ddev);
641642

642643
pm_runtime_get_sync(pfdev->dev);
643-
panfrost_device_fini(pfdev);
644-
pm_runtime_put_sync_suspend(pfdev->dev);
645644
pm_runtime_disable(pfdev->dev);
645+
panfrost_device_fini(pfdev);
646+
pm_runtime_set_suspended(pfdev->dev);
646647

647648
drm_dev_put(ddev);
648649
return 0;

0 commit comments

Comments
 (0)