• Tejun Heo's avatar
    libata: fix last_reset timestamp handling · 19b72321
    Tejun Heo authored
    ehc->last_reset is used to ensure that resets are not issued too
    close to each other.  It's initialized to jiffies minus one minute
    on EH entry.  However, when new links are initialized after PMP is
    probed, new links have zero for this timestamp resulting in long wait
    depending on the current jiffies.
    
    This patch makes last_set considered iff ATA_EHI_DID_RESET is set, in
    which case last_reset is always initialized.  As an added precaution,
    WARN_ON() is added so that warning is printed if last_reset is
    in future.
    
    This problem is spotted and debugged by Shane Huang.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Cc: Shane Huang <Shane.Huang@amd.com>
    Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
    19b72321
libata-eh.c 86.3 KB