linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PM] more callbacks for pci powermanagment
@ 2003-07-26 23:00 Pavel Machek
  2003-08-05  1:03 ` Patrick Mochel
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Machek @ 2003-07-26 23:00 UTC (permalink / raw)
  To: kernel list, Patrick Mochel

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?]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PM] more callbacks for pci powermanagment
  2003-07-26 23:00 [PM] more callbacks for pci powermanagment Pavel Machek
@ 2003-08-05  1:03 ` Patrick Mochel
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick Mochel @ 2003-08-05  1:03 UTC (permalink / raw)
  To: Pavel Machek; +Cc: kernel list


> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-08-05  1:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-26 23:00 [PM] more callbacks for pci powermanagment Pavel Machek
2003-08-05  1:03 ` Patrick Mochel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).