public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* swsuspend not working
@ 2004-07-15 12:10 ` Éric Brunet
  2004-07-15 12:18   ` Pavel Machek
  2004-07-15 12:47   ` swsuspend not working Stefan Seyfried
  0 siblings, 2 replies; 15+ messages in thread
From: Éric Brunet @ 2004-07-15 12:10 UTC (permalink / raw)
  To: Linux Kernel mailing list, pavel

Hi,

With Pavel declaring that software suspend was mostly working on non-SMP
computers and that only device drivers were to remained to be fixed, I
felt that I needed to give it a try.

You see, on the three latest computers I have played with (two laptops
and one desktop), I never managed to get suspend to disk to work. The
best I got was a year ago for some revision of pmdisk were, for stripped
down kernels with no module loaded I could suspend and resume once in a
while. Then Patrick released a new version and it never worked again.
Then Patrick stopped working on that.

I have never tried swsusp2 because my goal, ultimately, is to have S3
working. I understand that S3 is much more difficult than S4 and that
swsusp2 does not deal with S3. So the plan is to have S4 on swsusp, then
S3. (Actually, my latest laptop seems to have S3 half working with
kernel parameter acpi_sleep=s3_bios, but S4 does not.)

As I said, I felt ready for trying again. I compiled a 2.6.8-rc1 kernel
with the barest possible configuration file: support for IDE, ext3,/proc,
keyboard and acpi. No mouse, no usb, no framebuffer, no agp, no preempt,
no apic, no module, etc. A useless kernel, obviously, but I tried to
maximize the odds to have S4 working.

I booted with " root=/dev/hda2 resume=/dev/hda5 init=/bin/sh". No initrd,
of course. Once I had a prompt, I mounted /proc and echoed 4 to
/proc/acpi/sleep. The screen blinked and 3 seconds later I was back at my
shell. The computer did not suspend. One very bad thing happened: in the
process, the fan controller was reset. It means that the fan went full
speed, while before it was in a low speed/low noise mode set up by the
bios. I know I cannot bring it back to the low speed/low noise setting
from linux, I must reboot the computer. But anyway, the computer did not
suspend.

Here are the kernel messages I got:
-----------------------------------------
dsmthdat-0462 [36] ds_method_data_get_val: Uninitialized Local[0] at node df72f10c
Freeing memory: .....|
PM: Attempting to suspend to disk.
PM: snapshotting memory.
ACPI: PCI interrupt 0000:00:1f.1[A] -> GSI 11 (level, low) -> IRQ 11
dsmthdat-0462 [36] ds_method_data_get_val: Uninitialized Local[0] at node df72f10c
dsmthdat-0462 [36] ds_method_data_get_val: Uninitialized Local[0] at node df72f90c
Restarting tasks... done
-------------------------------------------
(device 0000:00:1f.1 is the IDE controller. lspci output says it is
connected to IRQ 11, but /proc/interrupts gives IRQ 14 for ide0 and
nothing for IRQ 11)

What does that mean ? What can I do to debug the problem and have S4
working ? I am leaving for a long WE, but starting on Monday, I am
willing to try any patch or any kernel configuration to have things
working.

All relevant information on the computer (lspci, dsdt, kernel config,
full dmesg) is on http://tudia.nerim.net/bug-reports/

Thanks,

	Éric Brunet

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

* Re: swsuspend not working
  2004-07-15 12:10 ` swsuspend not working Éric Brunet
@ 2004-07-15 12:18   ` Pavel Machek
  2004-07-15 13:23     ` Éric Brunet
  2004-07-15 12:47   ` swsuspend not working Stefan Seyfried
  1 sibling, 1 reply; 15+ messages in thread
From: Pavel Machek @ 2004-07-15 12:18 UTC (permalink / raw)
  To: Éric Brunet; +Cc: Linux Kernel mailing list

Hi!

> I booted with " root=/dev/hda2 resume=/dev/hda5 init=/bin/sh". No initrd,
> of course. Once I had a prompt, I mounted /proc and echoed 4 to
> /proc/acpi/sleep. The screen blinked and 3 seconds later I was back at my
> shell. The computer did not suspend. One very bad thing happened: in the
> process, the fan controller was reset. It means that the fan went full
> speed, while before it was in a low speed/low noise mode set up by the
> bios. I know I cannot bring it back to the low speed/low noise setting
> from linux, I must reboot the computer. But anyway, the computer did not
> suspend.
> 
> Here are the kernel messages I got:
> -----------------------------------------
> dsmthdat-0462 [36] ds_method_data_get_val: Uninitialized Local[0] at node df72f10c
> Freeing memory: .....|
> PM: Attempting to suspend to disk.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You are not really using swsusp. You are using pmdisk. Fix your
kernel config.
								Pavel
-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

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

* Re: swsuspend not working
  2004-07-15 12:10 ` swsuspend not working Éric Brunet
  2004-07-15 12:18   ` Pavel Machek
@ 2004-07-15 12:47   ` Stefan Seyfried
  1 sibling, 0 replies; 15+ messages in thread
