linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <sylvester.nawrocki-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Mark Brown
	<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
Cc: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [PATCH] i2c-s3c2410: Add stub runtime power management
Date: Sun, 22 Jan 2012 18:22:14 +0100	[thread overview]
Message-ID: <4F1C45C6.1040003@gmail.com> (raw)
In-Reply-To: <20120122152234.GA2915-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>

On 01/22/2012 04:22 PM, Mark Brown wrote:
> On Sun, Jan 22, 2012 at 01:59:25PM +0100, Sylwester Nawrocki wrote:
>> How about the following patch (untested) ? It might be a better start for
>> proper power management implementation and would still allow the driver
>> to work on platforms that don't support runtime PM.
> 
> It's not really a platform issue - the platform bus by default does the
> right thing and the runtime PM core is pure software, the only platform
> dependency is if users have bothered truning runtime PM on.

It is a platform (SoC) issue in terms of enabling PM_RUNTIME, which is 
pure software, as you're pointing out. I think we agree here that the 
only issue is that some (ill) platforms refuse to enable PM_RUNTIME.

And clock gating belongs to runtime PM, which this I2C controller driver
chooses to implement without runtime PM awareness. 

>> +static inline int s3c24xx_pm_runtime_put(struct s3c24xx_i2c *i2c)
>> +{
>> +	if (!pm_runtime_enabled(i2c->dev)) {
>> +		clk_disable(i2c->clk);
>> +		return 0;
>> +	}
>> +
>> +	return pm_runtime_put(i2c->dev);
>> +}
> 
> To be honest I don't think this is worth it.  Either we just keep the
> clock management outside of runtime PM or we push it in but trying to
> support both simultaneously adds complication and doesn't actually do
> all that much in practical terms.

It's not pretty, I agree. However it is supposed to be more a temporary
solution, rather than anything final. And it probably is better at 
avoiding any races and mismatch between real device state and the PM core
knowledge of it. I'm not going to persuade my version too much, it's far
from prefect, similarly as the original patch in this thread. The best 
solution would be to force platform to enable PM_RUNTIME if they want to
use a driver which does runtime PM. But this has to wait, yet, probably
infinitely.. :)

  parent reply	other threads:[~2012-01-22 17:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-21 18:46 [PATCH] i2c-s3c2410: Add stub runtime power management Mark Brown
     [not found] ` <1327171600-5489-1-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-01-21 21:25   ` Sylwester Nawrocki
     [not found]     ` <4F1B2D40.70202-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-01-21 21:33       ` Mark Brown
2012-01-22 12:59 ` Sylwester Nawrocki
2012-01-22 15:22   ` Mark Brown
     [not found]     ` <20120122152234.GA2915-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-01-22 17:22       ` Sylwester Nawrocki [this message]
2012-01-22 17:27         ` Bill Gatliff
2012-01-22 17:48           ` Sylwester Nawrocki
2012-01-22 21:39             ` Mark Brown
2012-01-23 20:19               ` Sylwester Nawrocki
     [not found]               ` <20120122213952.GA29022-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-02-13 23:31                 ` Ben Dooks
     [not found]                   ` <20120213233139.GJ2999-RazCHl0VsYgkUSuvROHNpA@public.gmane.org>
2012-02-14  0:37                     ` Mark Brown

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=4F1C45C6.1040003@gmail.com \
    --to=sylvester.nawrocki-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
    --cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.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).