Skip to contentSkip to conversation

iBook G3 owners

DISCUSSION Benjamin Herrenschmidt 3 participants 11 messages Apr 4, 2005 – Apr 10, 2005 PowerPC

lore
Share & tools
lore
#0 lore raw

Hi !

There have been various reports of issues with sleep among others on iBook G3 equiped with the 750FX processor. Also, the cpufreq code on these so far didn't change the CPU voltage, which limited the actual power saving at low frequency.

I have uploaded various patches that should help fix these issues. Those patches are all against current linus bk and they should be all applied in the order below.

I would really appreciate some tests as I don't have access to any of these machines. I need to know if cpufreq works reliably with those patches and if the new voltage control makes any differnece on battery life (check power consumption in /proc/pmu/battery_*/current when running on battery) and I need to know if the patches are improving reliability of sleep/wakeup.

The 4 patches can be found at these URLs. If you had earlier versions of some of these, those patches replace them:

http://gate.crahsing.org/~benh/ppc32-750-errata-fix.diff
http://gate.crahsing.org/~benh/ppc32-pmac-sleep-fix.diff
http://gate.crahsing.org/~benh/cpufreq-add-suspend.diff
http://gate.crahsing.org/~benh/ppc32-cpufreq-gpio-off.diff

Please, let me know asap,

Ben.

#1 lore raw
#2 lore raw
Quoted 1 line · Benjamin Herrenschmidt

http://gate.crashing.org/~benh/ppc32-pmac-sleep-fix.diff

This patch does not work on the 750fx, I'm getting random crashes on wakeup. When I replace it with this one-liner, all is well again:

arch/ppc/platforms/pmac_cache.S +1 -1
@@ -73,7 +73,7 @@
 
 	/* disable / invalidate / enable L1 data */
 	mfspr	r3,SPRN_HID0
-	rlwinm	r0,r0,0,~HID0_DCE
+	rlwinm	r3,r3,0,~(HID0_DCE | HID0_ICE)
 	mtspr	SPRN_HID0,r3
 	sync
 	isync

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#3 lore raw
Quoted 6 lines · Andreas Schwab
Quoted 1 line · Benjamin Herrenschmidt

http://gate.crashing.org/~benh/ppc32-pmac-sleep-fix.diff

This patch does not work on the 750fx, I'm getting random crashes on wakeup. When I replace it with this one-liner, all is well again:

I know, but this oneliner is incorrect. It can't be correct, no way. That is very strange, and that's what I'm trying to figure out. Can you try instead changing the start address of the flush from 0xfff00000 to 0 by changing the L1 flush bit initalisation from lis r4,0xfff0 to li r4,0 ?

Ben.

#4 lore raw
Quoted 5 lines · Benjamin Herrenschmidt

I know, but this oneliner is incorrect. It can't be correct, no way. That is very strange, and that's what I'm trying to figure out. Can you try instead changing the start address of the flush from 0xfff00000 to 0 by changing the L1 flush bit initalisation from lis r4,0xfff0 to li r4,0 ?

This fixes the problem.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#5 lore raw
Quoted 9 lines · Andreas Schwab
Quoted 5 lines · Benjamin Herrenschmidt

I know, but this oneliner is incorrect. It can't be correct, no way. That is very strange, and that's what I'm trying to figure out. Can you try instead changing the start address of the flush from 0xfff00000 to 0 by changing the L1 flush bit initalisation from lis r4,0xfff0 to li r4,0 ?

This fixes the problem.

Ok, I still don't have anything like a good explanation of why this fixes it, but it's a better workaround for now.

Ben.

#6 lore raw
In reply to Benjamin Herrenschmidt
Quoted 4 lines · Benjamin Herrenschmidt

There have been various reports of issues with sleep among others on iBook G3 equiped with the 750FX processor. Also, the cpufreq code on these so far didn't change the CPU voltage, which limited the actual power saving at low frequency.

