From: Tejun Heo Date: Wed, 6 Jun 2007 07:35:55 +0000 (+0900) Subject: libata: fix hw_sata_spd_limit initialization X-Git-Tag: v2.6.22-rc5~52^2~10 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afe3cc51ba4be6b25b721c40f178ea4157751161;p=linux-2.6 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 Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index e7937166a8..bf8d3b8c17 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;