I had email communication with Tejun Heo, and here is the chain of thoughts: >> I am looking at a launchpad bug >> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/340014 >> >> What I am doing is: >> >> 1. suspend/resume with AC plugged in >> 2. suspend/resume with AC unplugged >> 3. suspend/resume with AC plugged in >> 4. suspend plugged in, remove AC power, resume >> 5. suspend with AC removed, plug in AC power, resume >> >> Usually after 3 (or 4) I get: >> >> ata1: link is slow to respond, please be patient (ready=0) >> ata1: SRST failed (errno=-16) >> ata1: soft resetting link >> >> ata1: reset failed, giving up >> ata1.00: disabled >> ata1: EH complete >> sd 0:0:0:0: [sda] Result: hostbyte=DID_BAD_TARGET >> driverbyte=DRIVER_OK,SUGGEST_OK >> end_request: I/O error, dev sda, sector 152855535 >> Aborting journal on device sda1. >> >> After some long hours of debugging I find that when the above happens >> the ata taskfile status register ap->ioaddr.status_addr is set to >> 0xd0. returned by function: ata_sff_check_status(), as a result, >> ata_eh_reset() fails. >> >> Any idea what might be going on? Any pointers to help me debug/fix >> this further is really appreciated. Looks like the device or HSM (likely the device) is locking up after some disturbance at the link. Link problem isn't too surprising after suspend/resume cycle or AC plug in/out. libata EH can handle those event just fine. The problem here seems to be... * The device needs hardreset to get back to operational state again. * Unfortunately, ICH7 currently can't access sata control registers in ata_piix mode, so it can only do softreset. From ICH8 on, hardreset works because SCRs are accessible via SIDPR. ICH7 has two mechanisms to access SCRs - via ABAR or SIRI/STRD. The former requires AHCI BAR to be mapped (which isn't true for most BIOSen) and SCRAE turned on. The SIRI/STRD pair provides windowed access into ABAR area which includes the SCRs but I've never got around to do it and I don't know how it would actually work. There's also another mechanism. Toggling port enable bits in PCS might generate hardreset. After the device is gone, if you unload and reload ata_piix, does the device come back? Thanks.