From: Stefan Seyfried @ 2004-07-15 12:47 UTC (permalink / raw)
  To: Éric Brunet, linux-kernel

On Thu, Jul 15, 2004 at 12:13:10PM +0000, Éric Brunet wrote:

> I booted with " root=/dev/hda2 resume=/dev/hda5 init=/bin/sh". No initrd,
> of course. Once I had a prompt, I mounted /proc and echoed 4 to
> /proc/acpi/sleep. The screen blinked and 3 seconds later I was back at my

you have to swapon your swap partition.

> Here are the kernel messages I got:
> -----------------------------------------
> dsmthdat-0462 [36] ds_method_data_get_val: Uninitialized Local[0] at node df72f10c
> Freeing memory: .....|
> PM: Attempting to suspend to disk.
> PM: snapshotting memory.

that's not swsusp, that's pmdisk. check your kernel config.
-- 
Stefan Seyfried

"Any ideas, John?"
"Well, surrounding thems out."

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

* Re: swsuspend not working
  2004-07-15 13:23     ` Éric Brunet
@ 2004-07-15 13:21       ` Nigel Cunningham
  2004-07-19 19:19       ` Éric Brunet
  1 sibling, 0 replies; 15+ messages in thread
From: Nigel Cunningham @ 2004-07-15 13:21 UTC (permalink / raw)
  To: Éric Brunet; +Cc: Pavel Machek, Linux Kernel Mailing List

Hi.

On Thu, 2004-07-15 at 23:23, Éric Brunet wrote:
> On Thu, Jul 15, 2004 at 02:18:25PM +0200, Pavel Machek wrote:
> > You are not really using swsusp. You are using pmdisk. Fix your
> > kernel config.
> 
> Oh, I am confused; I believed that /proc/acpi/sleep was for swsuspend and
> /sys/power/state for pmdisk. Well, things are changing I guess.

Yes. Pavel and Patrick are working toward a Vulcan mind meld, I believe
:>

Nigel


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

* Re: swsuspend not working
  2004-07-15 12:18   ` Pavel Machek
