From patchwork Fri Nov 7 12:49:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 5252151 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BDC60C11AC for ; Fri, 7 Nov 2014 12:49:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EAB5620145 for ; Fri, 7 Nov 2014 12:49:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E6CEB20123 for ; Fri, 7 Nov 2014 12:49:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751877AbaKGMto (ORCPT ); Fri, 7 Nov 2014 07:49:44 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:64520 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751763AbaKGMtn (ORCPT ); Fri, 7 Nov 2014 07:49:43 -0500 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NEO00MZN6ATZ600@mailout4.samsung.com> for linux-samsung-soc@vger.kernel.org; Fri, 07 Nov 2014 21:49:41 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.116]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 64.13.17016.5EFBC545; Fri, 07 Nov 2014 21:49:41 +0900 (KST) X-AuditID: cbfee68d-f79296d000004278-82-545cbfe562bb Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 8A.C9.20081.5EFBC545; Fri, 07 Nov 2014 21:49:41 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.252.83.67]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NEO00JQN6ATX890@mmp2.samsung.com>; Fri, 07 Nov 2014 21:49:41 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Cc: linux-samsung-soc@vger.kernel.org, Inki Dae Subject: [PATCH] drm/exynos: fix possible infinite loop issue Date: Fri, 07 Nov 2014 21:49:40 +0900 Message-id: <1415364581-14646-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPLMWRmVeSWpSXmKPExsWyRsSkRPfp/pgQg4/rlSx6z51ksrjy9T2b xaT7E1gsZpzfx+TA4rH92wNWj/vdx5k8+rasYvT4vEkugCWKyyYlNSezLLVI3y6BK2PihS/s BeuEK/bevcnUwLhXoIuRk0NCwERiY/tNVghbTOLCvfVsXYxcHEICSxkl1u/qYocpOnO5kwki MZ1R4tWqc4wQTjeTxJmTV8Gq2ARUJSauuM8GYosImEp0TFrKAmIzC7hJLD69HMwWFrCVaD91 jQnEZgGqn/XnIyOIzSvgIvFkyUGgORxA2xQk5kyyAZkvIfCYTaJ7WgcrRL2AxLfJh1ggamQl Nh1ghjhOUuLgihssExgFFzAyrGIUTS1ILihOSi8y1CtOzC0uzUvXS87P3cQIDMfT/5717mC8 fcD6EKMAB6MSD+8N3pgQIdbEsuLK3EOMpkAbJjJLiSbnA4M+ryTe0NjMyMLUxNTYyNzSTEmc V1HqZ7CQQHpiSWp2ampBalF8UWlOavEhRiYOTqkGRt8XWxfNbVZ+NVd8pfaOmomJAntUlC+J /3QPsHyY9krU8u2rY4X71nvenV3j2rZwIrtR+N3WoJt3V6xYckbU+kLvt6e8iz7V8RnesDvY s3mC36d5S17X5nwvEdCateLCwbjZfYf2bxAJfKAdu8uwe9mfA/uz+rKv3Nfwaup2vcEgsZHl 3a23CaxKLMUZiYZazEXFiQAlhwJiQgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJLMWRmVeSWpSXmKPExsVy+t9jQd2n+2NCDM5+l7LoPXeSyeLK1/ds FpPuT2CxmHF+H5MDi8f2bw9YPe53H2fy6NuyitHj8ya5AJaoBkabjNTElNQihdS85PyUzLx0 WyXv4HjneFMzA0NdQ0sLcyWFvMTcVFslF58AXbfMHKCdSgpliTmlQKGAxOJiJX07TBNCQ9x0 LWAaI3R9Q4LgeowM0EDCGsaMiRe+sBesE67Ye/cmUwPjXoEuRk4OCQETiTOXO5kgbDGJC/fW s3UxcnEICUxnlHi16hwjhNPNJHHm5FV2kCo2AVWJiSvus4HYIgKmEh2TlrKA2MwCbhKLTy8H s4UFbCXaT10Dm8oCVD/rz0dGEJtXwEXiyZKDQHM4gLYpSMyZZDOBkXsBI8MqRtHUguSC4qT0 XEO94sTc4tK8dL3k/NxNjOBgfya1g3Flg8UhRgEORiUe3pu8MSFCrIllxZW5hxglOJiVRHgL 9gGFeFMSK6tSi/Lji0pzUosPMZoCLZ/ILCWanA+MxLySeENjEzMjSyNzQwsjY3Mlcd4DrdaB QgLpiSWp2ampBalFMH1MHJxSDYwS+i0toluWXfeaVsPLvupoxA4tk1/7uJUyP33ZoH219/iL oOykW3XMZqJBi6r3dJdsNZjpvOX67N7e0rnHT5men6qZM2XBE7sJKzNr0rt676r78E/iE3J8 sqAgwJRDMKXi54WZt75bxd++5CLBstdLjPFMmBn/IvG7y9dNrYkUe7Z409+rQneVWIozEg21 mIuKEwHyHMYMjAIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 31 +++++++++++++++---------------- 1 file 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 14c6af7..e80a8db 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -584,10 +584,21 @@ static int exynos_drm_platform_probe(struct platform_device *pdev) goto err_unregister_mixer_drv; #endif + match = exynos_drm_match_add(&pdev->dev); + if (IS_ERR(match)) { + ret = PTR_ERR(match); + goto err_unregister_hdmi_drv; + } + + ret = component_master_add_with_match(&pdev->dev, &exynos_drm_ops, + match); + if (ret < 0) + goto err_unregister_hdmi_drv; + #ifdef CONFIG_DRM_EXYNOS_G2D ret = platform_driver_register(&g2d_driver); if (ret < 0) - goto err_unregister_hdmi_drv; + goto err_del_component_master; #endif #ifdef CONFIG_DRM_EXYNOS_FIMC @@ -618,23 +629,9 @@ static int exynos_drm_platform_probe(struct platform_device *pdev) goto err_unregister_ipp_drv; #endif - match = exynos_drm_match_add(&pdev->dev); - if (IS_ERR(match)) { - ret = PTR_ERR(match); - goto err_unregister_resources; - } - - ret = component_master_add_with_match(&pdev->dev, &exynos_drm_ops, - match); - if (ret < 0) - goto err_unregister_resources; - return ret; -err_unregister_resources: - #ifdef CONFIG_DRM_EXYNOS_IPP - exynos_platform_device_ipp_unregister(); err_unregister_ipp_drv: platform_driver_unregister(&ipp_driver); err_unregister_gsc_drv: @@ -657,9 +654,11 @@ err_unregister_g2d_drv: #ifdef CONFIG_DRM_EXYNOS_G2D platform_driver_unregister(&g2d_driver); -err_unregister_hdmi_drv: +err_del_component_master: #endif + component_master_del(&pdev->dev, &exynos_drm_ops); +err_unregister_hdmi_drv: #ifdef CONFIG_DRM_EXYNOS_HDMI platform_driver_unregister(&hdmi_driver); err_unregister_mixer_drv: