mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Enable suspend/resuming of e1000
@ 2004-05-28 12:04 Alexander Gran
  2004-06-01 12:50 ` Pavel Machek
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Gran @ 2004-05-28 12:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton

[-- Attachment #1: Type: Text/Plain, Size: 701 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

suspending of the e1000 in my Thinkpad did not work, so I jst started some 
hacking. The attached patch does the trick for me, it just disables/enables 
the device. I used 2.6.7-rc1-mm1, but it should apply to rc1 also. If it's 
correct (Hey, I'm just beginning..), it could perhaps be 
applied to mainline / mm?

regards
Alex
- -- 
Encrypted Mails welcome.
PGP-Key at http://zodiac.dnsalias.org/misc/pgpkey.asc | Key-ID: 0x6D7DD291


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAtyq4/aHb+2190pERAmXwAKCTQ15yCP8KhcIE437od8v2IrqndwCeMW1w
BeOJRrYbRJHeu4NDdwXxrLE=
=qIVX
-----END PGP SIGNATURE-----

[-- Attachment #2: e1000-suspend-resume.patch --]
[-- Type: text/x-diff, Size: 542 bytes --]

--- linux-2.6.7-rc1-ag1/drivers/net/e1000/e1000_main.c	2004-05-26 23:25:40.000000000 +0200
+++ linux-2.6.7-rc1-mm1/drivers/net/e1000/e1000_main.c	2004-05-27 23:53:54.000000000 +0200
@@ -2864,6 +2864,8 @@
 		}
 	}
 
+	pci_disable_device(pdev);
+	
 	state = (state > 0) ? 3 : 0;
 	pci_set_power_state(pdev, state);
 
@@ -2874,6 +2876,8 @@
 static int
 e1000_resume(struct pci_dev *pdev)
 {
+        pci_enable_device(pdev);
+
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct e1000_adapter *adapter = netdev->priv;
 	uint32_t manc;

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

* Re: [PATCH] Enable suspend/resuming of e1000
  2004-05-28 12:04 [PATCH] Enable suspend/resuming of e1000 Alexander Gran
@ 2004-06-01 12:50 ` Pavel Machek
  2004-06-01 13:04   ` Alexander Gran
  0 siblings, 1 reply; 8+ messages in thread
From: Pavel Machek @ 2004-06-01 12:50 UTC (permalink / raw)
  To: Alexander Gran; +Cc: linux-kernel, Andrew Morton

Hi!

> suspending of the e1000 in my Thinkpad did not work, so I jst started some 
> hacking. The attached patch does the trick for me, it just disables/enables 
> the device. I used 2.6.7-rc1-mm1, but it should apply to rc1 also. If it's 
> correct (Hey, I'm just beginning..), it could perhaps be 
> applied to mainline / mm?

> --- linux-2.6.7-rc1-ag1/drivers/net/e1000/e1000_main.c	2004-05-26 23:25:40.000000000 +0200
> +++ linux-2.6.7-rc1-mm1/drivers/net/e1000/e1000_main.c	2004-05-27 23:53:54.000000000 +0200
> @@ -2864,6 +2864,8 @@
>  		}
>  	}
>  
> +	pci_disable_device(pdev);
> +	
>  	state = (state > 0) ? 3 : 0;
>  	pci_set_power_state(pdev, state);
>  
> @@ -2874,6 +2876,8 @@
>  static int
>  e1000_resume(struct pci_dev *pdev)
>  {
> +        pci_enable_device(pdev);
> +
>  	struct net_device *netdev = pci_get_drvdata(pdev);
>  	struct e1000_adapter *adapter = netdev->priv;
>  	uint32_t manc;

Whitespace damage here (tabs vs. spaces) plus you really should not
call procedure before variable declarations. Otherwise looks good.

								Pavel


-- 
934a471f20d6580d5aad759bf0d97ddc

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

* Re: [PATCH] Enable suspend/resuming of e1000
  2004-06-01 12:50 ` Pavel Machek
@ 2004-06-01 13:04   ` Alexander Gran
  2004-06-01 13:24     ` Pavel Machek
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Gran @ 2004-06-01 13:04 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-kernel, Andrew Morton

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Dienstag, 1. Juni 2004 14:50 schrieben Sie:
> Whitespace damage here (tabs vs. spaces) plus you really should not
> call procedure before variable declarations. Otherwise looks good.
>
> 								Pavel

Was my first patch to the kernel, sorry. However I still have trouble 
reenabling the card. It is recognized again (Withouth the driver thinks 
EEPROM is wrong).
tx is ok, but rx doesn't work. I suppose it's an interrupt problem, as the 
interrupt doesn't increase on rx. Will dig into it a bit further..

regards
Alex

- -- 
Encrypted Mails welcome.
PGP-Key at http://zodiac.dnsalias.org/misc/pgpkey.asc | Key-ID: 0x6D7DD291
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAvH7n/aHb+2190pERAhSLAJ92ZS1cvWwjjo6oLiVkldpiA5XqhQCeKJDV
lqooJHS8J8ntBjN4hCw3G+k=
=/9FQ
-----END PGP SIGNATURE-----

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

