Skip to contentSkip to conversation

question about driver's runtime_suspend

DISCUSSION Tom Lyon 2 participants 2 messages Sep 3, 2010 – Sep 4, 2010

lore
Share & tools
lore

Tom Lyon

author
#0 lore raw

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.

#1 lore raw
Quoted 6 lines · Tom Lyon

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.

Quoted 2 lines

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