• Tejun Heo's avatar
    [PATCH] libata: implement PM EH actions · 02670bf3
    Tejun Heo authored
    Implement two PM per-dev EH actions - ATA_EH_SUSPEND and
    ATA_EH_RESUME.  Each action puts the target device into suspended mode
    and resumes from it respectively.
    
    Once a device is put to suspended mode, no EH operations other than
    RESUME is allowed on the device.  The device will stay suspended till
    it gets resumed and thus reset and revalidated.  To implement this, a
    new device state helper - ata_dev_ready() - is implemented and used in
    EH action implementations to make them operate only on attached &
    running devices.
    
    If all possible devices on a port are suspended, reset is skipped too.
    This prevents spurious events including hotplug events from disrupting
    suspended devices.
    Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
    Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
    02670bf3
libata-core.c 143 KB