Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit afe3cc51 authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik
Browse files

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: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent ef143d57
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -6317,6 +6317,7 @@ 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;
			if (spd)
				ap->hw_sata_spd_limit &= (1 << spd) - 1;
		}
		ap->sata_spd_limit = ap->hw_sata_spd_limit;