All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben.dooks@codethink.co.uk>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core
Date: Wed, 30 Apr 2014 21:33:14 +0000	[thread overview]
Message-ID: <53616C1A.3040608@codethink.co.uk> (raw)
In-Reply-To: <2401458.kIFL7AxWq0@avalon>

On 30/04/14 14:25, Laurent Pinchart wrote:
> On Tuesday 29 April 2014 14:16:10 Grant Likely wrote:
>> On Fri, 25 Apr 2014 16:44:58 -0700, Kevin Hilman <khilman@linaro.org> wrote:
>>> Geert Uytterhoeven <geert+renesas@glider.be> writes:
>>>> When adding a device from DT, check if its clocks are suitable for
>>>> Runtime PM, and register them with the PM core.
>>>> If Runtime PM is disabled, just enable the clock.
>>>>
>>>> This allows the PM core to automatically manage gate clocks of devices
>>>> for Runtime PM.
>>>
>>> ...unless the device is already in an existing pm_domain, right?
>>>
>>> I like this approach, and it extends nicely what we already do on
>>> platforms using drivers/base/power/clock_ops.c into DT land.
>>>
>>> My only concern is how this will interact if it's used along with
>>> devices that have existing pm_domains.  I don't have any specific
>>> concerns (yet, because it's Friday, and my brain is turing off), but it
>>> just made me wonder if this will be potentially confusing.
>>
>> I have big concerns about this approach. First, it will only work if
>> a clock is available at deivce creation time. The conversion of irq
>> controllers to normal device drivers has already shown that is a bad
>> idea.
>>
>> I also don't like that it tries to set up every clock, but there is no
>> guarantee that the driver will even use it. I would rather see this
>> behaviour linked into the function that obtains the clock at driver
>> .probe() time. That way it can handle deferred probe correctly and it
>> only sets up clocks that are actually used by the driver.
>
> I like the idea, as it gives an opt-in approach to the problem: drivers could
> decide whether they want the runtime PM core to handle clocks automatically
> (which should cover most cases), but would have the option of handling clocks
> manually if needed for special purposes.

If drivers could have a field to say that they allow the driver-core
or the pm-runtime would mean that drivers could easily be change without
having to deal with what the SoC/SoC family have to care about this.

It would also mean that we could change drivers without having to make
any changes to the SoC to say that it has to opt-in to the support.


-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

WARNING: multiple messages have this Message-ID (diff)
From: Ben Dooks <ben.dooks@codethink.co.uk>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Grant Likely <grant.likely@secretlab.ca>
Cc: Kevin Hilman <khilman@linaro.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Magnus Damm <magnus.damm@gmail.com>,
	Simon Horman <horms@verge.net.au>, Felipe Balbi <balbi@ti.com>,
	Mike Turquette <mturquette@linaro.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-sh@vger.kernel.org, linux-pm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core
Date: Wed, 30 Apr 2014 14:33:14 -0700	[thread overview]
Message-ID: <53616C1A.3040608@codethink.co.uk> (raw)
In-Reply-To: <2401458.kIFL7AxWq0@avalon>

On 30/04/14 14:25, Laurent Pinchart wrote:
> On Tuesday 29 April 2014 14:16:10 Grant Likely wrote:
>> On Fri, 25 Apr 2014 16:44:58 -0700, Kevin Hilman <khilman@linaro.org> wrote:
>>> Geert Uytterhoeven <geert+renesas@glider.be> writes:
>>>> When adding a device from DT, check if its clocks are suitable for
>>>> Runtime PM, and register them with the PM core.
>>>> If Runtime PM is disabled, just enable the clock.
>>>>
>>>> This allows the PM core to automatically manage gate clocks of devices
>>>> for Runtime PM.
>>>
>>> ...unless the device is already in an existing pm_domain, right?
>>>
>>> I like this approach, and it extends nicely what we already do on
>>> platforms using drivers/base/power/clock_ops.c into DT land.
>>>
>>> My only concern is how this will interact if it's used along with
>>> devices that have existing pm_domains.  I don't have any specific
>>> concerns (yet, because it's Friday, and my brain is turing off), but it
>>> just made me wonder if this will be potentially confusing.
>>
>> I have big concerns about this approach. First, it will only work if
>> a clock is available at deivce creation time. The conversion of irq
>> controllers to normal device drivers has already shown that is a bad
>> idea.
>>
>> I also don't like that it tries to set up every clock, but there is no
>> guarantee that the driver will even use it. I would rather see this
>> behaviour linked into the function that obtains the clock at driver
>> .probe() time. That way it can handle deferred probe correctly and it
>> only sets up clocks that are actually used by the driver.
>
> I like the idea, as it gives an opt-in approach to the problem: drivers could
> decide whether they want the runtime PM core to handle clocks automatically
> (which should cover most cases), but would have the option of handling clocks
> manually if needed for special purposes.

If drivers could have a field to say that they allow the driver-core
or the pm-runtime would mean that drivers could easily be change without
having to deal with what the SoC/SoC family have to care about this.

It would also mean that we could change drivers without having to make
any changes to the SoC to say that it has to opt-in to the support.


-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

WARNING: multiple messages have this Message-ID (diff)
From: ben.dooks@codethink.co.uk (Ben Dooks)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core
Date: Wed, 30 Apr 2014 14:33:14 -0700	[thread overview]
Message-ID: <53616C1A.3040608@codethink.co.uk> (raw)
In-Reply-To: <2401458.kIFL7AxWq0@avalon>

On 30/04/14 14:25, Laurent Pinchart wrote:
> On Tuesday 29 April 2014 14:16:10 Grant Likely wrote:
>> On Fri, 25 Apr 2014 16:44:58 -0700, Kevin Hilman <khilman@linaro.org> wrote:
>>> Geert Uytterhoeven <geert+renesas@glider.be> writes:
>>>> When adding a device from DT, check if its clocks are suitable for
>>>> Runtime PM, and register them with the PM core.
>>>> If Runtime PM is disabled, just enable the clock.
>>>>
>>>> This allows the PM core to automatically manage gate clocks of devices
>>>> for Runtime PM.
>>>
>>> ...unless the device is already in an existing pm_domain, right?
>>>
>>> I like this approach, and it extends nicely what we already do on
>>> platforms using drivers/base/power/clock_ops.c into DT land.
>>>
>>> My only concern is how this will interact if it's used along with
>>> devices that have existing pm_domains.  I don't have any specific
>>> concerns (yet, because it's Friday, and my brain is turing off), but it
>>> just made me wonder if this will be potentially confusing.
>>
>> I have big concerns about this approach. First, it will only work if
>> a clock is available at deivce creation time. The conversion of irq
>> controllers to normal device drivers has already shown that is a bad
>> idea.
>>
>> I also don't like that it tries to set up every clock, but there is no
>> guarantee that the driver will even use it. I would rather see this
>> behaviour linked into the function that obtains the clock at driver
>> .probe() time. That way it can handle deferred probe correctly and it
>> only sets up clocks that are actually used by the driver.
>
> I like the idea, as it gives an opt-in approach to the problem: drivers could
> decide whether they want the runtime PM core to handle clocks automatically
> (which should cover most cases), but would have the option of handling clocks
> manually if needed for special purposes.

If drivers could have a field to say that they allow the driver-core
or the pm-runtime would mean that drivers could easily be change without
having to deal with what the SoC/SoC family have to care about this.

It would also mean that we could change drivers without having to make
any changes to the SoC to say that it has to opt-in to the support.


-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

  reply	other threads:[~2014-04-30 21:33 UTC|newest]

Thread overview: 158+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-24 10:13 [PATCH/RFC 0/4] of: Register clocks for Runtime PM with PM core Geert Uytterhoeven
2014-04-24 10:13 ` Geert Uytterhoeven
2014-04-24 10:13 ` Geert Uytterhoeven
2014-04-24 10:13 ` [PATCH/RFC 1/4] clk: Add CLK_RUNTIME_PM and clk_may_runtime_pm() Geert Uytterhoeven
2014-04-24 10:13   ` Geert Uytterhoeven
2014-04-24 10:13   ` Geert Uytterhoeven
2014-04-24 10:13   ` Geert Uytterhoeven
2014-04-24 10:13 ` [PATCH/RFC 2/4] PM / clock_ops: Add pm_clk_add_clk() Geert Uytterhoeven
2014-04-24 10:13   ` Geert Uytterhoeven
2014-04-24 10:13   ` Geert Uytterhoeven
2014-04-24 10:13   ` Geert Uytterhoeven
2014-04-24 10:13 ` [PATCH/RFC 3/4] of/clk: Register clocks suitable for Runtime PM with the PM core Geert Uytterhoeven
2014-04-24 10:13   ` Geert Uytterhoeven
2014-04-24 10:13   ` Geert Uytterhoeven
2014-04-24 13:11   ` Ulf Hansson
2014-04-24 13:11     ` Ulf Hansson
2014-04-24 13:11     ` Ulf Hansson
2014-04-24 13:11     ` Ulf Hansson
2014-04-24 14:09     ` Geert Uytterhoeven
2014-04-24 14:09       ` Geert Uytterhoeven
2014-04-24 14:09       ` Geert Uytterhoeven
2014-04-24 14:09       ` Geert Uytterhoeven
2014-04-26  1:59     ` Tomasz Figa
2014-04-26  1:59       ` Tomasz Figa
2014-04-26  1:59       ` Tomasz Figa
2014-04-26  1:59       ` Tomasz Figa
2014-05-02  8:13       ` Ulf Hansson
2014-05-02  8:13         ` Ulf Hansson
2014-05-02  8:13         ` Ulf Hansson
2014-05-02  8:13         ` Ulf Hansson
2014-05-02 14:58         ` Geert Uytterhoeven
2014-05-02 14:58           ` Geert Uytterhoeven
2014-05-02 14:58           ` Geert Uytterhoeven
2014-05-02 14:58           ` Geert Uytterhoeven
2014-05-06  7:58           ` Ulf Hansson
2014-05-06  7:58             ` Ulf Hansson
2014-05-06  7:58             ` Ulf Hansson
2014-05-06  7:58             ` Ulf Hansson
2014-04-30 21:23     ` Laurent Pinchart
2014-04-30 21:23       ` Laurent Pinchart
2014-04-30 21:23       ` Laurent Pinchart
2014-04-30 21:23       ` Laurent Pinchart
2014-04-30 22:06       ` Geert Uytterhoeven
2014-04-30 22:06         ` Geert Uytterhoeven
2014-04-30 22:06         ` Geert Uytterhoeven
2014-04-30 22:06         ` Geert Uytterhoeven
2014-04-25 23:44   ` Kevin Hilman
2014-04-25 23:44     ` Kevin Hilman
2014-04-25 23:44     ` Kevin Hilman
2014-04-29 13:16     ` Grant Likely
2014-04-29 13:16       ` Grant Likely
2014-04-29 13:16       ` Grant Likely
2014-04-30 21:25       ` Laurent Pinchart
2014-04-30 21:25         ` Laurent Pinchart
2014-04-30 21:25         ` Laurent Pinchart
2014-04-30 21:25         ` Laurent Pinchart
2014-04-30 21:33         ` Ben Dooks [this message]
2014-04-30 21:33           ` Ben Dooks
2014-04-30 21:33           ` Ben Dooks
2014-04-30 21:54       ` Geert Uytterhoeven
2014-04-30 21:54         ` Geert Uytterhoeven
2014-04-30 21:54         ` Geert Uytterhoeven
2014-04-30 21:54         ` Geert Uytterhoeven
2014-05-01  8:03         ` Grant Likely
2014-05-01  8:03           ` Grant Likely
2014-05-01  8:03           ` Grant Likely
2014-05-01  8:03           ` Grant Likely
2014-05-01 13:41           ` Geert Uytterhoeven
2014-05-01 13:41             ` Geert Uytterhoeven
2014-05-01 13:41             ` Geert Uytterhoeven
2014-05-01 13:41             ` Geert Uytterhoeven
2014-05-01 13:56             ` Grant Likely
2014-05-01 13:56               ` Grant Likely
2014-05-01 13:56               ` Grant Likely
2014-05-01 13:56               ` Grant Likely
2014-05-01 14:46               ` Geert Uytterhoeven
2014-05-01 14:46                 ` Geert Uytterhoeven
2014-05-01 14:46                 ` Geert Uytterhoeven
2014-05-01 14:46                 ` Geert Uytterhoeven
2014-04-30 21:47     ` Geert Uytterhoeven
2014-04-30 21:47       ` Geert Uytterhoeven
2014-04-30 21:47       ` Geert Uytterhoeven
2014-04-30 21:47       ` Geert Uytterhoeven
2014-05-02  8:56   ` Ulf Hansson
2014-05-02  8:56     ` Ulf Hansson
2014-05-02  8:56     ` Ulf Hansson
2014-05-02  8:56     ` Ulf Hansson
2014-05-02 14:35     ` Geert Uytterhoeven
2014-05-02 14:35       ` Geert Uytterhoeven
2014-05-02 14:35       ` Geert Uytterhoeven
2014-05-02 14:35       ` Geert Uytterhoeven
2014-05-06  7:43       ` Ulf Hansson
2014-05-06  7:43         ` Ulf Hansson
2014-05-06  7:43         ` Ulf Hansson
2014-05-06  7:43         ` Ulf Hansson
2014-04-24 10:13 ` [PATCH/RFC 4/4] clk: shmobile: mstp: Set CLK_RUNTIME_PM flag Geert Uytterhoeven
2014-04-24 10:13   ` Geert Uytterhoeven
2014-04-24 10:13   ` Geert Uytterhoeven
2014-04-24 10:13   ` Geert Uytterhoeven
2014-04-30 21:29 ` [PATCH/RFC 0/4] of: Register clocks for Runtime PM with PM core Laurent Pinchart
2014-04-30 21:29   ` Laurent Pinchart
2014-04-30 21:29   ` Laurent Pinchart
2014-04-30 22:17   ` Geert Uytterhoeven
2014-04-30 22:17     ` Geert Uytterhoeven
2014-04-30 22:17     ` Geert Uytterhoeven
2014-04-30 22:17     ` Geert Uytterhoeven
2014-06-12 16:07 ` [RFC PATCH 0/2] use named clocks list to register clocks for PM clock domain Grygorii Strashko
2014-06-12 16:53   ` Grygorii Strashko
2014-06-12 16:53   ` Grygorii Strashko
2014-06-12 16:53   ` Grygorii Strashko
2014-06-12 16:06   ` [RFC PATCH 2/2] of/clk: use "clkops-clocks" to specify clocks handled by clock_ops domain Grygorii Strashko
2014-06-12 16:53     ` Grygorii Strashko
2014-06-12 16:53     ` Grygorii Strashko
2014-06-12 16:53     ` Grygorii Strashko
2014-07-28 14:05     ` Grant Likely
2014-07-28 14:05       ` Grant Likely
2014-07-28 14:05       ` Grant Likely
2014-07-28 14:05       ` Grant Likely
2014-07-28 17:03       ` Grygorii Strashko
2014-07-28 17:47         ` Grygorii Strashko
2014-07-28 17:47         ` Grygorii Strashko
2014-07-28 17:47         ` Grygorii Strashko
2014-07-29  5:52         ` Grant Likely
2014-07-29  5:52           ` Grant Likely
2014-07-29  5:52           ` Grant Likely
2014-07-29  5:52           ` Grant Likely
2014-07-30  0:06           ` Laurent Pinchart
2014-07-30  0:06             ` Laurent Pinchart
2014-07-30  0:06             ` Laurent Pinchart
2014-07-30  0:06             ` Laurent Pinchart
2014-07-30 12:41             ` Grygorii Strashko
2014-07-30 13:25               ` Grygorii Strashko
2014-07-30 13:25               ` Grygorii Strashko
2014-07-30 13:25               ` Grygorii Strashko
2014-12-12 17:40               ` Laurent Pinchart
2014-12-12 17:40                 ` Laurent Pinchart
2014-12-12 17:40                 ` Laurent Pinchart
2014-12-12 17:40                 ` Laurent Pinchart
2014-08-04 11:28             ` Geert Uytterhoeven
2014-08-04 11:28               ` Geert Uytterhoeven
2014-08-04 11:28               ` Geert Uytterhoeven
2014-08-04 11:28               ` Geert Uytterhoeven
2014-08-04 15:21               ` Laurent Pinchart
2014-08-04 15:21                 ` Laurent Pinchart
2014-08-04 15:21                 ` Laurent Pinchart
2014-08-04 15:21                 ` Laurent Pinchart
2014-09-08 20:13             ` Kevin Hilman
2014-09-08 20:13               ` Kevin Hilman
2014-09-08 20:13               ` Kevin Hilman
2014-09-08 20:13               ` Kevin Hilman
2014-12-12 17:52               ` Laurent Pinchart
2014-12-12 17:52                 ` Laurent Pinchart
2014-12-12 17:52                 ` Laurent Pinchart
2014-12-12 17:52                 ` Laurent Pinchart
2014-06-12 16:07   ` [RFC PATCH 1/2] clk: of: introduce of_clk_get_from_set() Grygorii Strashko
2014-06-12 16:53     ` Grygorii Strashko
2014-06-12 16:53     ` Grygorii Strashko
2014-06-12 16:53     ` Grygorii Strashko

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=53616C1A.3040608@codethink.co.uk \
    --to=ben.dooks@codethink.co.uk \
    --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 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.