Sleep hasn't worked properly on my PowerBook G4 since I applied your first pair of patches. The current behaviour seems to be that short periods of sleep appear to work OK, but a fairly random death happens after a longer sleep. Last time it was ohci_hcd complaining of an uninitialised spinlock.

I'm half inclined to suspect RAM isn't being refreshed properly -- but most of the kernel text still seems to be there and it manages to oops and panic OK, so perhaps it's just that the dcache isn't correctly disabled, or isn't correctly flushed when we enable it again?

I'll rebuild the Fedora kernel without any of the patches to eliminate the possibility that it's caused by some other change.

Signature · 1 line
dwmw2
#7 lore raw
Quoted 12 lines · David Woodhouse
Quoted 4 lines · Benjamin Herrenschmidt

There have been various reports of issues with sleep among others on iBook G3 equiped with the 750FX processor. Also, the cpufreq code on these so far didn't change the CPU voltage, which limited the actual power saving at low frequency.

Sleep hasn't worked properly on my PowerBook G4 since I applied your first pair of patches. The current behaviour seems to be that short periods of sleep appear to work OK, but a fairly random death happens after a longer sleep. Last time it was ohci_hcd complaining of an uninitialised spinlock.

Quoted 4 lines

I'm half inclined to suspect RAM isn't being refreshed properly -- but most of the kernel text still seems to be there and it manages to oops and panic OK, so perhaps it's just that the dcache isn't correctly disabled, or isn't correctly flushed when we enable it again?

That kind of sleep is usually related to cache flush issues ... the setup of RAM auto refresh isn't under kernel code control, it's entirely done by the chipset when entering sleep state.

What is strange however is that none of these 2 patches have _any_ effect on your machine model. Can you confirm that's indeed the patches you were talking about ?

ppc32-750-errata-fix.diff
ppc32-pmac-sleep-fix.diff

Quoted 2 lines

I'll rebuild the Fedora kernel without any of the patches to eliminate the possibility that it's caused by some other change.

Make sure you have the 2 cpufreq related patches though, there are issues with CPU voltage possibly not correct on wakeup that can cause similar problems.

Ben.

#8 lore raw
Quoted 3 lines · Benjamin Herrenschmidt

Make sure you have the 2 cpufreq related patches though, there are issues with CPU voltage possibly not correct on wakeup that can cause similar problems.

It was those I originally applied after cpufreq stopped working. Sleep hasn't worked reliably since then. I've built a kernel without any of the four patches, and if that works I'll test some more to work out precisely which one makes the difference.

Signature · 1 line
dwmw2
#9 lore raw
Quoted 9 lines · David Woodhouse
Quoted 3 lines · Benjamin Herrenschmidt

Make sure you have the 2 cpufreq related patches though, there are issues with CPU voltage possibly not correct on wakeup that can cause similar problems.

It was those I originally applied after cpufreq stopped working. Sleep hasn't worked reliably since then. I've built a kernel without any of the four patches, and if that works I'll test some more to work out precisely which one makes the difference.

Can you check that you have the very latest versions of these patches ? I updated them a couple of time since I posted the message...

Ben.

#10 lore raw
Quoted 3 lines · Benjamin Herrenschmidt

Can you check that you have the very latest versions of these patches ?
I updated them a couple of time since I posted the message...

The md5sums of the patches I have precisely match the md5sums of the patches which are currently up for download:

fc63b0d57d26f2dec44d0ba1667eb263  linux-2.6.11-ppc32-pmac-sleep-fix.patch
29792fdd1970b9447d06a2bb044e48e0  linux-2.6.11-cpufreq-add-suspend.patch
dcdb468b9325c1835e9992034b7d8a28  linux-2.6.11-ppc32-750-erratum-fix.patch
689353b33f3bdc7759692a4cccdb24fa  linux-2.6.11-ppc32-cpufreq-gpio-off.patch

A kernel without _any_ of these patches survived an overnight sleep, and in fact cpufreq was working again too. I'll try with just the cpufreq patches.

Signature · 1 line
dwmw2