]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ide-cd: wait for DRQ to get set per default
authorBorislav Petkov <petkovbb@gmail.com>
Tue, 6 Jan 2009 16:20:57 +0000 (17:20 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 6 Jan 2009 16:20:57 +0000 (17:20 +0100)
... 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>
drivers/ide/ide-cd.c

index 6c7dd8fd86389d3779cc296dd3a12dd9d8d017fc..1c1ba43c263c155599415c835c76b669bcd7bb62 100644 (file)
@@ -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 */