]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide-cd.c
ide-cd: add error message for DMA error to cdrom_read_intr()
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-cd.c
index d4b298eb5efe1688d6841219aa27a42dd65cb958..3b23826b7680d1eb3cf7b18c56d9aa5c16908075 100644 (file)
@@ -1112,8 +1112,11 @@ static ide_startstop_t cdrom_read_intr (ide_drive_t *drive)
         */
        if (dma) {
                info->dma = 0;
-               if ((dma_error = HWIF(drive)->ide_dma_end(drive)))
+               dma_error = HWIF(drive)->ide_dma_end(drive);
+               if (dma_error) {
+                       printk(KERN_ERR "%s: DMA read error\n", drive->name);
                        ide_dma_off(drive);
+               }
        }
 
        if (cdrom_decode_status(drive, 0, &stat))
@@ -1805,8 +1808,9 @@ static ide_startstop_t cdrom_write_intr(ide_drive_t *drive)
        /* Check for errors. */
        if (dma) {
                info->dma = 0;
-               if ((dma_error = HWIF(drive)->ide_dma_end(drive))) {
-                       printk(KERN_ERR "ide-cd: write dma error\n");
+               dma_error = HWIF(drive)->ide_dma_end(drive);
+               if (dma_error) {
+                       printk(KERN_ERR "%s: DMA write error\n", drive->name);
                        ide_dma_off(drive);
                }
        }
@@ -1826,7 +1830,7 @@ static ide_startstop_t cdrom_write_intr(ide_drive_t *drive)
        }
 
        /* Read the interrupt reason and the transfer length. */
-       ireason = HWIF(drive)->INB(IDE_IREASON_REG);
+       ireason = HWIF(drive)->INB(IDE_IREASON_REG) & 0x3;
        lowcyl  = HWIF(drive)->INB(IDE_BCOUNTL_REG);
        highcyl = HWIF(drive)->INB(IDE_BCOUNTH_REG);
 
@@ -1839,8 +1843,9 @@ static ide_startstop_t cdrom_write_intr(ide_drive_t *drive)
                 */
                uptodate = 1;
                if (rq->current_nr_sectors > 0) {
-                       printk(KERN_ERR "%s: write_intr: data underrun (%d blocks)\n",
-                       drive->name, rq->current_nr_sectors);
+                       printk(KERN_ERR "%s: %s: data underrun (%d blocks)\n",
+                                       drive->name, __FUNCTION__,
+                                       rq->current_nr_sectors);
                        uptodate = 0;
                }
                cdrom_end_request(drive, uptodate);
@@ -1860,7 +1865,8 @@ static ide_startstop_t cdrom_write_intr(ide_drive_t *drive)
                int this_transfer;
 
                if (!rq->current_nr_sectors) {
-                       printk(KERN_ERR "ide-cd: write_intr: oops\n");
+                       printk(KERN_ERR "%s: %s: confused, missing data\n",
+                                       drive->name, __FUNCTION__);
                        break;
                }