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

Nate Lawson nate at root.org
Mon Nov 29 14:19:02 PST 2004


Kevin Oberman wrote:
>>Date: Mon, 29 Nov 2004 11:15:05 -0800
>>From: Nate Lawson <nate at root.org>
>>
>>Kevin Oberman wrote:
>>
>>>The new patch removed the annoying "bad Vcc request" messages, but
>>>that's all it improved.  With the new patch I still lose cbb1 and
>>>anything connected to it. I see no real difference in the log other than
>>>the disappearance of the Vcc messages, but that is a good thing.
>>>
>>>If I set debug.suspend_power to '0', everything works as it did
>>>before. All PCI and CardBus devices seem to work fine after resume.
>>
>>Ok, I've revved it to only power down type 0 PCI (i.e. normal) devices 
>>so it shouldn't touch your cbb bridge.  Please try the attached patch. 
>>Note that there are now two separate tunables/sysctls to disable 
>>powerstates:
>>
>>hw.pci.do_powerstate=1
>>debug.acpi.do_powerstate=1
>>
>>This way you can disable PCI and ACPI power separately for debugging. 
>>Once things are stabilized, these will go away.
> 
> 
> Nate,
> 
> I tried to patch STABLE with this and the third patch for pci.c
> failed. I don't see why. Maybe whitespace?  In any case, I did that one
> by hand, but I could not compile a kernel.
> 
> cc -c -O -pipe  -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -fformat-extensions -std=c99 -g -nostdinc -I-  -I. -I/usr/src/sys -I/usr/src/sys/contrib/dev/acpica -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf -I/usr/src/sys/contrib/dev/ath -I/usr/src/sys/contrib/dev/ath/freebsd -I/usr/src/sys/contrib/ngatm -D_KERNEL -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000  -mno-align-long-strings -mpreferred-stack-boundary=2 -ffreestanding -Werror  /usr/src/sys/dev/pci/pci.c
> /usr/src/sys/dev/pci/pci.c: In function `pci_suspend':
> /usr/src/sys/dev/pci/pci.c:1057: warning: implicit declaration of function `ACPI_PWR_FOR_SLEEP'
> /usr/src/sys/dev/pci/pci.c:1057: warning: nested extern declaration of `ACPI_PWR_FOR_SLEEP'
> /usr/src/sys/dev/pci/pci.c: In function `pci_resume':
> /usr/src/sys/dev/pci/pci.c:1089: warning: nested extern declaration of `ACPI_PWR_FOR_SLEEP'
> /usr/src/sys/dev/pci/pci.c:1057: warning: redundant redeclaration of 'ACPI_PWR_FOR_SLEEP'
> /usr/src/sys/dev/pci/pci.c:1057: warning: previous implicit declaration of 'ACPI_PWR_FOR_SLEEP' was here
> *** Error code 1

I think I neglected to include the acpi_if.m patch this time.  You can 
manually add that from the previous versions of the diff.

> Perhaps I should note that I have been setting hw.pci.do_powerstate to 1
> for many months.

The change is that I've overloaded that option to also control PCI 
suspend power, not just power for unattached devices.

-- 
Nate


More information about the freebsd-acpi mailing list