disp: msm: fix driver unload issues in gki config

Resolves segmentation fault during driver unload in GKI
configuration, caused by repeated debugfs destroy calls.
Also removes redundant unload calls.

Change-Id: I20a8efc1916b9a60766f9c7714a4b458aa518566
Signed-off-by: Orion Brody <obrody@codeaurora.org>
This commit is contained in:
Orion Brody
2020-06-03 12:02:08 -07:00
والد a995ee8ca1
کامیت 66f04c4716
4فایلهای تغییر یافته به همراه27 افزوده شده و 23 حذف شده

مشاهده پرونده

@@ -397,13 +397,9 @@ static int msm_drm_uninit(struct device *dev)
struct msm_vm_client_entry *client_entry, *tmp;
int i;
/* We must cancel and cleanup any pending vblank enable/disable
* work before drm_irq_uninstall() to avoid work re-enabling an
* irq after uninstall has disabled it.
*/
flush_workqueue(priv->wq);
destroy_workqueue(priv->wq);
pm_runtime_get_sync(dev);
/* clean up display commit/event worker threads */
for (i = 0; i < priv->num_crtcs; i++) {
if (priv->disp_thread[i].thread) {
@@ -420,7 +416,11 @@ static int msm_drm_uninit(struct device *dev)
}
drm_kms_helper_poll_fini(ddev);
if (kms && kms->funcs)
kms->funcs->debugfs_destroy(kms);
sde_dbg_destroy();
debugfs_remove_recursive(priv->debug_root);
drm_mode_config_cleanup(ddev);
if (priv->registered) {
@@ -433,11 +433,7 @@ static int msm_drm_uninit(struct device *dev)
msm_fbdev_free(ddev);
#endif
drm_atomic_helper_shutdown(ddev);
drm_mode_config_cleanup(ddev);
pm_runtime_get_sync(dev);
drm_irq_uninstall(ddev);
pm_runtime_put_sync(dev);
if (kms && kms->funcs)
kms->funcs->destroy(kms);
@@ -450,9 +446,7 @@ static int msm_drm_uninit(struct device *dev)
}
component_unbind_all(dev, ddev);
sde_dbg_destroy();
debugfs_remove_recursive(priv->debug_root);
pm_runtime_put_sync(dev);
sde_power_resource_deinit(pdev, &priv->phandle);
@@ -470,6 +464,7 @@ static int msm_drm_uninit(struct device *dev)
msm_mdss_destroy(ddev);
ddev->dev_private = NULL;
destroy_workqueue(priv->wq);
kfree(priv);
drm_dev_put(ddev);
@@ -2090,8 +2085,6 @@ static int msm_pdev_remove(struct platform_device *pdev)
component_master_del(&pdev->dev, &msm_drm_ops);
of_platform_depopulate(&pdev->dev);
msm_drm_unbind(&pdev->dev);
component_master_del(&pdev->dev, &msm_drm_ops);
return 0;
}