2002-09-29 02:17:35

by Hu Gang

[permalink] [raw]
Subject: problem abort software suspend.

Hi Pavel Machek:

I found result, That why my laptop without PM can do suspend/resume and with the PM can Not do suspend/resume.
The problem is in 3c59x modules.
I write an mini script do suspend and resume. When stop the net interface and remove the 3c59x all is fine. But not remove the 3c59x modules, in resume will panic.
After it, I do the follow test. Change the 3c59x code. Now suspend and resume, the kernel not panic, and all is fine. But I see the "recall resume" from dmesg command, So that is the problem.

Summarize: In resume progress have overlay device resume.

I thinks add the check code in low level driver is not good idea.
----------------------------------------------------patch code-----------
#ifdef CONFIG_PM
-
+static int in_suspend = 0;
static int vortex_suspend (struct pci_dev *pdev, u32 state)
{
struct net_device *dev = pci_get_drvdata(pdev);

+ if (in_suspend == 1) {
+ printk("recall suspend\n");
+ return 0;
+ }
+ printk("doing vortex suspend\n");
+ in_suspend = 1;
+
if (dev && dev->priv) {
if (netif_running(dev)) {
netif_device_detach(dev);
@@ -904,6 +911,13 @@
static int vortex_resume (struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
+
+ if (in_suspend == 0) {
+ printk("recall resume\n");
+ return 0;
+ }
+ printk("doing vortex resume\n");
+ in_suspend = 0;

if (dev && dev->priv) {
if (netif_running(dev)) {








--
- Hu Gang



Attachments:
(No filename) (189.00 B)