Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934331AbeAJJ7U (ORCPT + 1 other); Wed, 10 Jan 2018 04:59:20 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:57554 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934273AbeAJJ7B (ORCPT ); Wed, 10 Jan 2018 04:59:01 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6DBFB601D4 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=architt@codeaurora.org Subject: Re: [PATCH v7 4/8] drm/rockchip: dw-mipi-dsi: Fix error handling path To: Thierry Escande , Rob Herring , Daniel Vetter , Neil Armstrong , Laurent Pinchart , Sandy Huang Cc: Jeffy Chen , Sean Paul , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org References: <20180109144853.32536-1-thierry.escande@collabora.com> <20180109144853.32536-5-thierry.escande@collabora.com> From: Archit Taneja Message-ID: <3878b65a-2a44-dc9a-64d9-ca29229fa987@codeaurora.org> Date: Wed, 10 Jan 2018 15:28:55 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20180109144853.32536-5-thierry.escande@collabora.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 01/09/2018 08:18 PM, Thierry Escande wrote: > From: Jeffy Chen > > Add missing pm_runtime_disable() in bind()'s error handling path. > > Also cleanup encoder & connector in unbind(). I guess you'll need to drop this commit if this patch goes in first: https://patchwork.kernel.org/patch/10106105/ Thanks, Archit > > Fixes: 80a9a059d4e4 ("drm/rockchip/dsi: add dw-mipi power domain support") > Signed-off-by: Jeffy Chen > Signed-off-by: Thierry Escande > --- > drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 21 +++++++++++++-------- > 1 file changed, 13 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c > index b1fe0639227e..78e6b7919bf7 100644 > --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c > +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c > @@ -1282,7 +1282,7 @@ static int dw_mipi_dsi_bind(struct device *dev, struct device *master, > ret = dw_mipi_dsi_register(drm, dsi); > if (ret) { > DRM_DEV_ERROR(dev, "Failed to register mipi_dsi: %d\n", ret); > - goto err_pllref; > + goto err_disable_pllref; > } > > dsi->dsi_host.ops = &dw_mipi_dsi_host_ops; > @@ -1290,24 +1290,25 @@ static int dw_mipi_dsi_bind(struct device *dev, struct device *master, > ret = mipi_dsi_host_register(&dsi->dsi_host); > if (ret) { > DRM_DEV_ERROR(dev, "Failed to register MIPI host: %d\n", ret); > - goto err_cleanup; > + goto err_disable_pm_runtime; > } > > if (!dsi->panel) { > ret = -EPROBE_DEFER; > - goto err_mipi_dsi_host; > + goto err_unreg_mipi_dsi_host; > } > > dev_set_drvdata(dev, dsi); > pm_runtime_enable(dev); > return 0; > > -err_mipi_dsi_host: > +err_unreg_mipi_dsi_host: > mipi_dsi_host_unregister(&dsi->dsi_host); > -err_cleanup: > - drm_encoder_cleanup(&dsi->encoder); > - drm_connector_cleanup(&dsi->connector); > -err_pllref: > +err_disable_pm_runtime: > + pm_runtime_disable(dev); > + dsi->connector.funcs->destroy(&dsi->connector); > + dsi->encoder.funcs->destroy(&dsi->encoder); > +err_disable_pllref: > clk_disable_unprepare(dsi->pllref_clk); > return ret; > } > @@ -1319,6 +1320,10 @@ static void dw_mipi_dsi_unbind(struct device *dev, struct device *master, > > mipi_dsi_host_unregister(&dsi->dsi_host); > pm_runtime_disable(dev); > + > + dsi->connector.funcs->destroy(&dsi->connector); > + dsi->encoder.funcs->destroy(&dsi->encoder); > + > clk_disable_unprepare(dsi->pllref_clk); > } > > -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project