Merge branch 'bp-remove-pc-buf' into for-next
[pandora-kernel.git] / drivers / ide / ide-atapi.c
index 1125ce2..6c73421 100644 (file)
@@ -256,7 +256,7 @@ void ide_retry_pc(ide_drive_t *drive)
        memcpy(pc->c, sense_rq->cmd, 12);
 
        if (drive->media == ide_tape)
-               set_bit(IDE_AFLAG_IGNORE_DSC, &drive->atapi_flags);
+               drive->atapi_flags |= IDE_AFLAG_IGNORE_DSC;
 
        /*
         * Push back the failed request and put request sense on top
@@ -461,6 +461,12 @@ 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.
+                */
+               done = blk_rq_bytes(rq);
+
                /* Command finished - Call the callback function */
                uptodate = drive->pc_callback(drive, dsc);