public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* question about driver's runtime_suspend
@ 2010-09-03 22:20 Tom Lyon
  2010-09-04  1:37 ` Alan Stern
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Lyon @ 2010-09-03 22:20 UTC (permalink / raw)
  To: rjw, linux-pm

Hi. I am looking at supporting the new PM stuff in my VFIO "driver" - which 
allows user level drivers for PCI* devices.

When runtime_suspend is invoked, is it allowed to sleep while determining 
whether the device can be suspended?  If not, does returning -EAGAIN mean that 
it will be called again after some interval? 

I would like to notify the user level that a suspend is desired, and then wait 
for it to tell the vfio driver whether or not the suspend is OK.

Thanks for any help.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: question about driver's runtime_suspend
  2010-09-03 22:20 question about driver's runtime_suspend Tom Lyon
@ 2010-09-04  1:37 ` Alan Stern
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Stern @ 2010-09-04  1:37 UTC (permalink / raw)
  To: Tom Lyon; +Cc: linux-pm

On Fri, 3 Sep 2010, Tom Lyon wrote:

> Hi. I am looking at supporting the new PM stuff in my VFIO "driver" - which 
> allows user level drivers for PCI* devices.
> 
> When runtime_suspend is invoked, is it allowed to sleep while determining 
> whether the device can be suspended?  If not, does returning -EAGAIN mean that 
> it will be called again after some interval? 

The runtime_suspend callback is allowed to sleep.  But it should try to 
avoid sleeping for very long.

Returning -EAGAIN does not guarantee that it will be called again.  
That is up to your driver.

> I would like to notify the user level that a suspend is desired, and then wait 
> for it to tell the vfio driver whether or not the suspend is OK.

You should put an upper limit on the amount of time the driver will 
wait to hear back from the user.

Alan Stern

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-04  1:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-03 22:20 question about driver's runtime_suspend Tom Lyon
2010-09-04  1:37 ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox