no suspend available on powerpc (iBook G4, PMU)

Bug #189851 reported by fuoco
10
Affects Status Importance Assigned to Milestone
pm-utils (Debian)
Fix Released
Unknown
pm-utils (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: pm-utils

Since upgrading to hardy, gnome-power-manager doesn't offer the option to suspend the machine any more. So far it seems to me that the recent move to pm-utils is related to this.
the command 'pm-is-suspend' indeed claims suspend is not supported on the machine - but that must be wrong, as it was supported for a long time. Manually using the hal pmu helper i could suspend but not resume (probably vt switch problem). I will look more into it, but I don't know much about this whole pm-utils system.

Related branches

Revision history for this message
fuoco (fuoco2-deactivatedaccount) wrote :

I can now confirm the following:

$ sudo chvt 2 ; sudo /usr/lib/hal/hal-system-power-pmu sleep ; sudo chvt 7

that command works perfectly - suspend and resumes, and everything seems to work perfectly.
On the other hand, with pm-utils - which I understand is the way currently used:

$ sudo chvt 2 ; sudo pm-suspend ; sudo chvt 7

this will give me: Error: kernel cannot suspend to ram.
Now since with the first command all works fine, obviously the kernel does support suspend, so the faulty part must be some interface between pm-utils and PMU on powerpc.

Please notice that the vt switching is necessary on this machine (radeon open source, r300) - otherwise suspend works but resume fails. In gutsy that was a problem that wasn't yet fixed, see bug: https://bugs.launchpad.net/ubuntu/+bug/144305

Revision history for this message
sam tygier (samtygier) wrote :

confirmed on a powerbook3,5 (ti G4 1Ghz 15inch).

sudo /usr/lib/hal/hal-system-power-pmu sleep works fine. also when the battery reaches zero suspend is initiated.

Changed in pm-utils:
status: New → Confirmed
Revision history for this message
fuoco (fuoco2-deactivatedaccount) wrote :

I think the following is related to this and might have interesting stuff for us:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=452367

Changed in pm-utils:
status: Unknown → New
Revision history for this message
sam tygier (samtygier) wrote :

thanks fuoco.
i had a look through that report.

the first thing is
"All quirks are in the uswsusp package. If you install it you'll have
a binary s2ram, that will use some iotcl to suspend the machine."
the report talks about uswsusp not being available on powerpc debian, but it has always been avaliable on powerpc ubuntu :-)

how ever the ubuntu version does not contain s2ram. version 0.6~cvs20070618-1ubuntu2 removed s2ram from the package.
it is faily easy to revert this change. just undo the changes to suspend-cvs20070618/Makefile that are dont by the patch http://patches.ubuntu.com/u/uswsusp/uswsusp_0.6~cvs20070618-1ubuntu2.patch

now rebuild, and install and you have a working s2ram command.

sudo s2ram, suspends my powerbook

next task is to fix pm-is-supported to know that we can suspend
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=452367#88 suggests changing src/pm-is-supported in pm-utils

case "$ARG" in
   suspend)
- grep -q mem /sys/power/state || exit 1
+ grep -q mem /sys/power/state ||
+ [ -c /dev/pmu -a -x /usr/sbin/s2ram ] || exit 1
   ;;
 hibernate)
  grep -q disk /sys/power/state || exit 1

this needs slight modification on ubuntu, as s2ram is in /sbin instead of /usr/sbin

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=452367#93 suggests that using "s2ram --test" as a better test.

so with those changes, the
pm-is-supported --suspend && echo "yup!"
test passes

however
sudo pm-suspend
only blanks the screen for a second :-(

Revision history for this message
sam tygier (samtygier) wrote :

pm-suspend fails because /usr/lib/pm-utils/functions checks for /usr/sbin/s2ram instead of /sbin/s2ram

this file is in pm-utils pm/functions

fixing this makes
sudo pm-suspend
work :-)

gnome's supsend function does not work though. it switch to a virtual terminal, then back to X and a unlock screen. :-(

Revision history for this message
fuoco (fuoco2-deactivatedaccount) wrote :

thanks sam. I haven't tried it yet, but one thing i don't understand is why do we need s2ram when we already have hal-system-power-pmu? i would have thought it's better to stick with what's part of hal...
second question i have is in this whole system how does one get stuff run/stopped when suspending or resuming? specifically i'm interested in resetting correct hdparm apm settings for harddisk, so to avoid the known spin down problem in ubuntu.

Revision history for this message
sam tygier (samtygier) wrote :

i think we need some input from someone who understands why the changes were made in ubuntu, and why ubuntu deviates from debian.

Revision history for this message
fuoco (fuoco2-deactivatedaccount) wrote :

Any news about this? what should we do now? looks like debian is on top of it, but in ubuntu there might be no specific policy how to deal with power management on powerpc?

Revision history for this message
fuoco (fuoco2-deactivatedaccount) wrote :

