Skip to contentSkip to conversation

Wakeup broken on iBook G3

DISCUSSION Andreas Schwab 2 participants 8 messages Mar 20, 2005 – Mar 22, 2005

lore
Share & tools
lore
#0 lore raw

Ever since the massive changes to the radeonfb pm code I've never been able to get a working wakeup on my iBook G3. The screen keeps blank after wakeup, I hear the cdrom drive being reset, and then the system crashes hard.

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."
#1 lore raw
Quoted 4 lines · Andreas Schwab

Ever since the massive changes to the radeonfb pm code I've never been able to get a working wakeup on my iBook G3. The screen keeps blank after wakeup, I hear the cdrom drive being reset, and then the system crashes hard.

What video chip is this ? And what CPU ? Are you sure it's the radeonfb patch ? There have been other changes to the system PM code approximately at the same time. The "massive" PM change didn't really change what was done to the vidoe chip on older models (mostly _added_ new code, totally separate, for new models). I suspect for example a problem with the cache flush code in pmac_cache.S on some G3 CPUs ...

There is also an old problem with AGP and sleep that is coming & going lately. Can you check if it works if you never go to X ? (That is boot in console mode, do not ever launch X, launching X and quitting X breaks the test I want you to do, then suspend/resume).

Ben.

#2 lore raw
Quoted 1 line · Benjamin Herrenschmidt

What video chip is this ?

Radeon Mobility M7 LY

Quoted 1 line

And what CPU ?

750FX

Quoted 1 line

Are you sure it's the radeonfb patch ?

It's hard to tell. I tried going back to the 2.6.10 radeon driver, but that doesn't have the necessary hooks to tell the PM code that it can sleep. If you can give a hint how to forward port that I can give it a try.

Quoted 2 lines

There is also an old problem with AGP and sleep that is coming & going lately. Can you check if it works if you never go to X ?

Did that, same 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."
#3 lore raw
Quoted 17 lines · Andreas Schwab
Quoted 1 line · Benjamin Herrenschmidt

What video chip is this ?

Radeon Mobility M7 LY

Quoted 1 line

And what CPU ?

750FX

Quoted 1 line

Are you sure it's the radeonfb patch ?

It's hard to tell. I tried going back to the 2.6.10 radeon driver, but that doesn't have the necessary hooks to tell the PM code that it can sleep. If you can give a hint how to forward port that I can give it a try.

Quoted 4 lines
Quoted 2 lines

There is also an old problem with AGP and sleep that is coming & going lately. Can you check if it works if you never go to X ?

Did that, same problem.

Can you try playing with pmac_sleep.S and pmac_cache.S, basically reverting those including the calls to set_L2CR in via-pmu.c ?

Ben.

#4 lore raw
Quoted 2 lines · Benjamin Herrenschmidt

Can you try playing with pmac_sleep.S and pmac_cache.S, basically reverting those including the calls to set_L2CR in via-pmu.c ?

That makes it even worse (it apparently crashes almost immediately after wakeup).

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 7 lines · Andreas Schwab
Quoted 2 lines · Benjamin Herrenschmidt

Can you try playing with pmac_sleep.S and pmac_cache.S, basically reverting those including the calls to set_L2CR in via-pmu.c ?

That makes it even worse (it apparently crashes almost immediately after wakeup).

Hrm... Ok...

At this point, I don't know for sure what's up, there have been several reports but nobody physically close to me has any of these machines for me to test with.

Have you tried with very latest bk which contains by workarounds for radeon erratas ? The M7 has smore bugs that might have been triggered by the moving of code around that I did in the latest readeonfb.

Also, in pmac_cache.S, try locating that bit:

	/* disp-flush L1 */
	li	r4,0x4000
	mtctr	r4
	lis	r4,0xfff0
1:	lwzx	r0,r0,r4
	addi	r4,r4,32
	bdnz	1b
	sync
	isync

And turn the li r4,0x4000 into lis r4,2 and let me know if that makes any difference... Same a little bit later, there is:

	lis	r4,2
	mtctr	r4
	lis	r4,0xfff0
1:	lwzx	r0,r0,r4
	addi	r4,r4,32
	bdnz	1b
	sync
	isync

Here, try turning the lis r4,2 into lis r4,0x20

And let me know if any of these help.

Finally, what happens if you boot without any framebuffer in the kernel (no fbdev at all, no fbcon, just no console), ssh into the box, and put it to sleep ? Does it wake up ?

Ben.

#6 lore raw
Quoted 3 lines · Benjamin Herrenschmidt

Have you tried with very latest bk which contains by workarounds for radeon erratas ? The M7 has smore bugs that might have been triggered by the moving of code around that I did in the latest readeonfb.

Correction: it's actually an M6.

Quoted 12 lines

Also, in pmac_cache.S, try locating that bit:

	/* disp-flush L1 */
	li	r4,0x4000
	mtctr	r4
	lis	r4,0xfff0
1:	lwzx	r0,r0,r4
	addi	r4,r4,32
	bdnz	1b
	sync
	isync
Quoted 2 lines

And turn the li r4,0x4000 into lis r4,2 and let me know if that makes any difference...

This did help.

Quoted 12 lines

Same a little bit later, there is:

	lis	r4,2
	mtctr	r4
	lis	r4,0xfff0
1:	lwzx	r0,r0,r4
	addi	r4,r4,32
	bdnz	1b
	sync
	isync
Quoted 1 line

Here, try turning the lis r4,2 into lis r4,0x20

This didn't, got crash in __flush_dcache_icache when called from update_mmu_cache. (I tested both changes separately.)

Quoted 3 lines

Finally, what happens if you boot without any framebuffer in the kernel (no fbdev at all, no fbcon, just no console), ssh into the box, and put it to sleep ?

I have no idea how to put it into sleep in this configuration. The pbbuttonsd says that sleep is not supported.

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."
#7 lore raw
Quoted 2 lines · Andreas Schwab

I have no idea how to put it into sleep in this configuration. The pbbuttonsd says that sleep is not supported.

You need "snooze" and do "snooze -f", but I think the L1 cache flush is the culprit, I'll try to find a solution.

Ben.