Skip to contentSkip to conversation

libata: don't consider 0xff as port empty if SStatus is available

PATCH New Tejun Heo 1 participant 1 message May 23, 2007 libata

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 libata: don't consider 0xff as port empty if SStatus is available

Some SATA controllers (sata_sil) use 0xff to indicate port not ready status, not port empty. As libata interprets 0xff as port empty, this causes unnecessary reset failure and retry. Don't consider 0xff as port empty if SStatus is available and indicates that port is online.

Cc Paul Mundt <[email protected]>
Cc Indan Zupancic <[email protected]>

---

This one is for 2.6.22. Thanks.

 libata-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/libata-core.c +1 -1
index a6de57e..5788a9d 100644
@@ -3022,7 +3022,7 @@ int ata_wait_ready(struct ata_port *ap,
 
 		if (!(status & ATA_BUSY))
 			return 0;
-		if (status == 0xff)
+		if (!ata_port_online(ap) && status == 0xff)
 			return -ENODEV;
 		if (time_after(now, deadline))
 			return -EBUSY;