I'm bumping again. Would like to know how we can fix this. uswsusp in ubuntu has removed s2ram because it's 'not sensible in ubuntu'. A move that by itself seems insensible to me, if this is the missing tool that causes suspend to be broken on these machines.

Revision history for this message
Matthew Garrett (mjg59) wrote :

It's not the reason suspend is broken on these machines.

Revision history for this message
Matthew Garrett (mjg59) wrote :

This should fix it.

Revision history for this message
fuoco (fuoco2-deactivatedaccount) wrote :

Thanks, this patch indeed makes gnome-power-manager able to suspend. But when I suspend through it, the screen goes black, and everything in fact looks like it's going to suspend but the actual suspend to ram doesn't occur. Once I move the mouse or something it comes back as if from screensaver or blank screen to a unlock desktop window.

Revision history for this message
fuoco (fuoco2-deactivatedaccount) wrote :

Oy, I lost track... We're actually in the same situation we were in before. It's going to VT but the lack of s2ram or hal pmu helper thingie causes it not to actually suspend. So the way I see it the problem is now that the hal helper is still available and works, but no longer used, and the s2ram that is supposedly what should be used is not available.

Martin Pitt (pitti)
Changed in pm-utils:
assignee: nobody → pitti
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pm-utils - 0.99.2-3ubuntu6

---------------
pm-utils (0.99.2-3ubuntu6) hardy; urgency=low

  * Add debian/patches/97_fix_ppc_suspend_test.patch: Fix suspend test on
    PowerPC, thanks to Matthew Garrett (see patch header for details).
  * debian/patches/70-remove-pm-pmu.patch: Change the patch to not entirely
    drop pm-pmu, but use hal-system-power-pmu instead. This brings back
    suspend to PowerPC. (LP: #189851)
  * Add debian/patches/98-unload_network_modules.patch: Unload/reload network
    modules during suspend. Thanks to Matthew Garrett! (LP: #162654)

 -- Martin Pitt <email address hidden> Thu, 27 Mar 2008 16:26:43 +0100

Changed in pm-utils:
status: Fix Committed → Fix Released
Revision history for this message
sam tygier (samtygier) wrote :

thanks for the fixes.

Revision history for this message
miguel.filipe (miguel-filipe) wrote :

Hi there,

I'm using ubuntu hardy heron development on a ibook G3 (not a G4), and have pm-utils0.99.2-3ubuntu8 installed.
I'm still unable to do suspend on this laptop (this allways worked, ever since 2.4 kernels ..)
on trying to suspend with:
sudo pm-suspend, it fails, leaving in dmesg the message: "Sleep mode not supported on this machine"

pm-is-suppored --suspend seems to return 0:
miguel@newton ~ $ sudo pm-is-supported --suspend
miguel@newton ~ $ echo $?
0
miguel@newton ~ $ pm-is-supported --suspend
miguel@newton ~ $ echo $?
0

meaning it's not supported ?

I'm not shure what's impeding this machine from entering sleep mode.

Revision history for this message
miguel.filipe (miguel-filipe) wrote :

I think this is usefull information:

miguel@newton /boot $ sudo /usr/lib/hal/hal-system-power-pmu sleep
power-pmu : PMU_IOC_SLEEP failed

stracing this gives:

open("/dev/pmu", O_RDWR|O_LARGEFILE) = 3
ioctl(3, PMU_IOC_SLEEP, 0) = -1 ENOSYS (Function not implemented)
close(3) = 0
write(2, "power-pmu : PMU_IOC_SLEEP failed"..., 33power-pmu : PMU_IOC_SLEEP failed

Revision history for this message
Martin Pitt (pitti) wrote :

Reopening then. Unassigning, I do not have a PowerPC to try this on.

Changed in pm-utils:
assignee: pitti → nobody
status: Fix Released → Confirmed
Changed in pm-utils:
status: New → Fix Released
Revision history for this message
Boaz Haberman (bhaberman) wrote :

Sleep was not working on my machine. After a long process involving lots of pulling out hair and installing gentoo, I figured out that the problem was the video=ofonly that I had added to the boot options when installing. Editing yaboot.conf, removing the offending option, and running ybin fixed the problem completely (!) Now everything works perfectly, even networking, video, trackpad, etc. coming back from sleep. Suggest that this option not be included by default, even if it is used to install.

Revision history for this message
Boaz Haberman (bhaberman) wrote :

By the way I am using an ibook g4 12",
processor : 0
cpu : 7447A, altivec supported
clock : 1333.333000MHz
revision : 0.2 (pvr 8003 0102)
bogomips : 73.47
timebase : 18432000
platform : PowerMac
machine : PowerBook6,7
motherboard : PowerBook6,7 MacRISC3 Power Macintosh
detected as : 287 (iBook G4)
pmac flags : 0000001b
L2 cache : 512K unified
pmac-generation : NewWorld

Revision history for this message
Lou Ruppert (louferd) wrote :

It sounds like this problem is solved. Can we close this?

Revision history for this message
Bryce Harrington (bryce) wrote :

Alright

Changed in pm-utils (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.