aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/ide-atapi.c5
-rw-r--r--drivers/ide/ide-eh.c5
-rw-r--r--drivers/ide/ide-floppy.c2
-rw-r--r--drivers/ide/ide-io.c19
-rw-r--r--drivers/ide/ide-tape.c2
-rw-r--r--drivers/ide/ide-taskfile.c4
-rw-r--r--include/linux/ide.h2
7 files changed, 21 insertions, 18 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 92c6ef6feb57..5d57af29c4c8 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -402,9 +402,10 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
402 if (uptodate == 0) 402 if (uptodate == 0)
403 drive->failed_pc = NULL; 403 drive->failed_pc = NULL;
404 404
405 if (blk_special_request(rq)) 405 if (blk_special_request(rq)) {
406 rq->errors = 0;
406 ide_complete_rq(drive, 0); 407 ide_complete_rq(drive, 0);
407 else 408 } else
408 ide_end_request(drive, uptodate, 0); 409 ide_end_request(drive, uptodate, 0);
409 410
410 return ide_stopped; 411 return ide_stopped;
diff --git a/drivers/ide/ide-eh.c b/drivers/ide/ide-eh.c
index f6e1a82a3cc5..d1385d332e94 100644
--- a/drivers/ide/ide-eh.c
+++ b/drivers/ide/ide-eh.c
@@ -123,17 +123,18 @@ ide_startstop_t ide_error(ide_drive_t *drive, const char *msg, u8 stat)
123 123
124 /* retry only "normal" I/O: */ 124 /* retry only "normal" I/O: */
125 if (!blk_fs_request(rq)) { 125 if (!blk_fs_request(rq)) {
126 rq->errors = 1;
127 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { 126 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
128 struct ide_cmd *cmd = rq->special; 127 struct ide_cmd *cmd = rq->special;
129 128
130 if (cmd) 129 if (cmd)
131 ide_complete_cmd(drive, cmd, stat, err); 130 ide_complete_cmd(drive, cmd, stat, err);
132 } else if (blk_pm_request(rq)) { 131 } else if (blk_pm_request(rq)) {
132 rq->errors = 1;
133 ide_complete_pm_rq(drive, rq); 133 ide_complete_pm_rq(drive, rq);
134 return ide_stopped; 134 return ide_stopped;
135 } 135 }
136 ide_complete_rq(drive, err); 136 rq->errors = err;
137 ide_complete_rq(drive, err ? -EIO : 0);
137 return ide_stopped; 138 return ide_stopped;
138 } 139 }
139 140
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index f56e9a918b99..407e4914dfd1 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -260,7 +260,7 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
260 printk(KERN_ERR PFX "%s: I/O error\n", drive->name); 260 printk(KERN_ERR PFX "%s: I/O error\n", drive->name);
261 261
262 if (blk_special_request(rq)) { 262 if (blk_special_request(rq)) {
263 rq->errors = IDE_DRV_ERROR_GENERAL; 263 rq->errors = 0;
264 ide_complete_rq(drive, 0); 264 ide_complete_rq(drive, 0);
265 return ide_stopped; 265 return ide_stopped;
266 } else 266 } else
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index c38426de6041..4cc2bb13f1d6 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -144,17 +144,14 @@ void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err)
144 kfree(cmd); 144 kfree(cmd);
145} 145}
146 146
147void ide_complete_rq(ide_drive_t *drive, u8 err) 147void ide_complete_rq(ide_drive_t *drive, int error)
148{ 148{
149 ide_hwif_t *hwif = drive->hwif; 149 ide_hwif_t *hwif = drive->hwif;
150 struct request *rq = hwif->rq; 150 struct request *rq = hwif->rq;
151 151
152 hwif->rq = NULL; 152 hwif->rq = NULL;
153 153
154 rq->errors = err; 154 if (unlikely(blk_end_request(rq, error, blk_rq_bytes(rq))))
155
156 if (unlikely(blk_end_request(rq, (rq->errors ? -EIO : 0),
157 blk_rq_bytes(rq))))
158 BUG(); 155 BUG();
159} 156}
160EXPORT_SYMBOL(ide_complete_rq); 157EXPORT_SYMBOL(ide_complete_rq);
@@ -166,13 +163,14 @@ void ide_kill_rq(ide_drive_t *drive, struct request *rq)
166 163
167 drive->failed_pc = NULL; 164 drive->failed_pc = NULL;
168 165
169 if ((media == ide_floppy && drv_req) || media == ide_tape) 166 if ((media == ide_floppy || media == ide_tape) && drv_req) {
170 rq->errors = IDE_DRV_ERROR_GENERAL; 167 rq->errors = 0;
171
172 if ((media == ide_floppy || media == ide_tape) && drv_req)
173 ide_complete_rq(drive, 0); 168 ide_complete_rq(drive, 0);
174 else 169 } else {
170 if (media == ide_tape)
171 rq->errors = IDE_DRV_ERROR_GENERAL;
175 ide_end_request(drive, 0, 0); 172 ide_end_request(drive, 0, 0);
173 }
176} 174}
177 175
178static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf) 176static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf)
@@ -312,6 +310,7 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive,
312#ifdef DEBUG 310#ifdef DEBUG
313 printk("%s: DRIVE_CMD (null)\n", drive->name); 311 printk("%s: DRIVE_CMD (null)\n", drive->name);
314#endif 312#endif
313 rq->errors = 0;
315 ide_complete_rq(drive, 0); 314 ide_complete_rq(drive, 0);
316 315
317 return ide_stopped; 316 return ide_stopped;
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index a42e49c6cc3f..3bfcd7290ce0 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -774,8 +774,8 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
774 if (rq != postponed_rq) { 774 if (rq != postponed_rq) {
775 printk(KERN_ERR "ide-tape: ide-tape.c bug - " 775 printk(KERN_ERR "ide-tape: ide-tape.c bug - "
776 "Two DSC requests were queued\n"); 776 "Two DSC requests were queued\n");
777 rq->errors = IDE_DRV_ERROR_GENERAL;
778 drive->failed_pc = NULL; 777 drive->failed_pc = NULL;
778 rq->errors = 0;
779 ide_complete_rq(drive, 0); 779 ide_complete_rq(drive, 0);
780 return ide_stopped; 780 return ide_stopped;
781 } 781 }
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index f99a6aaad9eb..e9d008ef3f33 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -289,10 +289,12 @@ static void ide_error_cmd(ide_drive_t *drive, struct ide_cmd *cmd)
289 289
290void ide_finish_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat) 290void ide_finish_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat)
291{ 291{
292 struct request *rq = drive->hwif->rq;
292 u8 err = ide_read_error(drive); 293 u8 err = ide_read_error(drive);
293 294
294 ide_complete_cmd(drive, cmd, stat, err); 295 ide_complete_cmd(drive, cmd, stat, err);
295 ide_complete_rq(drive, err); 296 rq->errors = err;
297 ide_complete_rq(drive, err ? -EIO : 0);
296} 298}
297 299
298/* 300/*
diff --git a/include/linux/ide.h b/include/linux/ide.h
index f910f4ccfaa0..32369d5797de 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1166,7 +1166,7 @@ extern int ide_devset_execute(ide_drive_t *drive,
1166 const struct ide_devset *setting, int arg); 1166 const struct ide_devset *setting, int arg);
1167 1167
1168void ide_complete_cmd(ide_drive_t *, struct ide_cmd *, u8, u8); 1168void ide_complete_cmd(ide_drive_t *, struct ide_cmd *, u8, u8);
1169void ide_complete_rq(ide_drive_t *, u8); 1169void ide_complete_rq(ide_drive_t *, int);
1170 1170
1171void ide_tf_dump(const char *, struct ide_taskfile *); 1171void ide_tf_dump(const char *, struct ide_taskfile *);
1172 1172