On Sunday 28 December 2008, Rafael J. Wysocki wrote: > On Friday 19 December 2008, Rafael J. Wysocki wrote: > > Hi Len, > > > > The patch below adds the callbacks that save/restore the standard PCI config > > registers, change the power state of the device etc. to the new suspend-resume > > callbacks (which are not yet used by device drivers), so that the drivers don't > > have to worry about these operations. > > > > The saving and restoring of the standard PCI config registers is done with > > interrupts off, the other things are done with interrupts enabled. > > > > The patch should apply to the current linux-next tree. > > Below is a new version of the patch. > > Now, the standard config spaces of devices are restored with interrupts > disabled, but only if the bridges the devices are behind are in D0. Otherwise, > the operation is attempted again with interrupts enabled (presumably the > bridge would be put into D0 before that happens). > > Also, pci_disable_device() is not called during resume and > pci_reenable_device() is used to enable the devices that were enabled during > suspend. This allows us to automatically call pci_set_master() for devices > that were bus masters before suspend. Additionally, the pci_reenable_device() > may be overriden by the driver, by disabling the device during suspend. > > Finally, bridges are handled a bit differently from the regular devices (they > are not put into low power states during suspend and pci_enable_wake() is > not called for them. > > The patch should apply on top of linux-next with the patch fixing > pci_update_current_state() I sent yesterday > (http://marc.info/?l=linux-kernel&m=123039199607159&w=4). In the meantime I realized that the pcibios_enable_device() called from pci_reenable_device() in the resume code path should be balanced by a "suspend" call of the same kind. Also, I decided to split the patch into a series of smaller patches with their own changelogs to make it easier to follow the changes. Perhaps this way it will be more clear what I'm after. The patches should apply to linux-next with the patch from http://marc.info/?l=linux-kernel&m=123039199607159&w=4 on top. Comments welcome. Happy New Year to everyone, Rafael -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html