[PATCH 1/5] ata: ahci: fix wrong link check

Sascha Hauer s.hauer at pengutronix.de
Fri Mar 8 05:35:47 EST 2013


The following commit accidently bailed out if the link is up, not
when it's down as stated in the commit message.

| commit a3f74d928ce73f37eab5b398e018aaeb42fd2ba4
| Author: Rob Herring <rob.herring at calxeda.com>
| Date:   Mon Feb 11 18:02:00 2013 +0100
|
|     ahci: handle COMINIT received during spin-up
|
|     Some Intel SSDs can send a COMINIT after the initial COMRESET. This causes
|     the link to go down and we need to re-initialize the link.
|
|     Signed-off-by: Rob Herring <rob.herring at calxeda.com>
|     Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
|     Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
|

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/ata/ahci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 4d5b52a..1712006 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -387,7 +387,7 @@ static int ahci_init_port(struct ahci_port *ahci_port)
 	ret = wait_on_timeout(WAIT_SPINUP,
 			((readl(port_mmio + PORT_TFDATA) &
 			 (ATA_STATUS_BUSY | ATA_STATUS_DRQ)) == 0)
-			|| !((readl(port_mmio + PORT_SCR_STAT) & 0xf) == 1));
+			|| ((readl(port_mmio + PORT_SCR_STAT) & 0xf) == 1));
 	if (ret) {
 		ahci_port_info(ahci_port, "timeout.\n");
 		ret = -ENODEV;
-- 
1.8.2.rc2




More information about the barebox mailing list