aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-06-06 03:35:55 -0400
committerJeff Garzik <jeff@garzik.org>2007-06-09 22:40:28 -0400
commitafe3cc51ba4be6b25b721c40f178ea4157751161 (patch)
tree8281e8feaaf3fd7f318d2b3d3fde62340ecbdbca /drivers/ata
parentef143d577ba98c8a53aee9aa60e7d1f07c32fd7a (diff)
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')
-rw-r--r--drivers/ata/libata-core.c3
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)
6317 /* init sata_spd_limit to the current value */ 6317 /* init sata_spd_limit to the current value */
6318 if (sata_scr_read(ap, SCR_CONTROL, &scontrol) == 0) { 6318 if (sata_scr_read(ap, SCR_CONTROL, &scontrol) == 0) {
6319 int spd = (scontrol >> 4) & 0xf; 6319 int spd = (scontrol >> 4) & 0xf;
6320 ap->hw_sata_spd_limit &= (1 << spd) - 1; 6320 if (spd)
6321 ap->hw_sata_spd_limit &= (1 << spd) - 1;
6321 } 6322 }
6322 ap->sata_spd_limit = ap->hw_sata_spd_limit; 6323 ap->sata_spd_limit = ap->hw_sata_spd_limit;
6323 6324