suspend on ThinkPad X31 hangs

Dan Pelleg daniel+bsd at pelleg.org
Fri Jun 13 13:47:38 PDT 2003


Dave Tweten writes:
 > daniel+bsd at pelleg.org said:
 > >I recently installed 4.8-RC on an IBM thinkpad X31. APM seems to work
 > >(reporting battery status), and hibernation to a special partition
 > >(created with the IBM tool) works. But suspend has problems resuming.
 > 
 > That's strange, since FreeBSD 4.8 doesn't know about hibernation.  It just 
 > thinks it's being put to sleep.  The BIOS knows to copy things to the 
 > hibernation partition and shut down after the OS has gone to sleep.
 > 
 > You didn't answer any of the following questions in your original message, 
 > so:
 > 
 > 1. Did you put
 > 
 > 	options		CPU_SUSP_HALT
 > 
 >    and
 > 
 > 	device		apm0
 > 
 >    into your custom kernel config?
 > 
 > 2. Did you put all of:
 > 
 > 	apm_enable="YES"
 > 	apmd_enable="YES"
 > 	apmd_flags="-f /usr/local/etc/apmd.conf"
 > 
 >    into /etc/rc.conf (changing the path name to the location of your
 >    customized apmd configuration file)?
 > 
 > 3. Did you customize apmd.conf to incorporate
 > 
 > 	apm_event SUSPENDREQ, USERSUSPENDREQ {
 > 	    exec "/usr/local/etc/rc.suspend";
 > 	}
 > 
 > 	apm_event NORMRESUME, CRITRESUME, STANDBYRESUME {
 > 	    exec "/usr/local/etc/rc.resume";
 > 	}
 > 
 >    or the rough equivalent, to invoke your customized suspend and
 >    resume scripts?
 > 
 > 4. Does your customized suspend script do
 > 
 > 	sync && sync && sync
 > 	sleep 3
 > 	zzz
 > 
 >    to make sure all outstanding disk I/O is complete before you
 >    actually suspend?
 > 
 > 5. Are you running any detachable devices (PCCard or USB) when you
 >    suspend?  If so, you may want to detach them in rc.suspend and
 >    re-attach them in rc.resume.
 > 
 > You said you've already created a hibernation slice.  If you've done all 
 > these things, and if your X31 works at all like my T23, suspend and 
 > hibernate should work well, except for the need to switch to a virtual 
 > console and back to X when you wake up from hibernation.

Thank you for the reply. I have CPU_SUSP_HALT and apm0. apmd_flags is not
set in my rc.conf. But it seems that syncing is taken care of in
/etc/rc.suspend. I tried this with and without detachable devices, and with
and without X running. No luck.

This is strange. My X23 suspends and resumes fine (I don't have an
hibernation partition on it).

Here is a more detailed description of the failure (from booting with -v):

At resume, it shows:

ata0: resetting devices .. ata0: mask=03 ostat0=50 ostat2=00
ad0: ATAPI 00 00
ata0-slave: ATAPI 00 00
ata0: mask=03 stat0=50 stat1=00
ad0: ATA 01 a5
ata0: devices=01
ad0: success setting WDMA2 on generic chip
done
ata1: resetting devices .. ata1: mask=03 ostat0=00 ostat2=00
ata1-master: ATAPI 00 00
ata1-slave: ATAPI 00 00
ata1: mask=o3 stat0=00 stat1=00
ata1: devices=00
done

about a second later is shows:
ad0: WRITE command timeout tag=0 serv=0 - resetting
ata0: resetting devices ..

and then locks

sometimes it will instead show this before locking::
ad0: READ command timeout tag=0 serv=0 - restting
ata0: resetting devices ..



More information about the freebsd-mobile mailing list