diff options
| author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-15 15:22:03 -0400 |
|---|---|---|
| committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-15 15:22:03 -0400 |
| commit | 55d82bfa6763d6761670d740ab3bac2f1c042d87 (patch) | |
| tree | dd5e13c6c4801a4853ee0ce5f11469ab05ba6c31 /drivers | |
| parent | cdca5c1f3b769eb2cdfc9cadc254cb74ba73c7d6 (diff) | |
ide-{floppy,scsi}: read Status Register before stopping DMA engine
Read Status Register before stopping DMA engine to match ide-tape
device driver - it should be safe and shouldn't affect anything.
This is a preparation for adding generic ide_pc_intr() helper.
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/ide/ide-floppy.c | 6 | ||||
| -rw-r--r-- | drivers/scsi/ide-scsi.c | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 502ef9dcc5b9..70aef97fb8bc 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
| @@ -399,6 +399,9 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive) | |||
| 399 | 399 | ||
| 400 | debug_log("Enter %s - interrupt handler\n", __func__); | 400 | debug_log("Enter %s - interrupt handler\n", __func__); |
| 401 | 401 | ||
| 402 | /* Clear the interrupt */ | ||
| 403 | stat = ide_read_status(drive); | ||
| 404 | |||
| 402 | if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) { | 405 | if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) { |
| 403 | dma_error = hwif->dma_ops->dma_end(drive); | 406 | dma_error = hwif->dma_ops->dma_end(drive); |
| 404 | if (dma_error) { | 407 | if (dma_error) { |
| @@ -412,9 +415,6 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive) | |||
| 412 | debug_log("%s: DMA finished\n", drive->name); | 415 | debug_log("%s: DMA finished\n", drive->name); |
| 413 | } | 416 | } |
| 414 | 417 | ||
| 415 | /* Clear the interrupt */ | ||
| 416 | stat = ide_read_status(drive); | ||
| 417 | |||
| 418 | /* No more interrupts */ | 418 | /* No more interrupts */ |
| 419 | if ((stat & DRQ_STAT) == 0) { | 419 | if ((stat & DRQ_STAT) == 0) { |
| 420 | debug_log("Packet command completed, %d bytes transferred\n", | 420 | debug_log("Packet command completed, %d bytes transferred\n", |
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index ec9a5de2e75e..ada733ca6725 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c | |||
| @@ -370,6 +370,10 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) | |||
| 370 | pc->callback(drive); | 370 | pc->callback(drive); |
| 371 | return ide_stopped; | 371 | return ide_stopped; |
| 372 | } | 372 | } |
| 373 | |||
| 374 | /* Clear the interrupt */ | ||
| 375 | stat = ide_read_status(drive); | ||
| 376 | |||
| 373 | if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) { | 377 | if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) { |
| 374 | if (hwif->dma_ops->dma_end(drive)) | 378 | if (hwif->dma_ops->dma_end(drive)) |
| 375 | pc->flags |= PC_FLAG_DMA_ERROR; | 379 | pc->flags |= PC_FLAG_DMA_ERROR; |
| @@ -378,9 +382,6 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) | |||
| 378 | debug_log("%s: DMA finished\n", drive->name); | 382 | debug_log("%s: DMA finished\n", drive->name); |
| 379 | } | 383 | } |
| 380 | 384 | ||
| 381 | /* Clear the interrupt */ | ||
| 382 | stat = ide_read_status(drive); | ||
| 383 | |||
| 384 | if ((stat & DRQ_STAT) == 0) { | 385 | if ((stat & DRQ_STAT) == 0) { |
| 385 | /* No more interrupts */ | 386 | /* No more interrupts */ |
| 386 | debug_log("Packet command completed, %d bytes transferred\n", | 387 | debug_log("Packet command completed, %d bytes transferred\n", |
