rpms/kernel/F-8 linux-2.6-libata-retry-enabling-ahci.patch, NONE, 1.1 kernel.spec, 1.474, 1.475

Chuck Ebbert (cebbert) fedora-extras-commits at redhat.com
Tue Jun 24 05:42:32 UTC 2008


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23925

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-libata-retry-enabling-ahci.patch 
Log Message:
* Mon Jun 23 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.25.8-35
- libata: retry enable of AHCI mode before reporting an error (F9#452595)


linux-2.6-libata-retry-enabling-ahci.patch:

--- NEW FILE linux-2.6-libata-retry-enabling-ahci.patch ---
From: Tejun Heo <htejun at gmail.com>
Date: Wed, 23 Apr 2008 11:52:58 +0000 (+0900)
Subject: ahci: retry enabling AHCI a few times before spitting out WARN_ON()
X-Git-Tag: v2.6.26-rc1~1060^2~15
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=15fe982e429e0e6b7466719acb6cfd9dbfe47f0c

ahci: retry enabling AHCI a few times before spitting out WARN_ON()

Some chips need AHCI_EN set more than once to actually set it.  Try a
few times before giving up and spitting out WARN_ON().

Signed-off-by: Tejun Heo <htejun at gmail.com>
Cc: Peer Chen <pchen at nvidia.com>
Cc: Volker Armin Hemmann <volker.armin.hemmann at tu-clausthal.de>
Signed-off-by: Jeff Garzik <jgarzik at redhat.com>
---

rhbz 452595

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 986e332..7c4f886 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -556,16 +556,27 @@ static inline void __iomem *ahci_port_base(struct ata_port *ap)
 
 static void ahci_enable_ahci(void __iomem *mmio)
 {
+	int i;
 	u32 tmp;
 
 	/* turn on AHCI_EN */
 	tmp = readl(mmio + HOST_CTL);
-	if (!(tmp & HOST_AHCI_EN)) {
+	if (tmp & HOST_AHCI_EN)
+		return;
+
+	/* Some controllers need AHCI_EN to be written multiple times.
+	 * Try a few times before giving up.
+	 */
+	for (i = 0; i < 5; i++) {
 		tmp |= HOST_AHCI_EN;
 		writel(tmp, mmio + HOST_CTL);
 		tmp = readl(mmio + HOST_CTL);	/* flush && sanity check */
-		WARN_ON(!(tmp & HOST_AHCI_EN));
+		if (tmp & HOST_AHCI_EN)
+			return;
+		msleep(10);
 	}
+
+	WARN_ON(1);
 }
 
 /**


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/kernel.spec,v
retrieving revision 1.474
retrieving revision 1.475
diff -u -r1.474 -r1.475
--- kernel.spec	23 Jun 2008 17:35:23 -0000	1.474
+++ kernel.spec	24 Jun 2008 05:41:45 -0000	1.475
@@ -643,6 +643,7 @@
 Patch674: linux-2.6-sata-eeepc-faster.patch
 Patch675: linux-2.6-libata-acpi-handle-bay-devices-in-dock-stations.patch
 Patch676: linux-2.6-libata-pata_atiixp-dont-disable.patch
+Patch677: linux-2.6-libata-retry-enabling-ahci.patch
 
 Patch680: linux-2.6-wireless.patch
 Patch681: linux-2.6-wireless-pending.patch
@@ -1155,6 +1156,8 @@
 ApplyPatch linux-2.6-libata-acpi-handle-bay-devices-in-dock-stations.patch
 # fix DMA disable on atiixp
 ApplyPatch linux-2.6-libata-pata_atiixp-dont-disable.patch
+# retry enabling AHCI mode before reporting error
+ApplyPatch linux-2.6-libata-retry-enabling-ahci.patch
 
 # wireless
 #
@@ -1820,6 +1823,9 @@
 
 
 %changelog
+* Mon Jun 23 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.25.8-35
+- libata: retry enable of AHCI mode before reporting an error (F9#452595)
+
 * Mon Jun 23 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.25.8-34
 - Linux 2.6.25.8
 - Patches reverted from 2.6.25.8, already in Fedora:




More information about the fedora-extras-commits mailing list