From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Cc: linux-i2c@vger.kernel.org, Jean Delvare <khali@linux-fr.org>,
Wolfram Sang <w.sang@pengutronix.de>,
Ben Dooks <ben-linux@fluff.org>,
linux-samsung-soc <linux-samsung-soc@vger.kernel.org>
Subject: Re: [PATCH 2/2] i2c-s3c2410: Add stub runtime power management
Date: Sat, 21 Jan 2012 18:31:55 +0000 [thread overview]
Message-ID: <20120121183155.GE10751@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <4F1ADF5A.6000806@gmail.com>
On Sat, Jan 21, 2012 at 04:52:58PM +0100, Sylwester Nawrocki wrote:
> On 01/21/2012 02:28 PM, Mark Brown wrote:
> > + pm_runtime_get_sync(&adap->dev);
> > clk_enable(i2c->clk);
> It looks a bit strange to have pm_runtime* and manual clock control side
> by side. How about implementing proper runtime_suspend/resume calls and
> moving clk_enable/disable to these handlers ?
I'd rather not do that in a single patch, and really we ought to be
doing more than just stopping and starting the clocks anyway. Given
that the rather serious problems with getting I2C patches applied I'd
rather do as little as possible in individual patches.
It would also introduce a regression for systems that don't use runtime
PM (probably most s3c24xx ones).
> It might also make sense to check return value of pm_runtime_get_sync().
This is fairly idiomatic for the API, the error handling gets a bit
complicated if you do it properly.
> > for (retry = 0; retry< adap->retries; retry++) {
> > @@ -572,6 +574,7 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
> >
> > if (ret != -EAGAIN) {
> > clk_disable(i2c->clk);
> > + pm_runtime_put_sync(&adap->dev);
> I would go for just pm_runtime_put() here...
Yeah, me too but it seemed idiomatic. Frankly I don't really understand
why there's a synchronous version of put.
> > + pm_runtime_enable(&pdev->dev);
> > + pm_runtime_enable(&i2c->adap.dev);
> Why do we need pm_runtime_enable() on i2c->adap.dev ?
> AFAIK enabling runtime PM on the platform device only should do.
We probably don't need to, no.
next prev parent reply other threads:[~2012-01-21 18:31 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-21 13:28 [PATCH 1/2] i2c-s3c2410: Convert to devm_kzalloc() Mark Brown
[not found] ` <1327152527-11364-1-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-01-21 13:28 ` [PATCH 2/2] i2c-s3c2410: Add stub runtime power management Mark Brown
2012-01-21 15:52 ` Sylwester Nawrocki
2012-01-21 18:31 ` Mark Brown [this message]
2012-01-21 20:38 ` Sylwester Nawrocki
[not found] ` <4F1B2235.4000009-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-01-21 21:23 ` Mark Brown
2012-01-21 21:23 ` Heiko Stübner
2012-01-21 21:33 ` Sylwester Nawrocki
[not found] ` <4F1B2F38.9050708-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-01-21 21:57 ` Mark Brown
2012-01-21 22:49 ` Sylwester Nawrocki
2012-01-21 23:10 ` Mark Brown
[not found] ` <1327152527-11364-2-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-02-13 23:39 ` Ben Dooks
2012-01-21 16:10 ` [PATCH 1/2] i2c-s3c2410: Convert to devm_kzalloc() Sylwester Nawrocki
2012-01-21 17:57 ` Mark Brown
2012-01-21 18:27 ` Sylwester Nawrocki
[not found] ` <4F1B0394.8050003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-01-21 18:36 ` Mark Brown
[not found] ` <4F1AE36E.3070403-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-02-13 23:38 ` Ben Dooks
2012-02-14 13:03 ` Shubhrajyoti Datta
2012-02-14 13:52 ` Sylwester Nawrocki
2012-01-21 15:59 ` Sylwester Nawrocki
2012-01-29 5:14 ` Barry Song
-- strict thread matches above, loose matches on Subject: below --
2011-12-05 14:06 Mark Brown
[not found] ` <1323093966-9045-1-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-12-05 14:06 ` [PATCH 2/2] i2c-s3c2410: Add stub runtime power management Mark Brown
2011-12-13 14:53 ` Heiko Stübner
2011-12-13 15:06 ` Jean Delvare
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=20120121183155.GE10751@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=ben-linux@fluff.org \
--cc=khali@linux-fr.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=sylvester.nawrocki@gmail.com \
--cc=w.sang@pengutronix.de \
/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).