aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-atapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-atapi.c')
-rw-r--r--drivers/ide/ide-atapi.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 8a894fa37b53..7129495b3e40 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -370,7 +370,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
370 ? "write" : "read"); 370 ? "write" : "read");
371 pc->flags |= PC_FLAG_DMA_ERROR; 371 pc->flags |= PC_FLAG_DMA_ERROR;
372 } else 372 } else
373 pc->xferred = pc->req_xfer; 373 pc->xferred = blk_rq_bytes(rq);
374 debug_log("%s: DMA finished\n", drive->name); 374 debug_log("%s: DMA finished\n", drive->name);
375 } 375 }
376 376
@@ -627,7 +627,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd)
627 ide_hwif_t *hwif = drive->hwif; 627 ide_hwif_t *hwif = drive->hwif;
628 ide_expiry_t *expiry = NULL; 628 ide_expiry_t *expiry = NULL;
629 struct request *rq = hwif->rq; 629 struct request *rq = hwif->rq;
630 unsigned int timeout; 630 unsigned int timeout, bytes;
631 u16 bcount; 631 u16 bcount;
632 u8 valid_tf; 632 u8 valid_tf;
633 u8 drq_int = !!(drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT); 633 u8 drq_int = !!(drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT);
@@ -647,9 +647,11 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd)
647 pc->xferred = 0; 647 pc->xferred = 0;
648 648
649 valid_tf = IDE_VALID_DEVICE; 649 valid_tf = IDE_VALID_DEVICE;
650 bcount = ((drive->media == ide_tape) ? 650 bytes = blk_rq_bytes(rq);
651 pc->req_xfer : 651
652 min(pc->req_xfer, 63 * 1024)); 652 bcount = ((drive->media == ide_tape) ? bytes
653 : min_t(unsigned int,
654 bytes, 63 * 1024));
653 655
654 if (pc->flags & PC_FLAG_DMA_ERROR) { 656 if (pc->flags & PC_FLAG_DMA_ERROR) {
655 pc->flags &= ~PC_FLAG_DMA_ERROR; 657 pc->flags &= ~PC_FLAG_DMA_ERROR;