2003-07-26 22:46:42

by Pavel Machek

[permalink] [raw]
Subject: [PM] more callbacks for pci powermanagment

Hi!

Some PCI devices need to act during power-on... Greg refused to apply
it waiting for you, but you probably remember that discussion.

Pavel

Index: linux/drivers/pci/pci-driver.c
===================================================================
--- linux.orig/drivers/pci/pci-driver.c 2003-07-22 13:39:43.000000000 +0200
+++ linux/drivers/pci/pci-driver.c 2003-07-22 13:26:26.000000000 +0200
@@ -179,11 +179,9 @@
struct pci_dev * pci_dev = to_pci_dev(dev);

if (pci_dev->driver) {
- /* We may not call PCI drivers resume at
- RESUME_POWER_ON because interrupts are not yet
- working at that point. Calling resume at
- RESUME_RESTORE_STATE seems like solution. */
- if (level == RESUME_RESTORE_STATE && pci_dev->driver->resume)
+ if (level == RESUME_POWER_ON && pci_dev->driver->power_on)
+ pci_dev->driver->power_on(pci_dev);
+ else if (level == RESUME_RESTORE_STATE && pci_dev->driver->resume)
pci_dev->driver->resume(pci_dev);
}
return 0;
Index: linux/include/linux/pci.h
===================================================================
--- linux.orig/include/linux/pci.h 2003-07-22 13:39:42.000000000 +0200
+++ linux/include/linux/pci.h 2003-07-22 13:26:52.000000000 +0200
@@ -512,6 +512,7 @@
void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
int (*save_state) (struct pci_dev *dev, u32 state); /* Save Device Context */
int (*suspend) (struct pci_dev *dev, u32 state); /* Device suspended */
+ int (*power_on) (struct pci_dev *dev); /* Device power on */
int (*resume) (struct pci_dev *dev); /* Device woken up */
int (*enable_wake) (struct pci_dev *dev, u32 state, int enable); /* Enable wake event */




--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]


2003-08-05 01:02:18

by Patrick Mochel

[permalink] [raw]
Subject: Re: [PM] more callbacks for pci powermanagment


> Some PCI devices need to act during power-on... Greg refused to apply
> it waiting for you, but you probably remember that discussion.

I do remember, and am holding off on this for a few days until I have a
chance to do some of the necessary PM infrastructure to support this
globally.


-pat