[SOLVED] What causes endless lag of BUSY bit of ATA device?
Posted: Sat May 04, 2013 8:21 am
Does anybody have any idea what can cause endless lag of BUSY bit of ATA device?
This is how it looks like:
(Values are signed char, so real value of status register is 0x86)
This is my code:
The first version was without while loop. It simple checks if busy bit is set. If it is, it does the software reset. If BUSY bit doesn't clear, it is error. After occurence of this error I tried to put loop to wait until busy bit clears. Nothing changed, so it looks like busy bit is set for some time, then it's cleared and set again.
Does anybody know what can cause such problem?
This is how it looks like:
(Values are signed char, so real value of status register is 0x86)
This is my code:
Code: Select all
while((ata_readstatus(dev) & ATA_STATUS_BUSY) == ATA_STATUS_BUSY)
;
if((ata_readstatus(dev) & ATA_STATUS_BUSY) == ATA_STATUS_BUSY) {
ata_srst(dev);
}
if((ata_readstatus(dev) & ATA_STATUS_BUSY) == ATA_STATUS_BUSY) {
dbg_print("ATA device is busy");
dbg_descrval("STATUS: ", ata_readstatus(dev));
return 0;
}
Does anybody know what can cause such problem?