diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-15 15:21:51 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-15 15:21:51 -0400 |
commit | e8e25f03e19c2c47834c821511625c0b80567827 (patch) | |
tree | 1dfdfe2f3be1165352299100329d1e77b9508fa7 /drivers/scsi/ide-scsi.c | |
parent | b3d96afccf8b5c67b66a61efb88c53ff029c6611 (diff) |
ide-scsi: fix DRQ checking for DMA transfers in idescsi_pc_intr()
If DRQ bit of Status Register is not cleared it is an error condition
and should be handled accordingly (disable DMA + reset the device).
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/scsi/ide-scsi.c')
-rw-r--r-- | drivers/scsi/ide-scsi.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 2553ef4d5a91..e67cf8aa9462 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c | |||
@@ -388,7 +388,6 @@ 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 | pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS; | ||
392 | #if IDESCSI_DEBUG_LOG | 391 | #if IDESCSI_DEBUG_LOG |
393 | printk ("ide-scsi: %s: DMA complete\n", drive->name); | 392 | printk ("ide-scsi: %s: DMA complete\n", drive->name); |
394 | #endif /* IDESCSI_DEBUG_LOG */ | 393 | #endif /* IDESCSI_DEBUG_LOG */ |
@@ -404,12 +403,20 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) | |||
404 | if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) | 403 | if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) |
405 | printk(KERN_INFO "Packet command completed, %d bytes" | 404 | printk(KERN_INFO "Packet command completed, %d bytes" |
406 | " transferred\n", pc->xferred); | 405 | " transferred\n", pc->xferred); |
406 | pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS; | ||
407 | local_irq_enable_in_hardirq(); | 407 | local_irq_enable_in_hardirq(); |
408 | if (stat & ERR_STAT) | 408 | if (stat & ERR_STAT) |
409 | rq->errors++; | 409 | rq->errors++; |
410 | idescsi_end_request (drive, 1, 0); | 410 | idescsi_end_request (drive, 1, 0); |
411 | return ide_stopped; | 411 | return ide_stopped; |
412 | } | 412 | } |
413 | if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) { | ||
414 | pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS; | ||
415 | printk(KERN_ERR "%s: The device wants to issue more interrupts " | ||
416 | "in DMA mode\n", drive->name); | ||
417 | ide_dma_off(drive); | ||
418 | return ide_do_reset(drive); | ||
419 | } | ||
413 | bcount = (hwif->INB(hwif->io_ports.lbah_addr) << 8) | | 420 | bcount = (hwif->INB(hwif->io_ports.lbah_addr) << 8) | |
414 | hwif->INB(hwif->io_ports.lbam_addr); | 421 | hwif->INB(hwif->io_ports.lbam_addr); |
415 | ireason = hwif->INB(hwif->io_ports.nsect_addr); | 422 | ireason = hwif->INB(hwif->io_ports.nsect_addr); |