Message ID | 1364805830-6129-1-git-send-email-vikas.sajjan@linaro.org (mailing list archive) |
---|---|
State | Not Applicable, archived |
Delegated to: | Sylwester Nawrocki |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from <linux-media-owner@vger.kernel.org>) id 1UMaLf-0005fT-Gu; Mon, 01 Apr 2013 10:44:15 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp id 1UMaLe-0005Ej-CG; Mon, 01 Apr 2013 10:44:15 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758565Ab3DAIoE (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Mon, 1 Apr 2013 04:44:04 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:50680 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757853Ab3DAIoB (ORCPT <rfc822; linux-media@vger.kernel.org>); Mon, 1 Apr 2013 04:44:01 -0400 Received: by mail-pa0-f43.google.com with SMTP id hz11so1218997pad.2 for <linux-media@vger.kernel.org>; Mon, 01 Apr 2013 01:44:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=dKlCebkRfeopGo+V28v/0AxwmLlgJ3yKqI2YryIYcF0=; b=DV2Uf39Lt0giTz67U2UE+I5ecGJCiTMRh8zi0DHJvnAWWoYOHZk1hFiCvobypKoiI4 VSQbpfV34inMUjZIKnyrd9yUXlOEeRhy3xMlmuP81Pyvk3OGvJhLW0yRhIwIlq3oiKJh P+6x8r5yOcsMsPEKqYNIi+Z4uqYE76iErk/8RRJmvSEry7PGR54BjS05NMoVgnnuwk/r 3mqB0u2VwsIlUYM8igkh/Xio9WYZwB9rGxcfUUoqQimphBwHdUPZdCzDyOHteQWOCbe/ CZKChgW/2ot9TZkHJkEiwHny/gz1UXFHObn/sHyldA4KbxsWj4FG3w6E5Y2wBuXZ17x2 +2XA== X-Received: by 10.68.198.5 with SMTP id iy5mr16469532pbc.162.1364805840937; Mon, 01 Apr 2013 01:44:00 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id ef3sm14432877pad.20.2013.04.01.01.43.56 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Apr 2013 01:43:59 -0700 (PDT) From: Vikas Sajjan <vikas.sajjan@linaro.org> To: dri-devel@lists.freedesktop.org Cc: linux-media@vger.kernel.org, kgene.kim@samsung.com, inki.dae@samsung.com, linaro-kernel@lists.linaro.org, jy0922.shim@samsung.com, linux-samsung-soc@vger.kernel.org, thomas.abraham@linaro.org Subject: [PATCH v3] drm/exynos: enable FIMD clocks Date: Mon, 1 Apr 2013 14:13:50 +0530 Message-Id: <1364805830-6129-1-git-send-email-vikas.sajjan@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQlfA6+vQOGnjwTu1b3BwfpbZe3c+DFkzzfVIUYm2qCRtVKJsXP/EDESKhfRITLO+rOt3zFR Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.4.1.83318 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_NOT_1 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' |
Commit Message
Vikas Sajjan
April 1, 2013, 8:43 a.m. UTC
While migrating to common clock framework (CCF), found that the FIMD clocks
were pulled down by the CCF.
If CCF finds any clock(s) which has NOT been claimed by any of the
drivers, then such clock(s) are PULLed low by CCF.
By calling clk_prepare_enable() for FIMD clocks fixes the issue.
this patch also replaces clk_disable() with clk_disable_unprepare()
during exit.
Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
---
Changes since v2:
- moved clk_prepare_enable() and clk_disable_unprepare() from
fimd_probe() to fimd_clock() as suggested by Inki Dae <inki.dae@samsung.com>
Changes since v1:
- added error checking for clk_prepare_enable() and also replaced
clk_disable() with clk_disable_unprepare() during exit.
---
drivers/gpu/drm/exynos/exynos_drm_fimd.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
Comments
On 1 April 2013 14:13, Vikas Sajjan <vikas.sajjan@linaro.org> wrote: > While migrating to common clock framework (CCF), found that the FIMD clocks s/found/we found/ > were pulled down by the CCF. > If CCF finds any clock(s) which has NOT been claimed by any of the > drivers, then such clock(s) are PULLed low by CCF. > > By calling clk_prepare_enable() for FIMD clocks fixes the issue. s/By calling/Calling/ and s/the/this > this patch also replaces clk_disable() with clk_disable_unprepare() s/this/This > during exit. Sorry but your log doesn't say what you are doing. You are just adding relevant calls to clk_prepare/unprepare() before calling clk_enable/disable. > Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org> > --- > Changes since v2: > - moved clk_prepare_enable() and clk_disable_unprepare() from > fimd_probe() to fimd_clock() as suggested by Inki Dae <inki.dae@samsung.com> > Changes since v1: > - added error checking for clk_prepare_enable() and also replaced > clk_disable() with clk_disable_unprepare() during exit. > --- > drivers/gpu/drm/exynos/exynos_drm_fimd.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > index 9537761..f2400c8 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > @@ -799,18 +799,18 @@ static int fimd_clock(struct fimd_context *ctx, bool enable) > if (enable) { > int ret; > > - ret = clk_enable(ctx->bus_clk); > + ret = clk_prepare_enable(ctx->bus_clk); > if (ret < 0) > return ret; > > - ret = clk_enable(ctx->lcd_clk); > + ret = clk_prepare_enable(ctx->lcd_clk); > if (ret < 0) { > - clk_disable(ctx->bus_clk); > + clk_disable_unprepare(ctx->bus_clk); > return ret; > } > } else { > - clk_disable(ctx->lcd_clk); > - clk_disable(ctx->bus_clk); > + clk_disable_unprepare(ctx->lcd_clk); > + clk_disable_unprepare(ctx->bus_clk); > } > > return 0; > @@ -981,8 +981,8 @@ static int fimd_remove(struct platform_device *pdev) > if (ctx->suspended) > goto out; > > - clk_disable(ctx->lcd_clk); > - clk_disable(ctx->bus_clk); > + clk_disable_unprepare(ctx->lcd_clk); > + clk_disable_unprepare(ctx->bus_clk); You are doing things at the right place but i have a suggestion. Are you doing anything in your clk_prepare() atleast for this device? Probably not. If not, then its better to call clk_prepare/unprepare only once at probe/remove and keep clk_enable/disable calls as is. -- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi, Mr. Vikas Please fix the below typos Viresh pointed out and my comments. > -----Original Message----- > From: Viresh Kumar [mailto:viresh.kumar@linaro.org] > Sent: Monday, April 01, 2013 5:51 PM > To: Vikas Sajjan > Cc: dri-devel@lists.freedesktop.org; linux-samsung-soc@vger.kernel.org; > jy0922.shim@samsung.com; inki.dae@samsung.com; kgene.kim@samsung.com; > linaro-kernel@lists.linaro.org; linux-media@vger.kernel.org > Subject: Re: [PATCH v3] drm/exynos: enable FIMD clocks > > On 1 April 2013 14:13, Vikas Sajjan <vikas.sajjan@linaro.org> wrote: > > While migrating to common clock framework (CCF), found that the FIMD > clocks > > s/found/we found/ > > > were pulled down by the CCF. > > If CCF finds any clock(s) which has NOT been claimed by any of the > > drivers, then such clock(s) are PULLed low by CCF. > > > > By calling clk_prepare_enable() for FIMD clocks fixes the issue. > > s/By calling/Calling/ > > and > > s/the/this > > > this patch also replaces clk_disable() with clk_disable_unprepare() > > s/this/This > > > during exit. > > Sorry but your log doesn't say what you are doing. You are just adding > relevant calls to clk_prepare/unprepare() before calling > clk_enable/disable. > > > Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org> > > --- > > Changes since v2: > > - moved clk_prepare_enable() and clk_disable_unprepare() from > > fimd_probe() to fimd_clock() as suggested by Inki Dae > <inki.dae@samsung.com> > > Changes since v1: > > - added error checking for clk_prepare_enable() and also replaced > > clk_disable() with clk_disable_unprepare() during exit. > > --- > > drivers/gpu/drm/exynos/exynos_drm_fimd.c | 14 +++++++------- > > 1 file changed, 7 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c > b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > > index 9537761..f2400c8 100644 > > --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c > > +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > > @@ -799,18 +799,18 @@ static int fimd_clock(struct fimd_context *ctx, > bool enable) > > if (enable) { > > int ret; > > > > - ret = clk_enable(ctx->bus_clk); > > + ret = clk_prepare_enable(ctx->bus_clk); > > if (ret < 0) > > return ret; > > > > - ret = clk_enable(ctx->lcd_clk); > > + ret = clk_prepare_enable(ctx->lcd_clk); > > if (ret < 0) { > > - clk_disable(ctx->bus_clk); > > + clk_disable_unprepare(ctx->bus_clk); > > return ret; > > } > > } else { > > - clk_disable(ctx->lcd_clk); > > - clk_disable(ctx->bus_clk); > > + clk_disable_unprepare(ctx->lcd_clk); > > + clk_disable_unprepare(ctx->bus_clk); > > } > > > > return 0; > > @@ -981,8 +981,8 @@ static int fimd_remove(struct platform_device *pdev) > > if (ctx->suspended) > > goto out; > > > > - clk_disable(ctx->lcd_clk); > > - clk_disable(ctx->bus_clk); > > + clk_disable_unprepare(ctx->lcd_clk); > > + clk_disable_unprepare(ctx->bus_clk); Just remove the above codes. It seems that clk_disable(also clk_disable_unprepare) isn't needed because it will be done by pm_runtime_put_sync and please re-post it(probably patch v5??) Thanks, Inki Dae > > You are doing things at the right place but i have a suggestion. Are you > doing > anything in your clk_prepare() atleast for this device? Probably not. > > If not, then its better to call clk_prepare/unprepare only once at > probe/remove > and keep clk_enable/disable calls as is. > > -- > viresh -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 9537761..f2400c8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -799,18 +799,18 @@ static int fimd_clock(struct fimd_context *ctx, bool enable) if (enable) { int ret; - ret = clk_enable(ctx->bus_clk); + ret = clk_prepare_enable(ctx->bus_clk); if (ret < 0) return ret; - ret = clk_enable(ctx->lcd_clk); + ret = clk_prepare_enable(ctx->lcd_clk); if (ret < 0) { - clk_disable(ctx->bus_clk); + clk_disable_unprepare(ctx->bus_clk); return ret; } } else { - clk_disable(ctx->lcd_clk); - clk_disable(ctx->bus_clk); + clk_disable_unprepare(ctx->lcd_clk); + clk_disable_unprepare(ctx->bus_clk); } return 0; @@ -981,8 +981,8 @@ static int fimd_remove(struct platform_device *pdev) if (ctx->suspended) goto out; - clk_disable(ctx->lcd_clk); - clk_disable(ctx->bus_clk); + clk_disable_unprepare(ctx->lcd_clk); + clk_disable_unprepare(ctx->bus_clk); pm_runtime_set_suspended(dev); pm_runtime_put_sync(dev);