Skip to contentSkip to conversation

fix for firewire patch added in 2.6.17.2 that breaks things on ppc

PATCH In review [email protected] 3 participants 7 messages Aug 7, 2006 – Aug 18, 2006 4 messages 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

PATCH 1/1 fix for firewire patch added in 2.6.17.2 that breaks things on ppc

Hello,
I sent this to Ben earlier but forgot to cc this list:

Quoted 4 lines

Sleep broke on my ibook G3 with 2.6.17. After some tests it seemed it only broke when I had used my iSight. Plugging it after a sleep/resume cycle would sometimes instantly hang the machine.

Quoted 8 lines

The problem appeared to result from a patch added in 2.6.17.2, where a pci_save_state(pdev);
is called after
pmac_call_feature(PMAC_FTR_1394_ENABLE, of_node, 0, 0);

resuming shows that the corresponding pci_restore_state is writing all ffffffff to the config space. Which is probably not a good idea.

Patch is attached

Danny

2.6.17.2 contained a patch for preliminary suspend/resume handling on !PPC_PMAC. However, this broke suspend and firewire on powerpc because it saves the state after the device has already been disabled.

Firewire works perfectly through suspend on my ibook, so save/restore state is not needed there.

drivers/ieee1394/ohci1394.c renamed from drivers/ieee1394/ohci1394.c~ +4 -5
@@ -3537,9 +3537,9 @@
 		if (of_node)
 			pmac_call_feature (PMAC_FTR_1394_ENABLE, of_node, 0, 1);
 	}
-#endif /* CONFIG_PPC_PMAC */
-
+#else
 	pci_restore_state(pdev);
+#endif /* CONFIG_PPC_PMAC */
 	pci_enable_device(pdev);
 
 	return 0;
@@ -3557,10 +3557,9 @@
 		if (of_node)
 			pmac_call_feature(PMAC_FTR_1394_ENABLE, of_node, 0, 0);
 	}
-#endif
-
+#else
 	pci_save_state(pdev);
-
+#endif /* CONFIG_PPC_PMAC */
 	return 0;
 }
 
#2 lore raw

drivers/ieee1394/ohci1394.c line 3562

Quoted 6 lines · [email protected] writes:
drivers/ieee1394/ohci1394.c renamed from drivers/ieee1394/ohci1394.c~ +2 -3
-#endif
-
+#else
 	pci_save_state(pdev);
-
+#endif /* CONFIG_PPC_PMAC */

Shouldn't we just move the pci_save_state call up before the pmac_call_feature() call?

Paul.

#3 lore raw
Quoted 12 lines · Paul Mackerras

drivers/ieee1394/ohci1394.c line 3562

Quoted 6 lines · [email protected] writes:
drivers/ieee1394/ohci1394.c renamed from drivers/ieee1394/ohci1394.c~ +2 -3
-#endif
-
+#else
 	pci_save_state(pdev);
-
+#endif /* CONFIG_PPC_PMAC */

Shouldn't we just move the pci_save_state call up before the pmac_call_feature() call?

I can do a rebuild tonight or so to test this. But since it was working perfectly before I did not see any reason to keep it.

Danny

#4 lore raw
In reply to Paul Mackerras
Quoted 12 lines · Paul Mackerras

drivers/ieee1394/ohci1394.c line 3562

Quoted 6 lines · [email protected] writes:
drivers/ieee1394/ohci1394.c renamed from drivers/ieee1394/ohci1394.c~ +2 -3
-#endif
-
+#else
 	pci_save_state(pdev);
-
+#endif /* CONFIG_PPC_PMAC */

Shouldn't we just move the pci_save_state call up before the pmac_call_feature() call?

Quoted 2 lines

Paul.

I tested this. It works, but it has no effect (pci_restore_state does not report that anything changed, thus this means that the config space already contained the correct values).

I discovered one additional problem with leaving a device running through a sleep/resume cycle:
suspend:
ohci1394: fw-host0: SelfID received outside of bus reset sequence
resume:
ohci1394: fw-host0: SelfID is inconsistent [0x7e80773f/0x7e80773f]
The last leads to the node not being able to resume when the device is actually plugged.

Anyway, it's a separate issue, I will investigate.

Danny

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

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

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

#8 lore raw

PATCH 1/1 fix for recently added firewire patch that breaks things on ppc

Recently a patch was added for preliminary suspend/resume handling on !PPC_PMAC. However, this broke both suspend and firewire on powerpc because it saves the pci state after the device has already been disabled.

This moves the save state to before the pmac specific code. Please apply before 2.6.18.

Signed-off-by Danny Tholen <obiwan at mailmij.org>
drivers/ieee1394/ohci1394.c 2006-08-09 09:02:53.546090923 -0400 renamed from drivers/ieee1394/ohci1394.c~ 2006-08-09 09:00:32.556422070 -0400 +2 -2
@@ -3548,6 +3548,8 @@
 
 static int ohci1394_pci_suspend (struct pci_dev *pdev, pm_message_t state)
 {
+	pci_save_state(pdev);
+
 #ifdef CONFIG_PPC_PMAC
 	if (machine_is(powermac)) {
 		struct device_node *of_node;
@@ -3559,8 +3561,6 @@
 	}
 #endif
 
-	pci_save_state(pdev);
-
 	return 0;
 } 
#9 lore raw

Re: [PATCH] fix for recently added firewire patch that breaks things on ppc

Quoted 9 lines · Danny Tholen

Recently a patch was added for preliminary suspend/resume handling on !PPC_PMAC. However, this broke both suspend and firewire on powerpc because it saves the pci state after the device has already been disabled.

This moves the save state to before the pmac specific code. Please apply before 2.6.18.

Signed-off-by Danny Tholen <obiwan at mailmij.org>

This fix should go into 2.6.17.x and 2.6.16.yy too. (I sent the patch with the regression also to Adrian recently.)

Quoted 20 lines
drivers/ieee1394/ohci1394.c 2006-08-09 09:02:53.546090923 -0400 renamed from drivers/ieee1394/ohci1394.c~ 2006-08-09 09:00:32.556422070 -0400 +2 -2
@@ -3548,6 +3548,8 @@
 
 static int ohci1394_pci_suspend (struct pci_dev *pdev, pm_message_t state)
 {
+	pci_save_state(pdev);
+
 #ifdef CONFIG_PPC_PMAC
 	if (machine_is(powermac)) {
 		struct device_node *of_node;
@@ -3559,8 +3561,6 @@
 	}
 #endif
 
-	pci_save_state(pdev);
-
 	return 0;
 } 
 
Signature · 3 lines
Stefan Richter
-=====-=-==- =--- =--=-
http://arcgraph.de/sr/
#10 lore raw

Re: [PATCH] fix for recently added firewire patch that breaks things on ppc

Quoted 6 lines · Stefan Richter
Quoted 5 lines · Danny Tholen

Recently a patch was added for preliminary suspend/resume handling on !PPC_PMAC. However, this broke both suspend and firewire on powerpc because it saves the pci state after the device has already been disabled.

Quoted 8 lines
Quoted 4 lines

This moves the save state to before the pmac specific code. Please apply before 2.6.18.

Signed-off-by Danny Tholen <obiwan at mailmij.org>

This fix should go into 2.6.17.x and 2.6.16.yy too. (I sent the patch with the regression also to Adrian recently.)

I'm sorry I should have mentioned that I already sent it to Greg KH.

Danny