diff options
author | Tejun Heo <htejun@gmail.com> | 2007-06-06 16:35:55 +0900 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-06-09 22:40:28 -0400 |
commit | afe3cc51ba4be6b25b721c40f178ea4157751161 (patch) | |
tree | 8281e8feaaf3fd7f318d2b3d3fde62340ecbdbca /drivers/ata/libata-core.c | |
parent | ef143d577ba98c8a53aee9aa60e7d1f07c32fd7a (diff) | |
download | linux-afe3cc51ba4be6b25b721c40f178ea4157751161.tar.gz linux-afe3cc51ba4be6b25b721c40f178ea4157751161.tar.bz2 linux-afe3cc51ba4be6b25b721c40f178ea4157751161.zip |
libata: fix hw_sata_spd_limit initialization
hw_sata_spd_limit used to be incorrectly initialized to zero instead
of UINT_MAX if SPD is zero in SControl register. This breaks PHY
speed down. Fix it.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index e7937166a8ba..bf8d3b8c171d 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -6317,7 +6317,8 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) /* init sata_spd_limit to the current value */ if (sata_scr_read(ap, SCR_CONTROL, &scontrol) == 0) { int spd = (scontrol >> 4) & 0xf; - ap->hw_sata_spd_limit &= (1 << spd) - 1; + if (spd) + ap->hw_sata_spd_limit &= (1 << spd) - 1; } ap->sata_spd_limit = ap->hw_sata_spd_limit; |