@ 2004-07-15 13:23     ` Éric Brunet
  2004-07-15 13:21       ` Nigel Cunningham
  2004-07-19 19:19       ` Éric Brunet
  0 siblings, 2 replies; 15+ messages in thread
From: Éric Brunet @ 2004-07-15 13:23 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Linux Kernel mailing list

On Thu, Jul 15, 2004 at 02:18:25PM +0200, Pavel Machek wrote:
> You are not really using swsusp. You are using pmdisk. Fix your
> kernel config.

Oh, I am confused; I believed that /proc/acpi/sleep was for swsuspend and
/sys/power/state for pmdisk. Well, things are changing I guess.

Anyway, I recompiled and tried again (not forgetting this time to swapon;
swsuspend has a usefull error message) and it worked ! Twice in a row !
I then tried S3, but then, no luck. The computer printed some text,
apparently shut down. I hit the power button to wake it up, I can hear
the fan and the disk spinning up, but the screen remains black and the
keyboard does nothing (caps lock does not lit the led, Ctrl-Alt-Suppr
does not reboot.) I have to hit the reset button.

Next I tried to suspend with the standard Fedora kernel
(2.6.6-1.435.2.3). I booted normally, did a telinit 1, umounted
everything except /proc and /, removed all modules except jbd and ext3
and did echo 4 > /proc/acpi/sleep and nothing happened. Half a second
later, sh was waiting for more input. The screen didn't blink, no line
was output, nothing in the logs.

The next step will be to boot the Fedora kernel directly in runlevel 1
(or maybe with init=/bin/sh, but I have to understand initrd, then) so
that most modules will never get loaded, video will never get set up,
etc., and then try S4. And then, their will be the long dichotomy to see
what is not working.

But that will be on monday, I think.

Éric

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

* Re: swsuspend not working
  2004-07-15 13:23     ` Éric Brunet
  2004-07-15 13:21       ` Nigel Cunningham
@ 2004-07-19 19:19       ` Éric Brunet
  2004-07-20 13:17         ` Pavel Machek
  1 sibling, 1 reply; 15+ messages in thread
From: Éric Brunet @ 2004-07-19 19:19 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Linux Kernel mailing list

On Thu, Jul 15, 2004 at 03:23:48PM +0200, Éric Brunet wrote:
> Next I tried to suspend with the standard Fedora kernel
> (2.6.6-1.435.2.3). I booted normally, did a telinit 1, umounted
> everything except /proc and /, removed all modules except jbd and ext3
> and did echo 4 > /proc/acpi/sleep and nothing happened. Half a second
> later, sh was waiting for more input. The screen didn't blink, no line
> was output, nothing in the logs.

Ok, it is not surprising that the fedora kernel does not suspend to disk;
suspend to disk is not compiled in. What a weird decision from them.

Anyway, I recompiled a vanilla 2.6.8-rc1 with a usable configuration (usb
as modules, network, agpgart, drm, etc.) and could suspend and resume
from X11 after a standard boot sequence.

However, usb devices are in big troubles. I had at the time a wireless
usb mouse and an usb memory key plugged in. Mouse goes through the uhci
host controller and key through ehci. In short, they don't work after
resume. The weird thing is that /proc/bus/usb/devices is different after
resume: the identification strings are missing:

	diff -rU 1 usb-before/devices usb-after/devices
	--- usb-before/devices  2004-07-19 19:15:09.000000000 +0200
	+++ usb-after/devices   2004-07-19 19:15:09.000000000 +0200
	@@ -15,5 +15,2 @@
	 P:  Vendor=0d7d ProdID=1320 Rev= 0.50
	-S:  Manufacturer=ASUS
	-S:  Product=Ai Flash-4
	-S:  SerialNumber=07420B100083
	 C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=200mA
	@@ -48,4 +45,2 @@
	 P:  Vendor=1733 ProdID=0101 Rev= 0.01
	-S:  Manufacturer=Cellink Co., LTD.
	-S:  Product=Wireless RF Mouse
	 C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA

If I rmmod ehci_hcd and modprobe it back, I can have the memory key
working again (except that if it was mounted before, troubles ahead. I
had a kernel oops that way.) If I rmmod uhci_hcd and modprobe it back,
the mouse becomes alive again.

If, instead of unloading/reloading the modules, I unplug and replug the
radio emiter of the mouse, I get it back working. If I unplug the memory
key, the device REMAINS as managed by the ehci controller. If I plug it
back again, the memory key appears A SECOND TIME in the list of usb
device, but as an uhci device, this time.

I guess I could rmmod the usb modules before suspending and modprobe back
them after resuming, but that means I need to remember that if a memory
key, a camera or a zip drive is plugged in and mounted, I will probably
crash the kernel. Hmm.

Another device is not working after resume: it is an old realtek 8029
100 Mb LAN pci card. If I try to ping something on the LAN, I get a
« Destination Host Unreachable » and nothing more. The interrupt count of
the card is increasing, however. Unloading and reloading ne2k_pci fixes
that.

Note that when I suspend, I get in the log
20:13:46: ACPI: PCI interrupt 0000:00:1f.1[A] -> GSI 11 (level, low) -> IRQ 11
20:13:47: ACPI: PCI interrupt 0000:00:1f.5[B] -> GSI 5 (level, low) -> IRQ 5
20:13:51: eth0: link down
20:13:51: ACPI: PCI interrupt 0000:01:08.0[A] -> GSI 10 (level, low) -> IRQ 10
20:13:51: Fixing swap signatures... ok
20:13:51: Restarting tasks... done

and at resume time:
20:15:52: eth1: mismatched read page pointers 4c vs 68.

eth1 is the misbehaving LAN card, and its interrupt is 10.

When I unload/reload the ne2k_pci module, I get at reload time:
20:21:11: ne2k-pci.c:v1.03 9/22/2003 D. Becker/P. Gortmaker
20:21:11: http://www.scyld.com/network/ne2k-pci.html
20:21:11: ACPI: PCI interrupt 0000:01:08.0[A] -> GSI 10 (level, low) -> IRQ 10
20:21:11: eth1: RealTek RTL-8029 found at 0xc800, IRQ 10, 00:40:05:E2:2A:CF.

Notice the ACPI: PCI interrupt line. I have something similar when I
reload the ehci module
20:20:31: ACPI: PCI interrupt 0000:00:1d.7[D] -> GSI 11 (level, low) -> IRQ 11

I am not sure what all of this means. I could try to fiddle the kernel
configuration, but is it worth it ? For instance, would you recommend
using APIC or try different pci=... command line options to change the
way interrupts are initialized ?

Data on my computer on <http://tudia.nerim.net/bug-reports/>.

Oh, by the way, the merging of pmdisk and swsuspend is great news !

Regards,

	Éric Brunet

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

* Re: swsuspend not working
  2004-07-19 19:19       ` Éric Brunet
