mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* S3 and swsusp: fixing device_resume order
@ 2002-08-04 18:54 Pavel Machek
  0 siblings, 0 replies; only message in thread
From: Pavel Machek @ 2002-08-04 18:54 UTC (permalink / raw)
  To: torvalds, kernel list

Hi!

pci driver's resume must not be called during RESUME_POWER_ON because
interrupts are still off and i8259A is not initialized [OHCI kills
machine in such case, cardbus probably too. PCI drivers just assume
initialized interrupts.]

Second hunk fixes device_resume calls to be okay according to
documentation. Please apply,
								Pavel


--- clean/drivers/pci/pci-driver.c	Thu Jul 25 22:21:15 2002
+++ linux-swsusp/drivers/pci/pci-driver.c	Sun Aug  4 18:23:27 2002
@@ -90,7 +90,11 @@
 	struct pci_dev * pci_dev = to_pci_dev(dev);
 
 	if (pci_dev->driver) {
-		if (level == RESUME_POWER_ON && pci_dev->driver->resume)
+		/* 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)
 			pci_dev->driver->resume(pci_dev);
 	}
 	return 0;
--- clean/kernel/suspend.c	Sun Aug  4 20:19:49 2002
+++ linux-swsusp/kernel/suspend.c	Sun Aug  4 20:25:50 2002
@@ -619,8 +619,8 @@
 /* Make disk drivers accept operations, again */
 static void drivers_unsuspend(void)
 {
-	device_resume(RESUME_ENABLE);
 	device_resume(RESUME_RESTORE_STATE);
+	device_resume(RESUME_ENABLE);
 }
 
 /* Called from process context */
@@ -647,8 +647,8 @@
 static void drivers_resume(int flags)
 {
 	if (flags & RESUME_PHASE1) {
-		device_resume(RESUME_ENABLE);
 		device_resume(RESUME_RESTORE_STATE);
+		device_resume(RESUME_ENABLE);
 	}
   	if (flags & RESUME_PHASE2) {
 		if(pm_suspend_state) {

-- 
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-08-04 18:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-04 18:54 S3 and swsusp: fixing device_resume order Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®