From patchwork Fri Mar 4 23:22:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 8508171 Return-Path: X-Original-To: patchwork-linux-rockchip@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 0E9B49F38C for ; Fri, 4 Mar 2016 23:23:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1AF4D20295 for ; Fri, 4 Mar 2016 23:23:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 01D1320254 for ; Fri, 4 Mar 2016 23:23:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1abz3n-0001xj-MT; Fri, 04 Mar 2016 23:23:03 +0000 Received: from mail-pf0-x234.google.com ([2607:f8b0:400e:c00::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1abz3k-0001p2-Pa for linux-rockchip@lists.infradead.org; Fri, 04 Mar 2016 23:23:01 +0000 Received: by mail-pf0-x234.google.com with SMTP id 63so42844175pfe.3 for ; Fri, 04 Mar 2016 15:22:40 -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; bh=oIPZ5p5MQL8ncb+P3euuw4jJBpEZrqKknhGKl6IGcvk=; b=O2PmkDTz16Uzn3/rG8F8QajdTz8fpWCahYnKH0WSTAuG4FZtWMl+uMaQiR3xQnZPDo PEhkhsurJ27yDDjPKmXNp+ZHTzaWi3Vb8ftL9z2XAa17bqtBTLzGBRdMf5yZUGA6C7zJ 9zYrmhsWOfv2Ms+MEnrNXHFOlM++/RhdbZCFc= 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; bh=oIPZ5p5MQL8ncb+P3euuw4jJBpEZrqKknhGKl6IGcvk=; b=SUECLvqpT1zWq1PG7285uRCDz0PO4dYfy6KuctNUfSAMtQO6CKtiBZFrQnIVzvWc7M 1suLJ6pf7cQ5ei6KnJG7WQzLSamimdyWxsK2hbd6ZwqjLZ/LxLB4RY33DX10aLAYS5oI YVZidwEecKPd37UGmn1bffZFTKvzli6zhKUb6cJGI6d1jxd/keOUWNUbDerpeoJ+qy9s Z/n7Kir/vyeXrLGXbH8lsoejigxg1OiCLiDuwfz/gyzotUXQTPjOaQlMqzRE1DVVhqbh gfM2ovkQdBzaYWLnQKgagp7AA4EXLS/dbkqOgj7xqidWXCr8+s9GxhZd3goNHs0VkpeU OLBw== X-Gm-Message-State: AD7BkJI4cwUeOZSK4lenLaSUMBpaTYF/Kd5dsZSd2bp1IdkczrSVA224vUUW1hiej1Q4aQ== X-Received: by 10.98.70.139 with SMTP id o11mr15800732pfi.123.1457133759843; Fri, 04 Mar 2016 15:22:39 -0800 (PST) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by smtp.gmail.com with ESMTPSA id 67sm7897375pfi.2.2016.03.04.15.22.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Mar 2016 15:22:39 -0800 (PST) From: Douglas Anderson To: Mark Yao , David Airlie , Heiko Stuebner Subject: [PATCH 1/2] drm/rockchip: dw_hdmi: Call drm_encoder_cleanup() in error path Date: Fri, 4 Mar 2016 15:22:01 -0800 Message-Id: <1457133723-24869-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160304_152300_921659_D022F4D2 X-CRM114-Status: GOOD ( 11.92 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Daniel Kurtz , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org 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=ham 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_rockchip_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 --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 3d3cf2f8891e..88776aba984e 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -293,7 +293,16 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, drm_encoder_init(drm, encoder, &dw_hdmi_rockchip_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_rockchip_unbind(struct device *dev, struct device *master,