Re: [PATCH 6/8] PCI ACPI: Rework PCI handling of wake-up
From: Rafael J. Wysocki <hidden>
Date: 2008-06-27 15:12:17
On Friday, 27 of June 2008, Rafael J. Wysocki wrote:
On Friday, 27 of June 2008, Shaohua Li wrote:quoted
On Fri, 2008-06-27 at 06:28 +0800, Rafael J. Wysocki wrote:[--snip--]quoted
quoted
+ + if (pmc & PCI_PM_CAP_PME_MASK) { + dev_printk(KERN_INFO, &dev->dev, + "PME# supported from%s%s%s%s%s\n", + (pmc & PCI_PM_CAP_PME_D0) ? " D0" : "", + (pmc & PCI_PM_CAP_PME_D1) ? " D1" : "", + (pmc & PCI_PM_CAP_PME_D2) ? " D2" : "", + (pmc & PCI_PM_CAP_PME_D3) ? " D3hot" : "", + (pmc & PCI_PM_CAP_PME_D3cold) ? " D3cold" : ""); + /* + * Make device's PM flags reflect the wake-up capability, but + * let the user space enable it to wake up the system as needed. + */ + device_set_wakeup_capable(&dev->dev, true); + device_set_wakeup_enable(&dev->dev, false); + /* Disable the PME# generation functionality */ + pci_pme_active(dev, pm, false); + } }It appears a lot of drivers will call device_init_wakeup(dev, 1) regardless if userspace enable wakeup for the device. Will you fix the drivers?Either fix the drivers, or change device_init_wakeup() so that it doesn't set power.should_wakeup to the same value as power.can_wakeup, which IMO is a mistake. Perhaps it's better to drop device_init_wakeup() altogether.
Note, however, that in any case this will only change the default from 'wake-up enabled' to 'wake-up disabled' and the user space will be able to change the value later on anyway. That said, setting power.can_wakeup for devices that in fact can't wake up is plain wrong and the drivers that do such things will have to be fixed. Thanks, Rafael