@ 2004-07-20 13:17         ` Pavel Machek
  2004-07-20 15:50           ` Romano Giannetti
  2004-07-31 18:20           ` Éric Brunet
  0 siblings, 2 replies; 15+ messages in thread
From: Pavel Machek @ 2004-07-20 13:17 UTC (permalink / raw)
  To: Éric Brunet; +Cc: Linux Kernel mailing list

Hi!

> Ok, it is not surprising that the fedora kernel does not suspend to disk;
> suspend to disk is not compiled in. What a weird decision from them.

Oops.

> If, instead of unloading/reloading the modules, I unplug and replug the
> radio emiter of the mouse, I get it back working. If I unplug the memory
> key, the device REMAINS as managed by the ehci controller. If I plug it
> back again, the memory key appears A SECOND TIME in the list of usb
> device, but as an uhci device, this time.

Ok, someone needs to fix usb.

> Another device is not working after resume: it is an old realtek 8029
> 100 Mb LAN pci card. If I try to ping something on the LAN, I get a
> ? Destination Host Unreachable ? and nothing more. The interrupt count of
> the card is increasing, however. Unloading and reloading ne2k_pci fixes
> that.

Teach ne2k_pci to do on suspend what it does on unload, and to do on
resume what it does on load. Should be easy.

Oh and maybe "noapic".
									Pavel
-- 
Horseback riding is like software...
...vgf orggre jura vgf serr.

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

* Re: swsuspend not working
  2004-07-20 13:17         ` Pavel Machek
@ 2004-07-20 15:50           ` Romano Giannetti
  2004-07-31 18:20           ` Éric Brunet
  1 sibling, 0 replies; 15+ messages in thread
From: Romano Giannetti @ 2004-07-20 15:50 UTC (permalink / raw)
  To: Linux Kernel mailing list

On Tue, Jul 20, 2004 at 03:17:48PM +0200, Pavel Machek wrote:

> > If, instead of unloading/reloading the modules, I unplug and replug the
> > radio emiter of the mouse, I get it back working. If I unplug the memory
> > key, the device REMAINS as managed by the ehci controller. If I plug it
> > back again, the memory key appears A SECOND TIME in the list of usb
> > device, but as an uhci device, this time.
> 
> Ok, someone needs to fix usb.
> 

I can confirm that USB has troubles with suspend/resume (I have a Sony vaio
laptop; http://perso.wanadoo.es/r_mano/vaio/vaio.html ). Especially the
memory key; the only way to not have to reboot to have it is suspending with
the key umounted. 

On the bright side, I doscovered that current (2.6.7) kernel pcmcia and alsa
sound behave perfectly w/ respect of suspend/resume. No need to cardctl
eject before and insert after, my modem continue working after resume; and I
can even suspend with xmms playing and on resume it will continue happily. 

Nice work, a kudo to all! 

Romano 

-- 
Romano Giannetti             -  Univ. Pontificia Comillas (Madrid, Spain)
Electronic Engineer - phone +34 915 422 800 ext 2416  fax +34 915 596 569

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

* Re: swsuspend not working
  2004-07-20 13:17         ` Pavel Machek
  2004-07-20 15:50           ` Romano Giannetti
@ 2004-07-31 18:20           ` Éric Brunet
  2004-08-06 19:06             ` Pavel Machek
  1 sibling, 1 reply; 15+ messages in thread
From: Éric Brunet @ 2004-07-31 18:20 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Linux Kernel mailing list, p_gortmaker

On Tue, Jul 20, 2004 at 03:17:48PM +0200, Pavel Machek wrote:
> > ? Destination Host Unreachable ? and nothing more. The interrupt count of
> > the card is increasing, however. Unloading and reloading ne2k_pci fixes
> > that.
> 
> Teach ne2k_pci to do on suspend what it does on unload, and to do on
> resume what it does on load. Should be easy.

« Should be easy » is easily said. Well.

The following patch to drivers/net/ne2k-pci.c in 2.6.8-rc1 happens to make
my pci ethernet card (Realtek Semiconductor Co., Ltd. RTL-8029(AS))
suspend to S4 and resume properly.

I know nothing on suspend/resume architecture, I know nothing on
programming ethernet card, I know nothing on patching device drivers; I
just looked at other drivers, picked function calls that had nice looking
names and put them together in ne2k_pci.c. Miraculously, it works.

Do you think it could get in ?

Éric Brunet

--- ne2k-pci.c.orig	2004-07-20 22:15:30.000000000 +0200
+++ ne2k-pci.c	2004-07-31 19:48:38.000000000 +0200
@@ -653,12 +653,43 @@
 	pci_set_drvdata(pdev, NULL);
 }
 
