aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-15 15:21:51 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-15 15:21:51 -0400
commitc04bbc812b05b304a9118687d0e0a47e35f00d1d (patch)
tree62a76e3a893cbec2aeee1fc01fd716f9fdc64fbc
parente8e25f03e19c2c47834c821511625c0b80567827 (diff)
ide-scsi: fix handling of DMA errors in idescsi_pc_intr()
Check return value of ->dma_end method and if there was a DMA error handle it accordingly (set PC_FLAG_DMA_ERROR pc flag, don't update pc->xferred and increase rq->errors). Also move debug message in the right place while at it. Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/scsi/ide-scsi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index e67cf8aa9462..ed92cf7a7682 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -388,11 +388,13 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
388 return ide_stopped; 388 return ide_stopped;
389 } 389 }
390 if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) { 390 if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
391 if (hwif->dma_ops->dma_end(drive))
392 pc->flags |= PC_FLAG_DMA_ERROR;
393 else
394 pc->xferred = pc->req_xfer;
391#if IDESCSI_DEBUG_LOG 395#if IDESCSI_DEBUG_LOG
392 printk ("ide-scsi: %s: DMA complete\n", drive->name); 396 printk ("ide-scsi: %s: DMA complete\n", drive->name);
393#endif /* IDESCSI_DEBUG_LOG */ 397#endif /* IDESCSI_DEBUG_LOG */
394 pc->xferred = pc->req_xfer;
395 (void)hwif->dma_ops->dma_end(drive);
396 } 398 }
397 399
398 /* Clear the interrupt */ 400 /* Clear the interrupt */
@@ -405,7 +407,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
405 " transferred\n", pc->xferred); 407 " transferred\n", pc->xferred);
406 pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS; 408 pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
407 local_irq_enable_in_hardirq(); 409 local_irq_enable_in_hardirq();
408 if (stat & ERR_STAT) 410 if ((stat & ERR_STAT) || (pc->flags & PC_FLAG_DMA_ERROR))
409 rq->errors++; 411 rq->errors++;
410 idescsi_end_request (drive, 1, 0); 412 idescsi_end_request (drive, 1, 0);
411 return ide_stopped; 413 return ide_stopped;