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>
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