+#ifdef CONFIG_PM
+static int ne2k_pci_suspend (struct pci_dev *pdev, u32 state)
+{
+	struct net_device *dev = pci_get_drvdata (pdev);
+
+	netif_device_detach(dev);
+	ne2k_pci_close(dev);
+	ne2k_pci_reset_8390(dev);
+	pci_set_power_state (pdev, state);
+
+	return 0;
+}
+static int ne2k_pci_resume (struct pci_dev *pdev)
+{
+	struct net_device *dev = pci_get_drvdata (pdev);
+
+	pci_set_power_state(pdev, 0);
+	ne2k_pci_reset_8390(dev);
+	ne2k_pci_open(dev);
+	netif_device_attach(dev);
+
+	return 0;
+}
+
+#endif /* CONFIG_PM */
+
 
 static struct pci_driver ne2k_driver = {
 	.name		= DRV_NAME,
 	.probe		= ne2k_pci_init_one,
 	.remove		= __devexit_p(ne2k_pci_remove_one),
 	.id_table	= ne2k_pci_tbl,
+#ifdef CONFIG_PM
+	.suspend	= ne2k_pci_suspend,
+	.resume		= ne2k_pci_resume,
+#endif /* CONFIG_PM */
+
 };
 
 

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

* Re: swsuspend not working
  2004-07-31 18:20           ` Éric Brunet
@ 2004-08-06 19:06             ` Pavel Machek
  2004-08-06 23:54               ` Éric Brunet
  0 siblings, 1 reply; 15+ messages in thread
From: Pavel Machek @ 2004-08-06 19:06 UTC (permalink / raw)
  To: Éric Brunet; +Cc: Linux Kernel mailing list, p_gortmaker

Hi!

> > > ? Destination Host Unreachable ? and nothing more. The interrupt count of
> > > the card is increasing, however. Unloading and reloading ne2k_pci fixes
> > > that.
> > 
> > Teach ne2k_pci to do on suspend what it does on unload, and to do on
> > resume what it does on load. Should be easy.
> 
> ? Should be easy ? is easily said. Well.

:-)))).

> The following patch to drivers/net/ne2k-pci.c in 2.6.8-rc1 happens to make
> my pci ethernet card (Realtek Semiconductor Co., Ltd. RTL-8029(AS))
> suspend to S4 and resume properly.
> 
> I know nothing on suspend/resume architecture, I know nothing on
> programming ethernet card, I know nothing on patching device drivers; I
> just looked at other drivers, picked function calls that had nice looking
> names and put them together in ne2k_pci.c. Miraculously, it works.
> 
> Do you think it could get in ?

Yes, the patch looks good to me, submit it through ne2k-pci
maintainer...

									Pavel

> --- ne2k-pci.c.orig	2004-07-20 22:15:30.000000000 +0200
> +++ ne2k-pci.c	2004-07-31 19:48:38.000000000 +0200
> @@ -653,12 +653,43 @@
>  	pci_set_drvdata(pdev, NULL);
>  }
>  
> +#ifdef CONFIG_PM
> +static int ne2k_pci_suspend (struct pci_dev *pdev, u32 state)
> +{
> +	struct net_device *dev = pci_get_drvdata (pdev);
> +
> +	netif_device_detach(dev);
> +	ne2k_pci_close(dev);
> +	ne2k_pci_reset_8390(dev);
> +	pci_set_power_state (pdev, state);
> +
> +	return 0;
> +}
> +static int ne2k_pci_resume (struct pci_dev *pdev)
> +{
> +	struct net_device *dev = pci_get_drvdata (pdev);
> +
> +	pci_set_power_state(pdev, 0);
> +	ne2k_pci_reset_8390(dev);
> +	ne2k_pci_open(dev);
> +	netif_device_attach(dev);
> +
> +	return 0;
> +}
> +
> +#endif /* CONFIG_PM */
> +
>  
>  static struct pci_driver ne2k_driver = {
>  	.name		= DRV_NAME,
>  	.probe		= ne2k_pci_init_one,
>  	.remove		= __devexit_p(ne2k_pci_remove_one),
>  	.id_table	= ne2k_pci_tbl,
> +#ifdef CONFIG_PM
> +	.suspend	= ne2k_pci_suspend,
> +	.resume		= ne2k_pci_resume,
> +#endif /* CONFIG_PM */
> +
>  };
>  
>  

-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

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

* Re: swsuspend not working
  2004-08-06 19:06             ` Pavel Machek
