From patchwork Mon Mar 7 22:00:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 8523321 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DBC609F2B4 for ; Mon, 7 Mar 2016 22:01:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 131F42020F for ; Mon, 7 Mar 2016 22:01:42 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 38644200F4 for ; Mon, 7 Mar 2016 22:01:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED6AF6E433; Mon, 7 Mar 2016 22:01:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x233.google.com (mail-pf0-x233.google.com [IPv6:2607:f8b0:400e:c00::233]) by gabe.freedesktop.org (Postfix) with ESMTPS id F06596E42D for ; Mon, 7 Mar 2016 22:01:21 +0000 (UTC) Received: by mail-pf0-x233.google.com with SMTP id 63so86809792pfe.3 for ; Mon, 07 Mar 2016 14:01:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Trubl25bx0S/hNHxNsTj2mTfRKebRMLsB7Iyr48xB0Q=; b=YGZU0rIYOk9XDHSfcU+cvcJV2aqprQvAYcIHHvhETnBY7f7glzfUsyXgit+BzeORQ5 IjGn/RS7Eu6OJi2xHRm0TeMw+r+FCt/pk5W7ZANj3wqXth/nCgUB6/6bOnNUaDceOLaK GsJV+7UaIimFWLeOCcxTvaok6OPWVfZ408wB4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Trubl25bx0S/hNHxNsTj2mTfRKebRMLsB7Iyr48xB0Q=; b=E6M0UD4o8K2il+0I/v5e/KLcl/cYt6kd9eo/09QsEFwHW/+IL1OdGIdxdDGLJZtgpR pZiJkSBtPYvwsk96a6jLiJSS7TA9R8fzqcV84cDXX6cCkvDc9kxuVa2aj/sAnnnf0b08 JqKpazwhpzK/69oAT7WwoCOAQ/Ba8S0S1Z27UH7L2G5Ju1ECEIdJRN3EHb3eR9anWxu9 v0m7YKDeX4M0zgCda6V5BM6aJV1jhjM573dFZUJZILDj46NVGFEjt0uNPMuBS1sI1vg0 a0xBDBOOjRW4sGXNo89WPRMNa9EQ9N0mAVkc6mINBbOJjyk9324+D95dx3XoeSveuzZr SBLw== X-Gm-Message-State: AD7BkJL7om4ylDDvMWHlYc5QmPKznIUohxOqT5RjeQ5fN+sqOfTWfygTJwDBffdzL9L1QA== X-Received: by 10.98.7.14 with SMTP id b14mr37248097pfd.40.1457388081176; Mon, 07 Mar 2016 14:01:21 -0800 (PST) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by smtp.gmail.com with ESMTPSA id p26sm19964195pfi.84.2016.03.07.14.01.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Mar 2016 14:01:20 -0800 (PST) From: Douglas Anderson To: Mark Yao , David Airlie , linux@arm.linux.org.uk, Heiko Stuebner Subject: [PATCH v2 2/5] drm/imx: dw_hdmi: Call drm_encoder_cleanup() in error path Date: Mon, 7 Mar 2016 14:00:51 -0800 Message-Id: <1457388054-23077-2-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1457388054-23077-1-git-send-email-dianders@chromium.org> References: <1457388054-23077-1-git-send-email-dianders@chromium.org> Cc: john@keeping.me.uk, Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 The drm_encoder_cleanup() was missing both from the error path of dw_hdmi_imx_bind(). This caused a crash when slub_debug was enabled and we ended up deferring probe of HDMI at boot. This call isn't needed from unbind() because if dw_hdmi_bind() returns no error then it takes over the job of freeing the encoder (in dw_hdmi_unbind). Signed-off-by: Douglas Anderson --- Changes in v2: - IMX patch new in v2 drivers/gpu/drm/imx/dw_hdmi-imx.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/imx/dw_hdmi-imx.c b/drivers/gpu/drm/imx/dw_hdmi-imx.c index 2a95d10e9d92..c69c3142819c 100644 --- a/drivers/gpu/drm/imx/dw_hdmi-imx.c +++ b/drivers/gpu/drm/imx/dw_hdmi-imx.c @@ -245,7 +245,16 @@ static int dw_hdmi_imx_bind(struct device *dev, struct device *master, drm_encoder_init(drm, encoder, &dw_hdmi_imx_encoder_funcs, DRM_MODE_ENCODER_TMDS, NULL); - return dw_hdmi_bind(dev, master, data, encoder, iores, irq, plat_data); + ret = dw_hdmi_bind(dev, master, data, encoder, iores, irq, plat_data); + + /* + * If dw_hdmi_bind() fails we'll never call dw_hdmi_unbind(), + * which would have called the encoder cleanup. Do it manually. + */ + if (ret) + drm_encoder_cleanup(encoder); + + return ret; } static void dw_hdmi_imx_unbind(struct device *dev, struct device *master,