mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH]1/2: fix power manager recall problem.
@ 2002-10-19 12:01 Hu Gang
  2002-10-20 20:24 ` Patrick Mochel
  0 siblings, 1 reply; 2+ messages in thread
From: Hu Gang @ 2002-10-19 12:01 UTC (permalink / raw)
  To: Linux Kernel, Pavel Machek, mochel

[-- Attachment #1: Type: text/plain, Size: 2485 bytes --]

Hello Patrick Mochel, Pavel Machek:

I'm tested the 2.5.3X suspend function and found the problem.
I'm enable debug option here is the log.
----------------------
skip...
Freeing memory: |
Syncing disks before copy
call device_resume SUSPEND_NOTIFY
Suspending devices
suspending device PCI device 8086:7111
suspending device PCI device 1022:2000
call device_resume SUSPEND_SAVE_STATE
Suspending devices
suspending device PCI device 8086:7111
suspending device PCI device 1022:2000
call device_resume SUSPEND_DISABLE
Suspending devices
suspending device PCI device 8086:7111
suspending device PCI device 1022:2000
call pm_send_all PM_SUSPEND
call pci_pm_suspend
call pcnet32_suspend
/critical section: Counting pages to copy[nosave c02af000] (pages needed: 4795+512=5307 free: 27972)
Alloc pagedir
[nosave c02af000]<4>Freeing prev allocated pagedir
call device_resume RESUME_RESTORE_STATE
resuming device PCI device 1022:2000
call pcnet32_resume
resuming device PCI device 8086:7111
resuming device i8259A PIC
skip......
------------------------
first the we call device suspend it suspend pci device and other device, but when we call pm_send_all to pm_suspend, it retry to suspend pci device, here is the real problem. 

This patch can fix it. Please apply.
------------------------------
diff -ur linux-2.5.44-clean/drivers/base/power.c linux-2.5.44-suspend/drivers/base/power.c
--- linux-2.5.44-clean/drivers/base/power.c	Sat Oct 19 15:56:47 2002
+++ linux-2.5.44-suspend/drivers/base/power.c	Sat Oct 19 18:00:28 2002
@@ -37,6 +37,14 @@
 	down(&device_sem);
 	list_for_each(node,&global_device_list) {
 		struct device * dev = to_dev(node);
+		if (dev->bus) {
+			char *name = dev->bus->name;
+			pr_debug("bus is %s\n", name);
+			if (strncmp(name, "pci", 3) ==  0) {
+				pr_debug("skip pci bus\n");
+				continue;
+			}
+		}
 		if (device_present(dev) && dev->driver && dev->driver->suspend) {
 			pr_debug("suspending device %s\n",dev->name);
 			error = dev->driver->suspend(dev,state,level);
@@ -63,6 +71,14 @@
 	down(&device_sem);
 	list_for_each_prev(node,&global_device_list) {
 		struct device * dev = to_dev(node);
+		if (dev->bus) {
+			char *name = dev->bus->name;
+			pr_debug("bus is %s\n", name);
+			if (strncmp(name, "pci", 3) ==  0) {
+				pr_debug("skip pci bus\n");	
+				continue;
+			}
+		}
 		if (device_present(dev) && dev->driver && dev->driver->resume) {
 			pr_debug("resuming device %s\n",dev->name);
 			dev->driver->resume(dev,level);
-- 
		- Hu Gang

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH]1/2: fix power manager recall problem.
  2002-10-19 12:01 [PATCH]1/2: fix power manager recall problem Hu Gang
@ 2002-10-20 20:24 ` Patrick Mochel
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick Mochel @ 2002-10-20 20:24 UTC (permalink / raw)
  To: Hu Gang; +Cc: Linux Kernel, Pavel Machek


> first the we call device suspend it suspend pci device and other device, but when we call pm_send_all to pm_suspend, it retry to suspend pci device, here is the real problem. 

> This patch can fix it. Please apply.
...

> +			char *name = dev->bus->name;
> +			pr_debug("bus is %s\n", name);
> +			if (strncmp(name, "pci", 3) ==  0) {
> +				pr_debug("skip pci bus\n");
> +				continue;
> +			}


This is a hack. the pm_* interface should not be used, as it cannot 
guarantee proper ordering when shutting down or resuming devices. If you 
experience problems, please remove the pm_send callbacks and make the 
drivers adhere to the new power management interface.

Thanks,

	-pat


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

end of thread, other threads:[~2002-10-20 20:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-19 12:01 [PATCH]1/2: fix power manager recall problem Hu Gang
2002-10-20 20:24 ` Patrick Mochel

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®