Re: [PATCH] pata_sil680 suspend/resume

Guennadi Liakhovetski
2007-02-26T21:17:43Z

Alan,

I'm trying to suspend to RAM a KuroboxHG: powerpc MPC8241 based system
with a sil680

00:0c.0 IDE interface: Silicon Image, Inc. PCI0680 Ultra ATA-133 Host Controller (rev 02)

PATA controller, using pata_sil680. This is not a real str, i.e., power is
not switched off, just pull the whole system through suspend, and at the
end put the peripheral controller and the CPU core to sleep.

To suspend I just use a script like:

hdparm -Y /dev/sda
echo -n "mem" > /sys/power/state
hdparm -y /dev/sda

where the last hdparm is meant to wake up the drive (ok, it doesn't:-)),
tried without it too.

With an approximately 2.6.20 kernel I could suspend, but on resume I got

ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata1.00: tag 0 cmd 0xe0 Emask 0x4 stat 0x40 err 0x0 (timeout)
ata1: port is slow to respond, please be patient (Status 0xd0)
ata1: port failed to respond (30 secs, Status 0xd0)
ata1: soft resetting port
ata1.00: configured for UDMA/100
ata1: EH complete
SCSI device sda: 40020624 512-byte hdwr sectors (20491 MB)
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
SCSI device sda: drive cache: write back

but then it worked - congratulations to all authors on a robust error
handling! If I remove the "hdparm -y" I get a similar error on the first
access.

With a post 2.6.20 kernel from powerpc.git I cannot suspend at all:

pata_sil680 0000:00:0c.0: suspend
ata1: suspend failed, device 0 still active
pci_device_suspend(): ata_pci_device_suspend+0x0/0x74() returns -16
suspend_device(): pci_device_suspend+0x0/0xac() returns -16
Could not suspend device 0000:00:0c.0: error -16

Same without "hdparm -Y". Should I use sdparm instead? but
"sdparm --command stop /dev/sda" doesn't spin the disk down.

Looking at drivers/ata/libata-eh.c it looks like ata_eh_suspend() should
spin the disk down by itself and set the ATA_DFLAG_SUSPENDED flag, but it
doesn't seem to happen. Or is it only for SATA?

Thanks
Guennadi
---
Guennadi Liakhovetski