All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@avionic-design.de>
To: "Philip, Avinash" <avinashphilip@ti.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"Nori, Sekhar" <nsekhar@ti.com>,
	"Hebbar, Gururaja" <gururaja.hebbar@ti.com>
Subject: Re: [PATCH 1/2] pwm: pwm-tiehrpwm: Low power sleep support
Date: Wed, 16 Jan 2013 13:30:26 +0100	[thread overview]
Message-ID: <20130116123026.GA7132@avionic-0098.adnet.avionic-design.de> (raw)
In-Reply-To: <518397C60809E147AF5323E0420B992E3EA5DF80@DBDE01.ent.ti.com>

[-- Attachment #1: Type: text/plain, Size: 1623 bytes --]

On Wed, Jan 16, 2013 at 12:14:01PM +0000, Philip, Avinash wrote:
> On Mon, Jan 14, 2013 at 12:38:56, Thierry Reding wrote:
> > On Thu, Jan 10, 2013 at 06:33:43PM +0530, Philip Avinash wrote:
> > [...]
> > > diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c
> > [...]
> > > +static int ehrpwm_pwm_suspend(struct device *dev)
> > > +{
> > > +	struct ehrpwm_pwm_chip *pc = dev_get_drvdata(dev);
> > > +
> > > +	ehrpwm_pwm_context_save(pc);
> > > +	pm_runtime_put_sync(dev);
> > > +	return 0;
> > > +}
> > > +
> > > +static int ehrpwm_pwm_resume(struct device *dev)
> > > +{
> > > +	struct ehrpwm_pwm_chip *pc = dev_get_drvdata(dev);
> > > +
> > > +	pm_runtime_get_sync(dev);
> > > +	ehrpwm_pwm_context_restore(pc);
> > > +	return 0;
> > > +}
> > 
> > According to Documentation/power/runtime_pm.txt, the PM core runs the
> > pm_runtime_get_noresume() and pm_runtime_put_sync() before executing the
> > .suspend() and .resume() callbacks. Are you sure you need to call them
> > here explicitly?
> 
> I understand the problem of calling pm_runtime_get_sync() from .resume().
> But this has to be called if pwm was running while going to suspend so that
> pwm can continues to run after resume.

Okay. I misread the documentation and/or your patch. The documentation
says that the core calls pm_runtime_get_noresume() before executing the
.suspend() callback so you're not in fact calling it twice. Sorry for
the confusion.

> So I will add check of test_bit(PWMF_ENABLED, &pwm->flags) before 
> pm_runtime_get/put_sync calls.

Yes, that sounds reasonable.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-01-16 12:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10 13:03 [PATCH 0/2] LOW power sleep support for TI PWM submodules Philip Avinash
2013-01-10 13:03 ` Philip Avinash
2013-01-10 13:03 ` [PATCH 1/2] pwm: pwm-tiehrpwm: Low power sleep support Philip Avinash
2013-01-10 13:03   ` Philip Avinash
2013-01-14  7:08   ` Thierry Reding
2013-01-16 12:14     ` Philip, Avinash
2013-01-16 12:30       ` Thierry Reding [this message]
2013-01-10 13:03 ` [PATCH 2/2] pwm: pwm-tiecap: " Philip Avinash
2013-01-10 13:03   ` Philip Avinash
2013-01-14  7:10   ` Thierry Reding
2013-01-16 12:13     ` Philip, Avinash

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=20130116123026.GA7132@avionic-0098.adnet.avionic-design.de \
    --to=thierry.reding@avionic-design.de \
    --cc=avinashphilip@ti.com \
    --cc=gururaja.hebbar@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nsekhar@ti.com \
    /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.