diff options
author | Tejun Heo <htejun@gmail.com> | 2007-07-16 14:29:40 +0900 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-07-20 08:19:05 -0400 |
commit | 008a78961ec72990d09d7625ef9499d7317d040d (patch) | |
tree | aa356bbd961b7425017a3037fec509ffb761d332 /include/linux/libata.h | |
parent | badc2341579511a247f5993865aa68379e283c5c (diff) | |
download | linux-3.10-008a78961ec72990d09d7625ef9499d7317d040d.tar.gz linux-3.10-008a78961ec72990d09d7625ef9499d7317d040d.tar.bz2 linux-3.10-008a78961ec72990d09d7625ef9499d7317d040d.zip |
libata: improve SATA PHY speed down logic
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: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r-- | include/linux/libata.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index c732b3e78e2..16ebdf152c7 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -531,6 +531,7 @@ struct ata_port { unsigned int cbl; /* cable type; ATA_CBL_xxx */ unsigned int hw_sata_spd_limit; unsigned int sata_spd_limit; /* SATA PHY speed limit */ + unsigned int sata_spd; /* current SATA PHY speed */ /* record runtime error info, protected by host lock */ struct ata_eh_info eh_info; |