All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Airlie <airlied@redhat.com>
To: Huang Ying <ying.huang@intel.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bjorn Helgaas <bhelgaas@google.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: [PATCH] pci/runtime-pm: respect devices autosuspend timeout on config access
Date: Wed, 7 Nov 2012 01:31:36 -0500 (EST)	[thread overview]
Message-ID: <619892122.2288591.1352269896409.JavaMail.root@redhat.com> (raw)
In-Reply-To: <1352269585.7176.6.camel@yhuang-dev>



----- Original Message -----
> From: "Huang Ying" <ying.huang@intel.com>
> To: "David Airlie" <airlied@redhat.com>
> Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, "Bjorn Helgaas" <bhelgaas@google.com>, "Rafael J.
> Wysocki" <rjw@sisk.pl>
> Sent: Wednesday, 7 November, 2012 4:26:25 PM
> Subject: Re: [PATCH] pci/runtime-pm: respect devices autosuspend timeout on config access
> 
> On Wed, 2012-11-07 at 01:15 -0500, David Airlie wrote:
> > > > 
> > > > Cc: Huang Ying <ying.huang@intel.com>
> > > > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > > > Cc: Rafael J. Wysocki <rjw@sisk.pl>
> > > > Signed-off-by: Dave Airlie <airlied@redhat.com>
> > > > ---
> > > >  drivers/pci/pci-sysfs.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > 
> > > > diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
> > > > index 02d107b..12d3d52 100644
> > > > --- a/drivers/pci/pci-sysfs.c
> > > > +++ b/drivers/pci/pci-sysfs.c
> > > > @@ -487,7 +487,7 @@ pci_config_pm_runtime_put(struct pci_dev
> > > > *pdev)
> > > >  	struct device *dev = &pdev->dev;
> > > >  	struct device *parent = dev->parent;
> > > >  
> > > > -	pm_runtime_put(dev);
> > > > +	pm_runtime_put_autosuspend(dev);
> > > >  	if (parent)
> > > >  		pm_runtime_put_sync(parent);
> > > >  }
> > > 
> > > I think you do not need that.  You can implement timeout
> > > in .runtime_idle callback of the driver.
> > 
> > If I understand what you are suggesting, I should setup some kinda
> > of timer callback to later call suspend, but that seems pointless
> > for me if we have the autosuspend mechanism in place.
> > 
> > Won't I end up racing my timer against other pm stuff? I'm not
> > really runtime pm expert so maybe I'm just missing something.
> 
> You can call pm_runtime_autosuspend or pm_runtime_schedule_suspend
> in .runtime_idle callback of the driver.

Ah that explains what I was probably missing, I'll go play with that for a while then!

Thanks,
Dave.

      reply	other threads:[~2012-11-07  6:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-07  5:30 [PATCH] pci/runtime-pm: respect devices autosuspend timeout on config access Dave Airlie
2012-11-07  5:58 ` Huang Ying
2012-11-07  6:15   ` David Airlie
2012-11-07  6:26     ` Huang Ying
2012-11-07  6:31       ` David Airlie [this message]

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=619892122.2288591.1352269896409.JavaMail.root@redhat.com \
    --to=airlied@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=ying.huang@intel.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.