linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jszhang@marvell.com (Jisheng Zhang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] i2c: designware: separate ops for system_sleep_pm and runtime_pm
Date: Wed, 20 May 2015 20:34:30 +0800	[thread overview]
Message-ID: <20150520203430.24edd2a8@xhacker> (raw)
In-Reply-To: <20150520121506.GU1490@lahna.fi.intel.com>

Dear Mika,

On Wed, 20 May 2015 15:15:06 +0300
Mika Westerberg <mika.westerberg@linux.intel.com> wrote:

> On Wed, May 20, 2015 at 07:34:22PM +0800, Jisheng Zhang wrote:
> > Sorry for confusion. Considering one platform which doesn't support power off
> > the i2c host but it can disable the host's clock. So in such platform, when
> > the host is runtime suspended, its clock is disabled, then i2c_dw_disable() will
> > hang when s2ram.
> 
> Right. This happens also when the platform powers off the device.
> 
> > Except using the runtime pm API to ensure the host is in
> > a correct state, is there any other solution? AFAIK, 'dev->power.direct_complete'
> > doesn't help such case.
> 
> What I had in mind is something like below:
> 
> static int i2c_dw_prepare(struct device *dev)
> {
> 	return pm_runtime_suspended(dev);
> }
> 
> static void i2c_dw_complete(struct device *dev)
> {
> 	if (dev->power.direct_complete)
> 		pm_request_resume(dev);
> }
> 
> In other words it checks if the device is already runtime suspended and
> prevents ->suspend() etc. from being called.

What amazing! I wrote the same code as yours after sending out the last email.

> 
> If that does not work (I didn't try as this problem does not exist on

It works! How to submit the patch? Do you mind if I cook the patch and add
you signed-off?

Thanks a lot,
Jisheng

  reply	other threads:[~2015-05-20 12:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-15 12:31 [PATCH] i2c: designware: separate ops for system_sleep_pm and runtime_pm Jisheng Zhang
2015-05-18  8:28 ` Mika Westerberg
2015-05-19 12:32   ` Jisheng Zhang
2015-05-19 13:15     ` Mika Westerberg
2015-05-20 11:34       ` Jisheng Zhang
2015-05-20 12:05         ` Jisheng Zhang
2015-05-20 12:15         ` Mika Westerberg
2015-05-20 12:34           ` Jisheng Zhang [this message]
2015-05-20 12:38             ` Jisheng Zhang
2015-05-20 12:55             ` Mika Westerberg

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=20150520203430.24edd2a8@xhacker \
    --to=jszhang@marvell.com \
    --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).