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 1/4] i2c: designware-platdrv: Fix runtime PM initialization
Date: Thu, 21 Apr 2016 11:08:59 +0800	[thread overview]
Message-ID: <20160421110859.1509ad2c@xhacker> (raw)
In-Reply-To: <571789C4.5020904@linux.intel.com>

Dear Jarkko,

On Wed, 20 Apr 2016 16:53:08 +0300 Jarkko Nikula wrote:

> On 04/14/2016 03:53 PM, Jisheng Zhang wrote:
> > When pm_runtime_enable() was being called, the device's usage counter
> > was 0, causing the PM layer to runtime-suspend the device.  We then
> > went on to call i2c_dw_probe() on a suspended device, which could hung.
> >
> > Fix this by incrementing the usage counter before pm_runtime_enable().
> >
> > Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> > ---
> >   drivers/i2c/busses/i2c-designware-platdrv.c | 14 +++++++++++++-
> >   1 file changed, 13 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> > index d656657..00f9e99 100644
> > --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> > +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> > @@ -246,6 +246,7 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
> >   	if (dev->pm_runtime_disabled) {
> >   		pm_runtime_forbid(&pdev->dev);
> >   	} else {
> > +		pm_runtime_get_noresume(&pdev->dev);
> >   		pm_runtime_set_autosuspend_delay(&pdev->dev, 1000);
> >   		pm_runtime_use_autosuspend(&pdev->dev);
> >   		pm_runtime_set_active(&pdev->dev);  
> 
> pm_runtime_enable() here after pm_runtime_set_active() shouldn't suspend 
> as far as I understand which made me thinking if there is some other 

FWICT, on arm DT platform, the device usage counter is zero at the beginning,
once we enable rpm, the i2c have chance to runtime suspend.

Thanks,
Jisheng

> issue that cause the symptoms what you are seeing? Like race with 
> runtime PM or similar.
> 

  reply	other threads:[~2016-04-21  3:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14 12:53 [PATCH 0/4] i2c: designware: runtime pm fix and improve Jisheng Zhang
2016-04-14 12:53 ` [PATCH 1/4] i2c: designware-platdrv: Fix runtime PM initialization Jisheng Zhang
2016-04-20 13:53   ` Jarkko Nikula
2016-04-21  3:08     ` Jisheng Zhang [this message]
2016-04-21  7:48       ` Jarkko Nikula
2016-04-21  8:15         ` Jisheng Zhang
2016-04-14 12:53 ` [PATCH 2/4] i2c: designware-platdrv: fix unbalanced clk enable and prepare Jisheng Zhang
2016-04-20 12:55   ` Jarkko Nikula
2016-04-20 14:16     ` Andy Shevchenko
2016-04-21  2:40       ` Jisheng Zhang
2016-04-21  7:39         ` Jarkko Nikula
2016-04-21  8:19           ` Jisheng Zhang
2016-04-14 12:53 ` [PATCH 3/4] i2c: designware-pcidrv: enable RuntimePM before registering to the core Jisheng Zhang
2016-04-20 13:03   ` Jarkko Nikula
2016-04-14 12:53 ` [PATCH 4/4] i2c: designware: remove runtime suspend prevention during registration Jisheng Zhang

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=20160421110859.1509ad2c@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).