* Re: [PATCH] Enable suspend/resuming of e1000
  2004-06-01 13:04   ` Alexander Gran
@ 2004-06-01 13:24     ` Pavel Machek
  2004-06-01 13:41       ` Alexander Gran
  0 siblings, 1 reply; 8+ messages in thread
From: Pavel Machek @ 2004-06-01 13:24 UTC (permalink / raw)
  To: Alexander Gran; +Cc: linux-kernel, Andrew Morton

Hi!

> > Whitespace damage here (tabs vs. spaces) plus you really should not
> > call procedure before variable declarations. Otherwise looks good.
> >
> > 								Pavel
> 
> Was my first patch to the kernel, sorry. However I still have trouble 
> reenabling the card. It is recognized again (Withouth the driver thinks 
> EEPROM is wrong).
> tx is ok, but rx doesn't work. I suppose it's an interrupt problem, as the 
> interrupt doesn't increase on rx. Will dig into it a bit further..

Problem with interrupts? Look if /proc/interrupts increase when you
ping it. You may want to try "noapic".
									Pavel
-- 
934a471f20d6580d5aad759bf0d97ddc

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

* Re: [PATCH] Enable suspend/resuming of e1000
  2004-06-01 13:24     ` Pavel Machek
@ 2004-06-01 13:41       ` Alexander Gran
  2004-06-01 13:50         ` Pavel Machek
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Gran @ 2004-06-01 13:41 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-kernel, Andrew Morton

Am Dienstag, 1. Juni 2004 15:24 schrieben Sie:
> Problem with interrupts? Look if /proc/interrupts increase when you
> ping it. You may want to try "noapic".
> 									Pavel

it doesn't, apic is disabled, as my thinkpad does (did, have to recheck that 
with a more recent kernel, though) not work with apic enabled.

Alex

-- 
Encrypted Mails welcome.
PGP-Key at http://zodiac.dnsalias.org/misc/pgpkey.asc | Key-ID: 0x6D7DD291

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

* Re: [PATCH] Enable suspend/resuming of e1000
  2004-06-01 13:41       ` Alexander Gran
@ 2004-06-01 13:50         ` Pavel Machek
  2004-06-01 13:54           ` Alexander Gran
  0 siblings, 1 reply; 8+ messages in thread
From: Pavel Machek @ 2004-06-01 13:50 UTC (permalink / raw)
  To: Alexander Gran; +Cc: linux-kernel, Andrew Morton

Hi!

> > Problem with interrupts? Look if /proc/interrupts increase when you
> > ping it. You may want to try "noapic".
> > 									Pavel
> 
> it doesn't, apic is disabled, as my thinkpad does (did, have to recheck that 
> with a more recent kernel, though) not work with apic enabled.

What happens if you unload/reload module around suspend?

You may want to free_irq in suspend routine and request it back in
resume.

								Pavel

-- 
934a471f20d6580d5aad759bf0d97ddc

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

* Re: [PATCH] Enable suspend/resuming of e1000
  2004-06-01 13:50         ` Pavel Machek
@ 2004-06-01 13:54           ` Alexander Gran
  2004-06-01 16:03             ` Pavel Machek
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Gran @ 2004-06-01 13:54 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-kernel

Am Dienstag, 1. Juni 2004 15:50 schrieben Sie:
> What happens if you unload/reload module around suspend?

doesn't work. This was my first attempt. Seems that the pci_save_state, 
pci_disable device is really needed.

> You may want to free_irq in suspend routine and request it back in
> resume.

I also thought about that, however I tried to let e1000_suspend call 
e1000_down everytime, as that calls e1000_irq_disable and free_irq. Than call 
e1000_up in resume, as that does  request_irq e1000_irq_enable. 
This does not work, though. Still no irqs

Alex


-- 
Encrypted Mails welcome.
PGP-Key at http://zodiac.dnsalias.org/misc/pgpkey.asc | Key-ID: 0x6D7DD291

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

* Re: [PATCH] Enable suspend/resuming of e1000
  2004-06-01 13:54           ` Alexander Gran
@ 2004-06-01 16:03             ` Pavel Machek
  0 siblings, 0 replies; 8+ messages in thread
From: Pavel Machek @ 2004-06-01 16:03 UTC (permalink / raw)
  To: Alexander Gran; +Cc: linux-kernel

Hi!

> > What happens if you unload/reload module around suspend?
> 
> doesn't work. This was my first attempt. Seems that the pci_save_state, 
> pci_disable device is really needed.
> 
> > You may want to free_irq in suspend routine and request it back in
> > resume.
> 
> I also thought about that, however I tried to let e1000_suspend call 
> e1000_down everytime, as that calls e1000_irq_disable and free_irq. Than call 
> e1000_up in resume, as that does  request_irq e1000_irq_enable. 
> This does not work, though. Still no irqs

Try hooking it to timer interrupt and see if network then works at
least somehow.
								Pavel
-- 
Horseback riding is like software...
...vgf orggre jura vgf serr.

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

end of thread, other threads:[~2004-06-01 16:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-28 12:04 [PATCH] Enable suspend/resuming of e1000 Alexander Gran
2004-06-01 12:50 ` Pavel Machek
2004-06-01 13:04   ` Alexander Gran
2004-06-01 13:24     ` Pavel Machek
2004-06-01 13:41       ` Alexander Gran
2004-06-01 13:50         ` Pavel Machek
2004-06-01 13:54           ` Alexander Gran
2004-06-01 16:03             ` 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®