Skip to contentSkip to conversation

ata: fix the bug of signature updated

PATCH New Dave Liu 2 participants 2 messages Jun 3, 2008 – Jul 5, 2008 Block layer

lore
Share & tools
lore

Dave Liu

author
#0 lore raw

PATCH 1/1 ata: fix the bug of signature updated

The driver need wait for the device updating signature to host. if we don't wait for it, the driver can not detect the device(disk) when the system power up.

---
 drivers/block/fsl_sata.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/block/fsl_sata.c +8 -0
index d14f5bc..d441a30 100644
@@ -248,6 +248,10 @@ int init_sata(int dev)
 	else
 		printf("       %s ", sata->name);
 
+	/* Wait PHY RDY signal changed for 500ms */
+	ata_wait_register(&reg->hstatus, HSTATUS_PHY_RDY,
+			  HSTATUS_PHY_RDY, 500);
+
 	/* Check PHYRDY */
 	val32 = in_le32(&reg->hstatus);
 	if (val32 & HSTATUS_PHY_RDY) {
@@ -258,6 +262,10 @@ int init_sata(int dev)
 		return -1;
 	}
 
+	/* Wait for signature updated, which is 1st D2H */
+	ata_wait_register(&reg->hstatus, HSTATUS_SIGNATURE,
+			  HSTATUS_SIGNATURE, 10000);
+
 	if (val32 & HSTATUS_SIGNATURE) {
 		sig = in_le32(&reg->sig);
 		debug("Signature updated, the sig =%08x\n\r", sig);
Signature · 1 line
1.5.4
#1 lore raw

PATCH 1/1 ata: fix the bug of signature updated

Quoted 8 lines · In message <[email protected]> you wrote:

The driver need wait for the device updating signature to host. if we don't wait for it, the driver can not detect the device(disk) when the system power up.

---
 drivers/block/fsl_sata.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Nobody will ever need more than 640k RAM!"       -- Bill Gates, 1981
"Windows 95 needs at least 8 MB RAM."             -- Bill Gates, 1996
"Nobody will ever need Windows 95."             -- logical conclusion