rombios/ata: Wait for BSY to clear after write
PATCH 1/1 rombios/ata: Wait for BSY to clear after write
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.
--- tools/firmware/rombios/rombios.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/firmware/rombios/rombios.c +1 -1
@@ -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 ) {
Signature · 7 lines
2.9.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 10 lines · Ross Lagerwall
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 <[email protected]>
Ian/Wei: RomBIOS should probably join hvmloader under x86 maintainership, if you don't object?
Quoted 9 lines
--- tools/firmware/rombios/rombios.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/firmware/rombios/rombios.c +0
-0
tools/firmware/rombios/rombios.c ASM_END · line 3232
Quoted 8 lines
tools/firmware/rombios/rombios.c +1
-1@@ -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 ) {
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 10 lines · Andrew Cooper
Quoted 9 lines · Ross Lagerwall
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.
Quoted 7 lines
Quoted 1 line
Signed-off-by Ross Lagerwall <[email protected]>Acked-by Andrew Cooper <[email protected]>Ian/Wei: RomBIOS should probably join hvmloader under x86 maintainership, if you don't object?
No I don't.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel