PATCH: power down acpi and pci devices in suspend/resume

M. Warner Losh imp at bsdimp.com
Sun Nov 21 07:28:46 PST 2004


In message: <419EF7AD.8050007 at root.org>
            Nate Lawson <nate at root.org> writes:
: The attached patch implements setting power states for ACPI (i.e. ISA) 
: and PCI devices in the suspend/resume path.  This may help with some 
: problems; it's quite likely it may introduce problems.  That's why I'd 
: like it tested.  If you have a system that suspends/resumes ok or that 
: fails, please try it.  The likely failure case is a hang in suspend or 
: resume or a device that doesn't work afterwords.  It's pretty 
: heavy-handed, only avoiding changing power for serial ports since those 
: are known to cause a hang (which can possibly be fixed by making 
: sio/uart more aware of power states.)  I suspect devices like PCI 
: bridges may have problems with power changes.
: 
: If you have problems, please let me know the info it prints before the 
: hang so I can figure out what the problem device is.

I suspect that we'll need finer grain control over the APM case.  For
APM Bioses, the OS isn't supposed to put devices into lower power
states.  The APM BIOS generally does this and restores things on
resume.  APM is somewhat more limited in what it can do, so this makes
sense.

 	/*
-	 * Save the pci configuration space for each child.  We don't need
-	 * to do this, unless the BIOS suspend code powers down the bus and
-	 * the devices on the bus.
+	 * Save the PCI configuration space for each child and set the
+	 * device in the appropriate power state for this sleep state.
 	 */

So if APM implemented the ACPI_PWR_FOR_SLEEP interface, we'd be set.
However, there's at leas two problems with this.  One is that we don't
have a way to get the 'power management' device generically (witness
the hacks to get acpi in generic pci code).  Second, we don't have a
generic power interface, so having APM implement ACPI_ named methods
seems a little unsatisfying at best.  I'm not sure what powermacs do
for their PM stuff, but I'm pretty sure it isn't acpi.

Warner


More information about the freebsd-acpi mailing list