From patchwork Thu Nov 20 23:42:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 5351341 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 829369F2F1 for ; Thu, 20 Nov 2014 23:43:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6EC7201FA for ; Thu, 20 Nov 2014 23:43:12 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2F3DB2021B for ; Thu, 20 Nov 2014 23:43:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9AC4B6F86C; Thu, 20 Nov 2014 15:43:09 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qg0-f45.google.com (mail-qg0-f45.google.com [209.85.192.45]) by gabe.freedesktop.org (Postfix) with ESMTP id 6F5366F81B for ; Thu, 20 Nov 2014 15:43:08 -0800 (PST) Received: by mail-qg0-f45.google.com with SMTP id f51so2893689qge.4 for ; Thu, 20 Nov 2014 15:43:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=29/A+DG9ULsCBmF1AH8CNCPtnbL5FovRQPIKrWepy0M=; b=Ufw4Qa49JN/ZFJF3VSz5uEIGhH7QGzIp29q+mM3WzjGVIYJGfNNT8EsL803UXeIfkM wOJBJTVcS2rhWbknN3FUrleH848h/gdumyGYg4+RGGqPtxSxBuWKtG77UonQdQbNT/R5 zrtcFfkRpJCkeqhiC2hnCsdzre1NIXzPmQtacw5sG+VLSYFvokZpyej4w8MalBJ5i8Xl YG80TiZo65QVqJavmJol+ngVTWmx1m5Xwo50xH0OnzSZmcSj++SSHqcjN8VjBGTJTiFh LT0Szsm6Get48bdGTYFWioWk8Wcw8oqqYeXT/JVtP+KMe1EWVnOeRDgBAqXY0LnmtNlO hHVw== X-Received: by 10.224.12.145 with SMTP id x17mr1629265qax.23.1416526988016; Thu, 20 Nov 2014 15:43:08 -0800 (PST) Received: from localhost.localdomain ([187.34.44.229]) by mx.google.com with ESMTPSA id o30sm961607qge.33.2014.11.20.15.43.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Nov 2014 15:43:07 -0800 (PST) From: Gustavo Padovan To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 2/3] Revert "drm/exynos: fix null pointer dereference issue" Date: Thu, 20 Nov 2014 21:42:55 -0200 Message-Id: <1416526976-9467-3-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1416526976-9467-1-git-send-email-gustavo@padovan.org> References: <1416526976-9467-1-git-send-email-gustavo@padovan.org> Cc: Gustavo Padovan , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 From: Gustavo Padovan This reverts commit cea24824ab432f8acabb254d6805e9aa756de6af. Moving subdriver probe to exynos_drm_platform_probe() was making exynos_drm_device_subdrv_probe() fail because the platform data wasn't set yet. It only gets set in exynos_drm_load. We need to find a smarter way to fix this issue. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index b94c9d1..91891cf 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -108,6 +108,11 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) if (ret) goto err_unbind_all; + /* Probe non kms sub drivers and virtual display driver. */ + ret = exynos_drm_device_subdrv_probe(dev); + if (ret) + goto err_cleanup_vblank; + /* * enable drm irq mode. * - with irq_enabled = true, we can use the vblank feature. @@ -133,6 +138,8 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) return 0; +err_cleanup_vblank: + drm_vblank_cleanup(dev); err_unbind_all: component_unbind_all(dev->dev, dev); err_mode_config_cleanup: @@ -146,6 +153,8 @@ err_free_private: static int exynos_drm_unload(struct drm_device *dev) { + exynos_drm_device_subdrv_remove(dev); + exynos_drm_fbdev_fini(dev); drm_kms_helper_poll_fini(dev); @@ -608,14 +617,8 @@ static int exynos_drm_platform_probe(struct platform_device *pdev) if (ret < 0) goto err_unregister_non_kms_drivers; - /* Probe non kms sub drivers and virtual display driver. */ - ret = exynos_drm_device_subdrv_probe(platform_get_drvdata(pdev)); - if (ret) - goto err_unregister_resources; - return ret; -err_unregister_resources: #ifdef CONFIG_DRM_EXYNOS_IPP exynos_platform_device_ipp_unregister(); #endif @@ -637,8 +640,6 @@ static int exynos_drm_platform_remove(struct platform_device *pdev) { int i; - exynos_drm_device_subdrv_remove(platform_get_drvdata(pdev)); - #ifdef CONFIG_DRM_EXYNOS_IPP exynos_platform_device_ipp_unregister(); #endif