@ 2004-08-06 23:54               ` Éric Brunet
  2004-08-07  7:13                 ` Paul Gortmaker
  0 siblings, 1 reply; 15+ messages in thread
From: Éric Brunet @ 2004-08-06 23:54 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Linux Kernel mailing list, p_gortmaker

On Fri, Aug 06, 2004 at 09:06:49PM +0200, Pavel Machek wrote:
> > Do you think it could get in ?
> 
> Yes, the patch looks good to me, submit it through ne2k-pci
> maintainer...
> 
Thank you ! The maintainer (Paul Gortmaker) is already in the CC. He
didn't answer but hey, it is August and people are going on holyday. I
will resend the patch in September.

Éric Brunet
> 									Pavel
> 
> > --- ne2k-pci.c.orig	2004-07-20 22:15:30.000000000 +0200
> > +++ ne2k-pci.c	2004-07-31 19:48:38.000000000 +0200
> > @@ -653,12 +653,43 @@
> >  	pci_set_drvdata(pdev, NULL);
> >  }
> >  
> > +#ifdef CONFIG_PM
> > +static int ne2k_pci_suspend (struct pci_dev *pdev, u32 state)
> > +{
> > +	struct net_device *dev = pci_get_drvdata (pdev);
> > +
> > +	netif_device_detach(dev);
> > +	ne2k_pci_close(dev);
> > +	ne2k_pci_reset_8390(dev);
> > +	pci_set_power_state (pdev, state);
> > +
> > +	return 0;
> > +}
> > +static int ne2k_pci_resume (struct pci_dev *pdev)
> > +{
> > +	struct net_device *dev = pci_get_drvdata (pdev);
> > +
> > +	pci_set_power_state(pdev, 0);
> > +	ne2k_pci_reset_8390(dev);
> > +	ne2k_pci_open(dev);
> > +	netif_device_attach(dev);
> > +
> > +	return 0;
> > +}
> > +
> > +#endif /* CONFIG_PM */
> > +
> >  
> >  static struct pci_driver ne2k_driver = {
> >  	.name		= DRV_NAME,
> >  	.probe		= ne2k_pci_init_one,
> >  	.remove		= __devexit_p(ne2k_pci_remove_one),
> >  	.id_table	= ne2k_pci_tbl,
> > +#ifdef CONFIG_PM
> > +	.suspend	= ne2k_pci_suspend,
> > +	.resume		= ne2k_pci_resume,
> > +#endif /* CONFIG_PM */
> > +
> >  };
> >  
> >  
> 
> -- 
> People were complaining that M$ turns users into beta-testers...
> ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

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

