aboutsummaryrefslogtreecommitdiff
path: root/src/ata.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-03-19 11:41:09 +0100
committerKevin O'Connor <kevin@koconnor.net>2012-03-21 19:42:09 -0400
commit39d59895aa20caa9fa48b98b9a6e2b4d234a01c4 (patch)
treed1873ec75e49156555fdcf939a04eace9aa980ed /src/ata.c
parent8c313078917099a002d45f58d58ae2f4eb9a657f (diff)
downloadseabios-hppa-39d59895aa20caa9fa48b98b9a6e2b4d234a01c4.zip
seabios-hppa-39d59895aa20caa9fa48b98b9a6e2b4d234a01c4.tar.gz
seabios-hppa-39d59895aa20caa9fa48b98b9a6e2b4d234a01c4.tar.bz2
ata: send TEST UNIT READY correctly
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>
Diffstat (limited to 'src/ata.c')
-rw-r--r--src/ata.c14
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