The ATAPI driver does not need to support writes, but it does needs to avoid the PIO transfer and DRQ check when TEST UNIT READY is sent. Since TEST UNIT READY has no payload, checking for not busy is enough.
This fixes a timeout when booting from CD/DVD, which fellaw@gmx.net reported to cause boot failures.
Signed-off-by: Paolo Bonzini pbonzini@redhat.com --- src/ata.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/ata.c b/src/ata.c index 76e4f20..c37691a 100644 --- a/src/ata.c +++ b/src/ata.c @@ -645,13 +645,15 @@ atapi_cmd_data(struct disk_op_s *op, void *cdbcmd, u16 blocksize) ret = -2; goto fail; } - if (!(status & ATA_CB_STAT_DRQ)) { - dprintf(6, "send_atapi_cmd : DRQ not set (status %02x)\n", status); - ret = -3; - goto fail; - } + if (blocksize) { + if (!(status & ATA_CB_STAT_DRQ)) { + dprintf(6, "send_atapi_cmd : DRQ not set (status %02x)\n", status); + ret = -3; + goto fail; + }
- ret = ata_pio_transfer(op, 0, blocksize); + ret = ata_pio_transfer(op, 0, blocksize); + }
fail: // Enable interrupts