linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: linux-clk@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Michael Turquette <mturquette@baylibre.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Inki Dae <inki.dae@samsung.com>,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: Re: [PATCH 1/5] clk: add support for runtime pm
Date: Mon, 12 Sep 2016 15:31:05 -0700	[thread overview]
Message-ID: <20160912223105.GI7243@codeaurora.org> (raw)
In-Reply-To: <f18fee35-cb5d-abce-0415-a98b58e3a302@samsung.com>

On 09/12, Marek Szyprowski wrote:
> Hi Stephen,
> 
> 
> On 2016-09-08 02:19, Stephen Boyd wrote:
> >On 09/01, Marek Szyprowski wrote:
> >>Registers for some clocks might be located in the SOC area, which are under the
> >>power domain. To enable access to those registers respective domain has to be
> >>turned on. Additionally, registers for such clocks will usually loose its
> >>contents when power domain is turned off, so additional saving and restoring of
> >>them might be needed in the clock controller driver.
> >>
> >>This patch adds basic infrastructure in the clocks core to allow implementing
> >>driver for such clocks under power domains. Clock provider can supply a
> >>struct device pointer, which is the used by clock core for tracking and managing
> >>clock's controller runtime pm state. Each clk_prepare() operation
> >>will first call pm_runtime_get_sync() on the supplied device, while
> >>clk_unprepare() will do pm_runtime_put() at the end.
> >>
> >>Additional calls to pm_runtime_get/put functions are required to ensure that any
> >>register access (like calculating/chaning clock rates) will be done with clock
> >>controller in active runtime state.
> >>
> >>Special handling of the case when runtime pm is disabled for clock controller's
> >>device is needed to let this feature work properly also during system sleep
> >>suspend/resume operations (runtime pm is first disabled before entering sleep
> >>state's, but controller is usually still operational until its suspend pm
> >>callback is called).
> >>
> >>Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> >My "knee jerk" concern is that we're going to take a runtime PM
> >lock underneath the prepare lock. That seems like a situation
> >where we could hit a lock inversion if the runtime PM callbacks
> >themselves acquire the prepare lock by calling clk APIs? But this
> >concern is false right? We release the runtime PM lock before
> >calling the PM callback, so we shouldn't hit any deadlock and
> >lockdep won't complain?
> 
> Runtime PM uses fine grained locking based on per-device locks, so there
> should be no problem with global clock prepare lock. The only lock
> interaction
> is between clock controller device's rpm lock and clocks global
> prepare lock, but
> it always done with the same access pattern. I've tested it
> extensively (also
> with lock dep) with various use cases and found no problems.
> 

Great! So you have runtime PM callbacks that are calling
clk_prepare/unprepare?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2016-09-12 22:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-01 13:45 [PATCH 0/5] Add runtime PM support for clocks (on Exynos SoC example) Marek Szyprowski
2016-09-01 13:45 ` [PATCH 1/5] clk: add support for runtime pm Marek Szyprowski
2016-09-01 15:10   ` kbuild test robot
2016-09-01 15:10   ` [PATCH] clk: fix boolreturn.cocci warnings kbuild test robot
2016-09-08  0:19   ` [PATCH 1/5] clk: add support for runtime pm Stephen Boyd
     [not found]     ` <CGME20160912101857eucas1p29b2bbd5ac0eda92284091ad1b86decc4@eucas1p2.samsung.com>
2016-09-12 10:18       ` Marek Szyprowski
2016-09-12 22:31         ` Stephen Boyd [this message]
2016-09-13  9:07           ` Marek Szyprowski
2016-09-14 21:39             ` Stephen Boyd
2016-09-15  8:32               ` Marek Szyprowski
2016-09-13  7:24     ` Ulf Hansson
2016-09-13  8:49   ` Ulf Hansson
2016-09-13 13:13     ` Marek Szyprowski
2016-09-13 15:03       ` Ulf Hansson
2016-09-14 10:11         ` Marek Szyprowski
2016-09-01 13:45 ` [PATCH 2/5] clock: samsung: " Marek Szyprowski
2016-09-01 13:45 ` [PATCH 3/5] clocks: exynos4x12: add runtime pm support for ISP clocks Marek Szyprowski
2016-09-01 21:49   ` kbuild test robot
2016-09-01 13:45 ` [PATCH 4/5] ARM: dts: exynos: add support for ISP power domain to exynos4x12 clocks device Marek Szyprowski
2016-09-08  0:22   ` Stephen Boyd
     [not found]     ` <CGME20160912102332eucas1p145e79669788329b44343da62dcbe50ca@eucas1p1.samsung.com>
2016-09-12 10:23       ` Marek Szyprowski
2016-09-12 22:28         ` Stephen Boyd
     [not found]           ` <20160912222852.GH7243-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-09-15 12:06             ` Marek Szyprowski
2016-09-15 14:13               ` Ulf Hansson
2016-09-01 13:45 ` [PATCH 5/5] clocks: exynos5433: add runtime pm support Marek Szyprowski
2016-09-01 16:55   ` Bartlomiej Zolnierkiewicz
2016-09-01 23:00   ` kbuild test robot
2016-09-02 19:05   ` kbuild test robot

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=20160912223105.GI7243@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=inki.dae@samsung.com \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mturquette@baylibre.com \
    --cc=s.nawrocki@samsung.com \
    --cc=ulf.hansson@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).