• Tejun Heo's avatar
    libata: improve SATA PHY speed down logic · 008a7896
    Tejun Heo authored
    sata_down_spd_limit() first reads the current SPD from SStatus and
    limit the speed to the lower one of one below the current limit or one
    below the current SPD in SStatus.  SPD may not be accessible or valid
    when SPD down is requested making sata_down_spd_limit() fail when it's
    most needed.
    
    This patch makes the current SPD cached after each successful reset
    and forces GEN I speed (1.5Gbps) if neither of SStatus or the cached
    value is valid, so sata_down_spd_limit() is now guaranteed to lower
    the speed limit if lower speed is available.
    Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
    Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
    008a7896
libata-eh.c 56.2 KB