|
@@ -409,6 +409,16 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
|
|
|
if ((pc->flags & PC_FLAG_WAIT_FOR_DSC) && (stat & ATA_DSC) == 0)
|
|
|
dsc = 1;
|
|
|
|
|
|
+ /*
|
|
|
+ * ->pc_callback() might change rq->data_len for
|
|
|
+ * residual count, cache total length.
|
|
|
+ */
|
|
|
+ if (!blk_special_request(rq) &&
|
|
|
+ (drive->media == ide_tape && !rq->bio))
|
|
|
+ done = ide_rq_bytes(rq); /* FIXME */
|
|
|
+ else
|
|
|
+ done = blk_rq_bytes(rq);
|
|
|
+
|
|
|
/* Command finished - Call the callback function */
|
|
|
uptodate = drive->pc_callback(drive, dsc);
|
|
|
|
|
@@ -417,7 +427,6 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
|
|
|
|
|
|
if (blk_special_request(rq)) {
|
|
|
rq->errors = 0;
|
|
|
- done = blk_rq_bytes(rq);
|
|
|
error = 0;
|
|
|
} else {
|
|
|
|
|
@@ -426,11 +435,6 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
|
|
|
rq->errors = -EIO;
|
|
|
}
|
|
|
|
|
|
- if (drive->media == ide_tape && !rq->bio)
|
|
|
- done = ide_rq_bytes(rq); /* FIXME */
|
|
|
- else
|
|
|
- done = blk_rq_bytes(rq);
|
|
|
-
|
|
|
error = uptodate ? 0 : -EIO;
|
|
|
}
|
|
|
|