lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20130116123026.GA7132@avionic-0098.adnet.avionic-design.de>
Date:	Wed, 16 Jan 2013 13:30:26 +0100
From:	Thierry Reding <thierry.reding@...onic-design.de>
To:	"Philip, Avinash" <avinashphilip@...com>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-omap@...r.kernel.org" <linux-omap@...r.kernel.org>,
	"Nori, Sekhar" <nsekhar@...com>,
	"Hebbar, Gururaja" <gururaja.hebbar@...com>
Subject: Re: [PATCH 1/2] pwm: pwm-tiehrpwm: Low power sleep support

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

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