linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ulf.hansson@linaro.org (Ulf Hansson)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC/RFT 2/6] clk: qcom: Add runtime support to handle clocks using PM clocks
Date: Thu, 30 Apr 2015 11:02:07 +0200	[thread overview]
Message-ID: <CAPDyKFo87XPWK14gwgdGpn9LGWKyDeFhfEFC+0gtkESCw27tDw@mail.gmail.com> (raw)
In-Reply-To: <CAPDyKFqXZtKxSnwXwUSSDA6vFtaJ_FoGWn495KdU5=17k7Um5w@mail.gmail.com>

On 30 April 2015 at 08:21, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 29 April 2015 at 15:08, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>> Hi Ulf,
>>
>> On Wed, Apr 29, 2015 at 2:31 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>>>> Geert, thanks, I was wondering how you handle the !CONFIG_PM case for
>>>>> rmobile. I mean who turns the clocks on for the devices when you build
>>>>> with CONFIG_PM disabled?
>>>>
>>>> We still use pm_clk_add_notifier() in drivers/sh/pm_runtime.c if
>>>> CONFIG_PM_GENERIC_DOMAINS_OF=n. Hence the second instance of
>>>> pm_clk_notify() will enable the clocks at driver binding time.
>>>> Hardware power domains are assumed enabled by reset state/the boot
>>>> loader.
>>>
>>> Yes, it a bit tricky - but I guess that's the current only viable
>>> solution if we have when using the pm_clk API.
>>>
>>>> Given the amount of PM infrastructure involved when hardware power and
>>>> clock domains are involved, I think at one point we'll have to start restricting
>>>> our builds to CONFIG_PM=y.
>>>
>>> I don't think that would solve the problem, since you may still have
>>> cross SoC drivers which may be used without CONFIG_PM.
>>
>> That's not as much of a problem as it sounds:
>>   - If the driver cares (needs to know) about the clock, it should already
>>     manage it itself.
>
> Agree!
>
>>   - If it doesn't care about the clock, it just needs Runtime PM support.
>>     That will do the right thing on platforms with (needs PM=y) and without
>>     (doesn't care about PM=x) clock domains.
>
> How about those drivers that cares about clocks and thus manages them,
> but also cares about runtime PM?
>
> I believe we will get a clock reference count issue in these cases,
> since both the PM domain and the driver will manage the clocks.
>
> I assume that's why we have had a few attempts to have "runtime PM
> clocks" specially marked, one was via DT, to have clear distinguish
> between who will be responsible to manage them.
>
> Those attempts did get nacked, so the problem is still there I assume.
>
>> So the bigger "problem" is making sure all drivers have at least minimal
>> Runtime PM support, else they can't be reused as-is on systems with PM
>> domains.
>>
>>> So all SoC that uses a driver which expects clocks to be managed using
>>> PM clocks from a PM domain, will need the above "trick". Right?
>>
>> One remaining issue with pm_clk_add_notifier() is that it applies to all
>> platform devices in the system, not just the on-SoC devices. Hence it may
>> inadvertently manage clocks for off-SoC devices it's not supposed to touch.
>
> Yes. That's really bad. :-)
>
> Additionally, it means devices that isn't part of the platform bus
> isn't able to use PM clk domains at all.

Correction: Of course they can register one PM clk notifier per bus
type. The API currently also provides this option.

>
> Within this context, I find it hard to advise people to use PM clk
> domains (via pm_clk_add_notifier()), since there just so many open
> issues. What works a _little_ better is to use PM clks via genpd.
>
> Kind regards
> Uffe

  reply	other threads:[~2015-04-30  9:02 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23  8:45 [RFC/RFT 0/6] qcom: Add runtime PM support Rajendra Nayak
2015-04-23  8:45 ` [RFC/RFT 1/6] PM / clock_ops: Make pm_clk_notify() do nothing in case DT passes power-domains Rajendra Nayak
2015-04-23  8:45 ` [RFC/RFT 2/6] clk: qcom: Add runtime support to handle clocks using PM clocks Rajendra Nayak
2015-04-24 10:03   ` Ulf Hansson
2015-04-24 10:58     ` Rajendra Nayak
2015-04-26  8:49       ` Geert Uytterhoeven
2015-04-27 20:02         ` Kevin Hilman
2015-04-28  2:52           ` Rajendra Nayak
2015-04-28  7:25             ` Geert Uytterhoeven
2015-04-29  9:49               ` Rajendra Nayak
2015-04-29 11:30                 ` Geert Uytterhoeven
2015-04-29 12:31                   ` Ulf Hansson
2015-04-29 13:08                     ` Geert Uytterhoeven
2015-04-30  6:21                       ` Ulf Hansson
2015-04-30  9:02                         ` Ulf Hansson [this message]
2015-04-27  7:08       ` Ulf Hansson
2015-04-23  8:45 ` [RFC/RFT 3/6] serial: msm: convert driver to use runtime PM apis Rajendra Nayak
2015-04-29  0:16   ` Stephen Boyd
2015-04-29  3:15     ` Rajendra Nayak
2015-04-23  8:45 ` [RFC/RFT 4/6] mmc: sdhci-msm: " Rajendra Nayak
2015-04-23 13:21   ` Ulf Hansson
2015-04-23 13:42     ` Rajendra Nayak
2015-04-23 21:15       ` Kevin Hilman
2015-04-24  0:45         ` Rajendra Nayak
2015-04-23 13:43     ` Rajendra Nayak
2015-04-23  8:45 ` [RFC/RFT 5/6] i2c: qup: Get rid of clock handling as its done using runtime callbacks Rajendra Nayak
2015-04-23 21:16   ` Kevin Hilman
2015-04-24  2:32     ` Rajendra Nayak
2015-04-25  7:01   ` Ivan T. Ivanov
2015-04-27  2:36     ` Rajendra Nayak
2015-04-23  8:45 ` [RFC/RFT 6/6] spi: " Rajendra Nayak

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=CAPDyKFo87XPWK14gwgdGpn9LGWKyDeFhfEFC+0gtkESCw27tDw@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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).