* Re: swsuspend not working
  2004-08-06 23:54               ` Éric Brunet
@ 2004-08-07  7:13                 ` Paul Gortmaker
       [not found]                   ` <20040807140845.GA8353@lps.ens.fr>
  0 siblings, 1 reply; 15+ messages in thread
From: Paul Gortmaker @ 2004-08-07  7:13 UTC (permalink / raw)
  To:  "Éric" Brunet, Pavel Machek
  Cc: Linux Kernel mailing list, p_gortmaker

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 2113 bytes --]

Did you determine that the reset_8390 was required for
proper suspend/resume behaviour?

--- Éric Brunet <Eric.Brunet@lps.ens.fr> wrote:

> On Fri, Aug 06, 2004 at 09:06:49PM +0200, Pavel Machek wrote:
> > > Do you think it could get in ?
> > 
> > Yes, the patch looks good to me, submit it through ne2k-pci
> > maintainer...
> > 
> Thank you ! The maintainer (Paul Gortmaker) is already in the CC. He
> didn't answer but hey, it is August and people are going on holyday. I
> will resend the patch in September.
> 
> Éric Brunet
> > 									Pavel
> > 
> > > --- ne2k-pci.c.orig	2004-07-20 22:15:30.000000000 +0200
> > > +++ ne2k-pci.c	2004-07-31 19:48:38.000000000 +0200
> > > @@ -653,12 +653,43 @@
> > >  	pci_set_drvdata(pdev, NULL);
> > >  }
> > >  
> > > +#ifdef CONFIG_PM
> > > +static int ne2k_pci_suspend (struct pci_dev *pdev, u32 state)
> > > +{
> > > +	struct net_device *dev = pci_get_drvdata (pdev);
> > > +
> > > +	netif_device_detach(dev);
> > > +	ne2k_pci_close(dev);
> > > +	ne2k_pci_reset_8390(dev);
> > > +	pci_set_power_state (pdev, state);
> > > +
> > > +	return 0;
> > > +}
> > > +static int ne2k_pci_resume (struct pci_dev *pdev)
> > > +{
> > > +	struct net_device *dev = pci_get_drvdata (pdev);
> > > +
> > > +	pci_set_power_state(pdev, 0);
> > > +	ne2k_pci_reset_8390(dev);
> > > +	ne2k_pci_open(dev);
> > > +	netif_device_attach(dev);
> > > +
> > > +	return 0;
> > > +}
> > > +
> > > +#endif /* CONFIG_PM */
> > > +
> > >  
> > >  static struct pci_driver ne2k_driver = {
> > >  	.name		= DRV_NAME,
> > >  	.probe		= ne2k_pci_init_one,
> > >  	.remove		= __devexit_p(ne2k_pci_remove_one),
> > >  	.id_table	= ne2k_pci_tbl,
> > > +#ifdef CONFIG_PM
> > > +	.suspend	= ne2k_pci_suspend,
> > > +	.resume		= ne2k_pci_resume,
> > > +#endif /* CONFIG_PM */
> > > +
> > >  };
> > >  
> > >  
> > 
> > -- 
> > People were complaining that M$ turns users into beta-testers...
> > ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
> 



		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

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

* PATCH swsuspend for ne2k-pci cards
       [not found]                   ` <20040807140845.GA8353@lps.ens.fr>
@ 2004-08-21 12:14                     ` Éric Brunet
  2004-08-23 19:51                       ` Pavel Machek
  2004-09-01 14:56                       ` PATCH (RESENT) " Éric Brunet
  0 siblings, 2 replies; 15+ messages in thread
From: Éric Brunet @ 2004-08-21 12:14 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: arekm, linux-kernel

Hi,

Arkadiusz Miskiewicz had some suggestions to improve my patch which
adds suspend/resume support to ne2k-pci.c. Actually, he basically rewrote
it.

This patch was only tested on my own ne2k clone [Realtek Semiconductor
Co., Ltd. RTL-8029(AS)], and it works nicely for me. As 1) it cannot hurt
people which are not using swsuspend 2) it can only improve things for
people using swsuspend, it would be nice if this patch could go into the
kernel.

Thank you,

	Éric Brunet

--- linux-old/drivers/net/ne2k-pci.c	2004-08-07 15:54:24.000000000 +0200
+++ linux-2.6.8-rc1/drivers/net/ne2k-pci.c	2004-08-21 12:24:27.000000000 +0200
@@ -653,12 +653,43 @@
 	pci_set_drvdata(pdev, NULL);
 }
 
+#ifdef CONFIG_PM
+static int ne2k_pci_suspend (struct pci_dev *pdev, u32 state)
+{
+	struct net_device *dev = pci_get_drvdata (pdev);
+
+	netif_device_detach(dev);
+	pci_save_state(pdev, pdev->saved_config_space);
+	pci_set_power_state(pdev, state);
+
+	return 0;
+}
+
+static int ne2k_pci_resume (struct pci_dev *pdev)
+{
+	struct net_device *dev = pci_get_drvdata (pdev);
+
+	pci_set_power_state(pdev, 0);
+	pci_restore_state(pdev, pdev->saved_config_space);
+	NS8390_init(dev, 1);
+	netif_device_attach(dev);
+
+	return 0;
+}
+
+#endif /* CONFIG_PM */
+
 
 static struct pci_driver ne2k_driver = {
 	.name		= DRV_NAME,
 	.probe		= ne2k_pci_init_one,
 	.remove		= __devexit_p(ne2k_pci_remove_one),
 	.id_table	= ne2k_pci_tbl,
+#ifdef CONFIG_PM
+	.suspend	= ne2k_pci_suspend,
+	.resume		= ne2k_pci_resume,
+#endif /* CONFIG_PM */
+
 };
 
 

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

* Re: PATCH swsuspend for ne2k-pci cards
  2004-08-21 12:14                     ` PATCH swsuspend for ne2k-pci cards Éric Brunet
