aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInki Dae <inki.dae@samsung.com>2014-11-07 07:32:34 -0500
committerInki Dae <inki.dae@samsung.com>2014-11-10 00:40:10 -0500
commit7afbfcc9ae6af259351e6fa6b931b1a38b62d9ab (patch)
treed115ae4591c8b3e38f958ab5ea9850dc11672672
parent9ad703e9435a5a9fb267b69af298498dc7d0db55 (diff)
drm/exynos: fix possible infinite loop issue
This patch fixes possible infinite loop issue by postponing registration to non kms drivers after component_master_add_with_match call, which can be incurred in all cases that non kms driver is probed and then component bind is failed This patch should be applied on top of below patches, http://comments.gmane.org/gmane.comp.video.dri.devel/117740 http://www.spinics.net/lists/linux-samsung-soc/msg38624.html Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_drv.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index b8abbc4a3d8b..e5c4c6c8c967 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -591,10 +591,21 @@ static int exynos_drm_platform_probe(struct platform_device *pdev)
591 goto err_unregister_mixer_drv; 591 goto err_unregister_mixer_drv;
592#endif 592#endif
593 593
594 match = exynos_drm_match_add(&pdev->dev);
595 if (IS_ERR(match)) {
596 ret = PTR_ERR(match);
597 goto err_unregister_hdmi_drv;
598 }
599
600 ret = component_master_add_with_match(&pdev->dev, &exynos_drm_ops,
601 match);
602 if (ret < 0)
603 goto err_unregister_hdmi_drv;
604
594#ifdef CONFIG_DRM_EXYNOS_G2D 605#ifdef CONFIG_DRM_EXYNOS_G2D
595 ret = platform_driver_register(&g2d_driver); 606 ret = platform_driver_register(&g2d_driver);
596 if (ret < 0) 607 if (ret < 0)
597 goto err_unregister_hdmi_drv; 608 goto err_del_component_master;
598#endif 609#endif
599 610
600#ifdef CONFIG_DRM_EXYNOS_FIMC 611#ifdef CONFIG_DRM_EXYNOS_FIMC
@@ -625,23 +636,9 @@ static int exynos_drm_platform_probe(struct platform_device *pdev)
625 goto err_unregister_ipp_drv; 636 goto err_unregister_ipp_drv;
626#endif 637#endif
627 638
628 match = exynos_drm_match_add(&pdev->dev);
629 if (IS_ERR(match)) {
630 ret = PTR_ERR(match);
631 goto err_unregister_resources;
632 }
633
634 ret = component_master_add_with_match(&pdev->dev, &exynos_drm_ops,
635 match);
636 if (ret < 0)
637 goto err_unregister_resources;
638
639 return ret; 639 return ret;
640 640
641err_unregister_resources:
642
643#ifdef CONFIG_DRM_EXYNOS_IPP 641#ifdef CONFIG_DRM_EXYNOS_IPP
644 exynos_platform_device_ipp_unregister();
645err_unregister_ipp_drv: 642err_unregister_ipp_drv:
646 platform_driver_unregister(&ipp_driver); 643 platform_driver_unregister(&ipp_driver);
647err_unregister_gsc_drv: 644err_unregister_gsc_drv:
@@ -664,9 +661,11 @@ err_unregister_g2d_drv:
664 661
665#ifdef CONFIG_DRM_EXYNOS_G2D 662#ifdef CONFIG_DRM_EXYNOS_G2D
666 platform_driver_unregister(&g2d_driver); 663 platform_driver_unregister(&g2d_driver);
667err_unregister_hdmi_drv: 664err_del_component_master:
668#endif 665#endif
666 component_master_del(&pdev->dev, &exynos_drm_ops);
669 667
668err_unregister_hdmi_drv:
670#ifdef CONFIG_DRM_EXYNOS_HDMI 669#ifdef CONFIG_DRM_EXYNOS_HDMI
671 platform_driver_unregister(&hdmi_driver); 670 platform_driver_unregister(&hdmi_driver);
672err_unregister_mixer_drv: 671err_unregister_mixer_drv: