linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: geert@linux-m68k.org (Geert Uytterhoeven)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC/RFT 2/6] clk: qcom: Add runtime support to handle clocks using PM clocks
Date: Wed, 29 Apr 2015 15:08:09 +0200	[thread overview]
Message-ID: <CAMuHMdXXkgTDjdYanQNUJFXqUXLtGrLCOugs94MaCvg9O7wbXA@mail.gmail.com> (raw)
In-Reply-To: <CAPDyKFoja9OZf+X2eaBGwTXoqFHchOz9vopLYF+wiguHXwznzw@mail.gmail.com>

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.
  - 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.
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.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2015-04-29 13:08 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 [this message]
2015-04-30  6:21                       ` Ulf Hansson
2015-04-30  9:02                         ` Ulf Hansson
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=CAMuHMdXXkgTDjdYanQNUJFXqUXLtGrLCOugs94MaCvg9O7wbXA@mail.gmail.com \
    --to=geert@linux-m68k.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).