@ 2004-08-23 19:51                       ` Pavel Machek
  2004-09-01 14:56                       ` PATCH (RESENT) " Éric Brunet
  1 sibling, 0 replies; 15+ messages in thread
From: Pavel Machek @ 2004-08-23 19:51 UTC (permalink / raw)
  To: Brunet; +Cc: Paul Gortmaker, arekm, linux-kernel

Hi!

> Arkadiusz Miskiewicz had some suggestions to improve my patch which
> adds suspend/resume support to ne2k-pci.c. Actually, he basically rewrote
> it.
> 
> This patch was only tested on my own ne2k clone [Realtek Semiconductor
> Co., Ltd. RTL-8029(AS)], and it works nicely for me. As 1) it cannot hurt
> people which are not using swsuspend 2) it can only improve things for
> people using swsuspend, it would be nice if this patch could go into the
> kernel.

Patch looks good to me...

				Pavel


-- 
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms         


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

* PATCH (RESENT) swsuspend for ne2k-pci cards
  2004-08-21 12:14                     ` PATCH swsuspend for ne2k-pci cards Éric Brunet
  2004-08-23 19:51                       ` Pavel Machek
@ 2004-09-01 14:56                       ` Éric Brunet
  1 sibling, 0 replies; 15+ messages in thread
From: Éric Brunet @ 2004-09-01 14:56 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel

Hi,

This is a resent of my patch to add suspend/resume support to ne2k-pci
network adapters.

* The patch was tested on a RealTek ne2k clone and works nicely,
* It was reviewed and largely improved by Arkadiusz Miskiewicz
* It was approved of by Pavel Machek, the software suspend maintainer.

It would be nice if this patch could go into the kernel.

Thank you,

	Éric Brunet

--- linux-old/drivers/net/ne2k-pci.c	2004-08-07 15:54:24.000000000 +0200
+++ linux-2.6.8-rc1/drivers/net/ne2k-pci.c	2004-08-21 12:24:27.000000000 +0200
@@ -653,12 +653,43 @@
 	pci_set_drvdata(pdev, NULL);
 }
 
+#ifdef CONFIG_PM
+static int ne2k_pci_suspend (struct pci_dev *pdev, u32 state)
+{
+	struct net_device *dev = pci_get_drvdata (pdev);
+
+	netif_device_detach(dev);
+	pci_save_state(pdev, pdev->saved_config_space);
+	pci_set_power_state(pdev, state);
+
+	return 0;
+}
+
+static int ne2k_pci_resume (struct pci_dev *pdev)
+{
+	struct net_device *dev = pci_get_drvdata (pdev);
+
+	pci_set_power_state(pdev, 0);
+	pci_restore_state(pdev, pdev->saved_config_space);
+	NS8390_init(dev, 1);
+	netif_device_attach(dev);
+
+	return 0;
+}
+
+#endif /* CONFIG_PM */
+
 
 static struct pci_driver ne2k_driver = {
 	.name		= DRV_NAME,
 	.probe		= ne2k_pci_init_one,
 	.remove		= __devexit_p(ne2k_pci_remove_one),
 	.id_table	= ne2k_pci_tbl,
+#ifdef CONFIG_PM
+	.suspend	= ne2k_pci_suspend,
+	.resume		= ne2k_pci_resume,
+#endif /* CONFIG_PM */
+
 };
 
 

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

end of thread, other threads:[~2004-09-01 14:57 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20040715121042.GB9873@lps.ens.fr.suse.lists.linux.kernel>
2004-07-15 12:10 ` swsuspend not working Éric Brunet
2004-07-15 12:18   ` Pavel Machek
2004-07-15 13:23     ` Éric Brunet
2004-07-15 13:21       ` Nigel Cunningham
2004-07-19 19:19       ` Éric Brunet
2004-07-20 13:17         ` Pavel Machek
2004-07-20 15:50           ` Romano Giannetti
2004-07-31 18:20           ` Éric Brunet
2004-08-06 19:06             ` Pavel Machek
2004-08-06 23:54               ` Éric Brunet
2004-08-07  7:13                 ` Paul Gortmaker
     [not found]                   ` <20040807140845.GA8353@lps.ens.fr>
2004-08-21 12:14                     ` PATCH swsuspend for ne2k-pci cards Éric Brunet
2004-08-23 19:51                       ` Pavel Machek
2004-09-01 14:56                       ` PATCH (RESENT) " Éric Brunet
2004-07-15 12:47   ` swsuspend not working Stefan Seyfried

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