public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* suspend() and runtime_suspend()
@ 2011-03-21  9:10 Martin, LoicX
  2011-03-21 14:28 ` Alan Stern
  0 siblings, 1 reply; 5+ messages in thread
From: Martin, LoicX @ 2011-03-21  9:10 UTC (permalink / raw)
  To: linux-pm@lists.linux-foundation.org


[-- Attachment #1.1: Type: text/plain, Size: 2363 bytes --]

Hi

I found in the linux kernel documentation :
In /power/pci.h
2.4.1. System Suspend

PCI device drivers (that don't implement legacy power management callbacks) are
generally not expected to prepare devices for signaling wakeup or to put them
into low-power states.  However, if one of the driver's suspend callbacks
(pm->suspend() or pm->suspend_noirq()) saves the device's standard configuration
registers, pci_pm_suspend_noirq() will assume that the device has been prepared
to signal wakeup and put into a low-power state by the driver (the driver is
then assumed to have used the helper functions provided by the PCI subsystem for
this purpose).  PCI device drivers are not encouraged to do that, but in some
rare cases doing that in the driver may be the optimum approach.

3.1.2 suspend()

It is not required (in fact it even is
not recommended) that a PCI driver's suspend() callback save the standard
configuration registers of the device, prepare it for waking up the system, or
put it into a low-power state.  All of these operations can very well be taken
care of by the PCI subsystem, without the driver's participation.

2.3. Runtime Device Power Management

It is expected that the device driver's pm->runtime_suspend() callback will
not attempt to prepare the device for signaling wakeup or to put it into a
low-power state.  The driver ought to leave these tasks to the PCI subsystem
that has all of the information necessary to perform them.


So I was wondering why in the kernel sources, most of the PCI drivers were using pci_set_power_state, as well pci_save_state either in suspend() callbacks either in runtime_suspend() callbacks.
Why should we not use those functions in a driver suspend callback implementation ?

Thx

Loic


---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

[-- Attachment #1.2: Type: text/html, Size: 29073 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

end of thread, other threads:[~2011-03-23 20:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-21  9:10 suspend() and runtime_suspend() Martin, LoicX
2011-03-21 14:28 ` Alan Stern
2011-03-22 15:50   ` Martin, LoicX
2011-03-23 15:39     ` Alan Stern
2011-03-23 20:38       ` Rafael J. Wysocki

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