]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
rombios/ata: wait for BSY to clear after write
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Tue, 20 Jun 2017 15:13:02 +0000 (17:13 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Jun 2017 15:13:02 +0000 (17:13 +0200)
After rombios transfers the data for a write, it checks the status and
fails if BSY is set. qemu-trad doesn't set BSY for PIO writes, but QEMU
upstream does, and this causes rombios to fail writes because they are
marked as BSY. Instead, wait for BSY to clear after a write.

INT 13 writes are probably rarely used these days, but they are used by
GRUB 2 to write to its environment file which happens by default on
Ubuntu.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
tools/firmware/rombios/rombios.c

index 58ace9bc17f53894ae0dfd0a345dc65a1c381324..51558ee57a4c95a11845ea3dbea6aa78a838b3a6 100644 (file)
@@ -3226,7 +3226,7 @@ ASM_END
     current++;
     write_word(ebda_seg, &EbdaData->ata.trsfsectors,current);
     count--;
-    status = inb(iobase1 + ATA_CB_STAT);
+    status = await_ide(NOT_BSY, iobase1, IDE_TIMEOUT);
     if (count == 0) {
       if ( (status & (ATA_CB_STAT_BSY | ATA_CB_STAT_RDY | ATA_CB_STAT_DF | ATA_CB_STAT_DRQ | ATA_CB_STAT_ERR) )
           != ATA_CB_STAT_RDY ) {