Skip to contentSkip to conversation

Fix e100 suspend/resume w/ 2.6.10-rc1 and above (due to pci_save_state change)

PATCH Jeff Garzik 2 participants 4 messages Oct 28, 2004 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 28 lines · Andrew Morton

Begin forwarded message:

Date: Thu, 28 Oct 2004 17:34:19 +0800 (CST)
From: "Zhu, Yi" <[email protected]>
To: Andrew Morton <[email protected]>, Linux Kernel Mailing List <[email protected]>
Subject: [PATCH] Fix e100 suspend/resume w/ 2.6.10-rc1 and above (due to pci_save_state change)

Hi,

Recent 2.6.10-rc1 merged the pci_save_state change. This prevents some drivers from working with suspend/resume. The reason is the pci_save_state() called in driver's ->suspend doesn't take effect any more, since pci bus ->suspend will override it. And the two states might be different in some drivers, i.e. e100. I don't know if there are other drivers also suffer from it.

Thanks,
-yi

net/e100.c static int e100_suspend(struct pci_dev * · line 2311

Quoted 5 lines
net/e100.c renamed from tmp/e100.c +0 -2
@@ -2309,9 +2309,7 @@ static int e100_suspend(struct pci_dev *
 
-	pci_save_state(pdev);
 	pci_enable_wake(pdev, state, nic->flags & (wol_magic | e100_asf(nic)));
-	pci_disable_device(pdev);
 	pci_set_power_state(pdev, state);

I'm waiting for Greg to respond to the serious concerns raised by BenH[1] and me[2].

AFAICS, Greg has broken the standard Linux "driver knows it, driver does it" model.

Jeff

[1] http://marc.theaimsgroup.com/?l=linux-kernel&m=109867742404637&w=2
[2] http://marc.theaimsgroup.com/?l=linux-kernel&m=109868495426108&w=2

#2 lore raw
Quoted 42 lines · Jeff Garzik
Quoted 30 lines · Andrew Morton

Begin forwarded message:

Date: Thu, 28 Oct 2004 17:34:19 +0800 (CST)
From: "Zhu, Yi" <[email protected]>
To: Andrew Morton <[email protected]>, Linux Kernel Mailing List <[email protected]>
Subject: [PATCH] Fix e100 suspend/resume w/ 2.6.10-rc1 and above (due to pci_save_state change)

Hi,

Recent 2.6.10-rc1 merged the pci_save_state change. This prevents some drivers from working with suspend/resume. The reason is the pci_save_state() called in driver's ->suspend doesn't take effect any more, since pci bus ->suspend will override it. And the two states might be different in some drivers, i.e. e100. I don't know if there are other drivers also suffer from it.

Thanks,
-yi

net/e100.c static int e100_suspend(struct pci_dev * · line 2312

Quoted 6 lines
net/e100.c renamed from tmp/e100.c +0 -2
@@ -2309,9 +2309,7 @@ static int e100_suspend(struct pci_dev *
 
-	pci_save_state(pdev);
 	pci_enable_wake(pdev, state, nic->flags & (wol_magic | 
 	e100_asf(nic)));
-	pci_disable_device(pdev);
 	pci_set_power_state(pdev, state);

I'm waiting for Greg to respond to the serious concerns raised by BenH[1] and me[2].

Quoted 2 lines

AFAICS, Greg has broken the standard Linux "driver knows it, driver does it" model.

Huh? How did changing the pci_save_state() api change anything? I didn't change the pci core any, just made it easier to not have to specify the storage location of the memory to save everything off on.

Quoted 2 lines

[1] http://marc.theaimsgroup.com/?l=linux-kernel&m=109867742404637&w=2
[2] http://marc.theaimsgroup.com/?l=linux-kernel&m=109868495426108&w=2

I'm still on the road (all week long) and will try to get to the above messages soon...

thanks,

greg k-h

#3 lore raw
Quoted 3 lines · Greg KH

Huh? How did changing the pci_save_state() api change anything? I didn't change the pci core any, just made it easier to not have to specify the storage location of the memory to save everything off on.

That could have been accomplished by moving the saved-config data storage into struct pci_dev, but not changing pci_save_state() prototype...

Jeff

#4 lore raw
Quoted 7 lines · Jeff Garzik
Quoted 3 lines · Greg KH

Huh? How did changing the pci_save_state() api change anything? I didn't change the pci core any, just made it easier to not have to specify the storage location of the memory to save everything off on.

That could have been accomplished by moving the saved-config data storage into struct pci_dev

We did that a while ago.

Quoted 1 line

but not changing pci_save_state() prototype...

That was the last piece. It also fixed up some odd bugs when it was done.

Do we really want drivers to go back to have to declare the pci config space themselves if they want to? What does that buy us?

I agree that Ben's comments are valid, but the recent patch doesn't change anything that wasn't already being done.

thanks,

greg k-h