aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-taskfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r--drivers/ide/ide-taskfile.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 50336d51eebc..cc8633cbe133 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -324,10 +324,17 @@ static void ide_error_cmd(ide_drive_t *drive, struct ide_cmd *cmd)
324void ide_finish_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat) 324void ide_finish_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat)
325{ 325{
326 struct request *rq = drive->hwif->rq; 326 struct request *rq = drive->hwif->rq;
327 u8 err = ide_read_error(drive); 327 u8 err = ide_read_error(drive), nsect = cmd->tf.nsect;
328 u8 set_xfer = !!(cmd->tf_flags & IDE_TFLAG_SET_XFER);
328 329
329 ide_complete_cmd(drive, cmd, stat, err); 330 ide_complete_cmd(drive, cmd, stat, err);
330 rq->errors = err; 331 rq->errors = err;
332
333 if (err == 0 && set_xfer) {
334 ide_set_xfer_rate(drive, nsect);
335 ide_driveid_update(drive);
336 }
337
331 ide_complete_rq(drive, err ? -EIO : 0, blk_rq_bytes(rq)); 338 ide_complete_rq(drive, err ? -EIO : 0, blk_rq_bytes(rq));
332} 339}
333 340