From: Thierry Reding <thierry.reding@gmail.com>
To: Lin Huang <hl@rock-chips.com>
Cc: heiko@sntech.de, mark.yao@rock-chips.com,
myungjoo.ham@samsung.com, mturquette@baylibre.com,
sboyd@codeaurora.org, linux-clk@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, airlied@linux.ie,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
kyungmin.park@samsung.com, dianders@chromium.org,
dbasehore@chromium.org, huangtao@rock-chips.com,
typ@rock-chips.com
Subject: Re: [RFC PATCH v1 4/6] PM / devfreq: event: support rockchip dfi controller
Date: Fri, 3 Jun 2016 18:54:26 +0200 [thread overview]
Message-ID: <20160603165426.GC21013@ulmo.ba.sec> (raw)
In-Reply-To: <1464947719-6245-5-git-send-email-hl@rock-chips.com>
[-- Attachment #1: Type: text/plain, Size: 529 bytes --]
On Fri, Jun 03, 2016 at 05:55:17PM +0800, Lin Huang wrote:
[...]
> + ret = clk_prepare_enable(data->clk);
> + if (ret) {
> + dev_err(&pdev->dev, "failed to enable clk: %d\n", ret);
> + clk_disable_unprepare(data->clk);
> + return ret;
> + }
This is going to give you a large WARN. clk_prepare_enable() already
leaves the clock in a proper state when it fails (i.e. it calls
clk_unprepare() if the clk_enable() part failed), so calling
clk_disable_unprepare() upon failure is going to unbalance the
reference counts.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Lin Huang <hl-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Cc: huangtao-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
typ-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org,
airlied-cv59FeDIM0c@public.gmane.org,
mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
dbasehore-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
myungjoo.ham-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
mark.yao-TNX95d0MmH7DzftRWevZcw@public.gmane.org
Subject: Re: [RFC PATCH v1 4/6] PM / devfreq: event: support rockchip dfi controller
Date: Fri, 3 Jun 2016 18:54:26 +0200 [thread overview]
Message-ID: <20160603165426.GC21013@ulmo.ba.sec> (raw)
In-Reply-To: <1464947719-6245-5-git-send-email-hl-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 529 bytes --]
On Fri, Jun 03, 2016 at 05:55:17PM +0800, Lin Huang wrote:
[...]
> + ret = clk_prepare_enable(data->clk);
> + if (ret) {
> + dev_err(&pdev->dev, "failed to enable clk: %d\n", ret);
> + clk_disable_unprepare(data->clk);
> + return ret;
> + }
This is going to give you a large WARN. clk_prepare_enable() already
leaves the clock in a proper state when it fails (i.e. it calls
clk_unprepare() if the clk_enable() part failed), so calling
clk_disable_unprepare() upon failure is going to unbalance the
reference counts.
Thierry
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 200 bytes --]
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
WARNING: multiple messages have this Message-ID (diff)
From: thierry.reding@gmail.com (Thierry Reding)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH v1 4/6] PM / devfreq: event: support rockchip dfi controller
Date: Fri, 3 Jun 2016 18:54:26 +0200 [thread overview]
Message-ID: <20160603165426.GC21013@ulmo.ba.sec> (raw)
In-Reply-To: <1464947719-6245-5-git-send-email-hl@rock-chips.com>
On Fri, Jun 03, 2016 at 05:55:17PM +0800, Lin Huang wrote:
[...]
> + ret = clk_prepare_enable(data->clk);
> + if (ret) {
> + dev_err(&pdev->dev, "failed to enable clk: %d\n", ret);
> + clk_disable_unprepare(data->clk);
> + return ret;
> + }
This is going to give you a large WARN. clk_prepare_enable() already
leaves the clock in a proper state when it fails (i.e. it calls
clk_unprepare() if the clk_enable() part failed), so calling
clk_disable_unprepare() upon failure is going to unbalance the
reference counts.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160603/74ea7cb3/attachment.sig>
next prev parent reply other threads:[~2016-06-03 16:54 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-03 9:55 [RFC PATCH v1 0/6] rk3399 support ddr frequency scaling Lin Huang
2016-06-03 9:55 ` Lin Huang
2016-06-03 9:55 ` [RFC PATCH v1 1/6] rockchip: rockchip: add new clock-type for the ddrclk Lin Huang
2016-06-03 9:55 ` Lin Huang
2016-06-03 9:55 ` Lin Huang
2016-06-03 12:29 ` Shawn Lin
2016-06-03 12:29 ` Shawn Lin
2016-06-06 2:24 ` hl
2016-06-06 2:24 ` hl
2016-06-03 12:51 ` Heiko Stübner
2016-06-03 12:51 ` Heiko Stübner
2016-06-06 3:20 ` hl
2016-06-06 3:20 ` hl
2016-06-06 3:20 ` hl
2016-06-06 3:20 ` hl
2016-06-03 9:55 ` [RFC PATCH v1 2/6] clk: rockchip: rk3399: add SCLK_DDRCLK ID for ddrc Lin Huang
2016-06-03 9:55 ` Lin Huang
2016-06-03 9:55 ` Lin Huang
2016-06-03 12:34 ` Shawn Lin
2016-06-03 12:34 ` Shawn Lin
2016-06-03 12:36 ` Heiko Stübner
2016-06-03 12:36 ` Heiko Stübner
2016-06-03 12:47 ` Shawn Lin
2016-06-03 12:47 ` Shawn Lin
2016-06-03 13:25 ` Doug Anderson
2016-06-03 13:25 ` Doug Anderson
2016-06-03 13:25 ` Doug Anderson
2016-06-03 9:55 ` [RFC PATCH v1 3/6] clk: rockchip: rk3399: add ddrc clock support Lin Huang
2016-06-03 9:55 ` Lin Huang
2016-06-03 9:55 ` Lin Huang
2016-06-03 12:56 ` Heiko Stübner
2016-06-03 12:56 ` Heiko Stübner
2016-06-06 3:25 ` hl
2016-06-06 3:25 ` hl
2016-06-03 9:55 ` [RFC PATCH v1 4/6] PM / devfreq: event: support rockchip dfi controller Lin Huang
2016-06-03 9:55 ` Lin Huang
2016-06-03 10:26 ` Chanwoo Choi
2016-06-03 10:26 ` Chanwoo Choi
2016-06-06 3:50 ` hl
2016-06-06 3:50 ` hl
2016-06-03 16:54 ` Thierry Reding [this message]
2016-06-03 16:54 ` Thierry Reding
2016-06-03 16:54 ` Thierry Reding
2016-06-06 6:19 ` hl
2016-06-06 6:19 ` hl
2016-06-03 9:55 ` [RFC PATCH v1 5/6] PM / devfreq: rockchip: add devfreq driver for rk3399 dmc Lin Huang
2016-06-03 9:55 ` Lin Huang
2016-06-03 9:55 ` [RFC PATCH v1 6/6] drm/rockchip: Add dmc notifier in vop driver Lin Huang
2016-06-03 9:55 ` Lin Huang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160603165426.GC21013@ulmo.ba.sec \
--to=thierry.reding@gmail.com \
--cc=airlied@linux.ie \
--cc=dbasehore@chromium.org \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=hl@rock-chips.com \
--cc=huangtao@rock-chips.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mark.yao@rock-chips.com \
--cc=mturquette@baylibre.com \
--cc=myungjoo.ham@samsung.com \
--cc=sboyd@codeaurora.org \
--cc=typ@rock-chips.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.