diff options
author | Borislav Petkov <petkovbb@gmail.com> | 2009-01-06 17:20:57 +0100 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-01-06 17:20:57 +0100 |
commit | 7a38f3cf019c4187d3d0e757e1c11b2b460e5b57 (patch) | |
tree | 1b0b815c1daa9e4a1de6b839d09e8eafa755f165 /drivers/ide/ide-cd.c | |
parent | 744a82b004b0a08d55f579daa55e32d963353edc (diff) |
ide-cd: wait for DRQ to get set per default
... instead of assuming it is set for accelerated DRQ type devices.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r-- | drivers/ide/ide-cd.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 6c7dd8fd8638..1c1ba43c263c 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -572,24 +572,17 @@ static ide_startstop_t cdrom_transfer_packet_command(ide_drive_t *drive) ide_debug_log(IDE_DBG_PC, "Call %s\n", __func__); - if (drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT) { - /* - * Here we should have been called after receiving an interrupt - * from the device. DRQ should how be set. - */ - - /* check for errors */ - if (cdrom_decode_status(drive, ATA_DRQ, NULL)) - return ide_stopped; + /* we must wait for DRQ to get set */ + if (ide_wait_stat(&startstop, drive, ATA_DRQ, ATA_BUSY, WAIT_READY)) { + printk(KERN_ERR "%s: timeout while waiting for DRQ to assert\n", + drive->name); + return startstop; + } + if (drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT) { /* ok, next interrupt will be DMA interrupt */ if (drive->dma) drive->waiting_for_dma = 1; - } else { - /* otherwise, we must wait for DRQ to get set */ - if (ide_wait_stat(&startstop, drive, ATA_DRQ, - ATA_BUSY, WAIT_READY)) - return startstop; } /* arm the interrupt handler */ |