• Tejun Heo's avatar
    [PATCH] libata: reimplement controller-wide PM · 500530f6
    Tejun Heo authored
    Reimplement controller-wide PM.  ata_host_set_suspend/resume() are
    defined to suspend and resume a host_set.  While suspended, EHs for
    all ports in the host_set are pegged using ATA_FLAG_SUSPENDED and
    frozen.
    
    Because SCSI device hotplug is done asynchronously against the rest of
    libata EH and the same mutex is used when adding new device, suspend
    cannot wait for hotplug to complete.  So, if SCSI device hotplug is in
    progress, suspend fails with -EBUSY.
    
    In most cases, host_set resume is followed by device resume.  As each
    resume operation requires a reset, a single host_set-wide resume
    operation may result in multiple resets.  To avoid this, resume waits
    upto 1 second giving PM to request resume for devices.
    Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
    Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
    500530f6
libata-eh.c 52.3 KB