aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-01-26 14:13:11 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:11 -0500
commit4d7a984bdcbdda69fc6b2a4a655415140270aa7b (patch)
tree92d331aa25949277fe76354dfdaf5a5d6e62aaf4
parent79f21b84d94c02b941818df282b61f2a5a028722 (diff)
ide: task_end_request() fix
task_end_request() modified to always call ide_end_drive_cmd() for taskfile requests. Previously, ide_end_drive_cmd() was called only when IDE_TFLAG_FLAGGED was set. Also, ide_dma_intr() is modified to use task_end_request(). Enables TASKFILE ioctls to get valid register outputs on successful completion. Bart: - ported it over recent IDE changes Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-dma.c8
-rw-r--r--drivers/ide/ide-taskfile.c11
-rw-r--r--include/linux/ide.h2
3 files changed, 7 insertions, 14 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index c9648b1ef220..5bf32038dc43 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -153,13 +153,7 @@ ide_startstop_t ide_dma_intr (ide_drive_t *drive)
153 if (!dma_stat) { 153 if (!dma_stat) {
154 struct request *rq = HWGROUP(drive)->rq; 154 struct request *rq = HWGROUP(drive)->rq;
155 155
156 if (rq->rq_disk) { 156 task_end_request(drive, rq, stat);
157 ide_driver_t *drv;
158
159 drv = *(ide_driver_t **)rq->rq_disk->private_data;
160 drv->end_request(drive, 1, rq->nr_sectors);
161 } else
162 ide_end_request(drive, 1, rq->nr_sectors);
163 return ide_stopped; 157 return ide_stopped;
164 } 158 }
165 printk(KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n", 159 printk(KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n",
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 3bbb438f4f92..17c2c0467297 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -408,16 +408,13 @@ static ide_startstop_t task_error(ide_drive_t *drive, struct request *rq,
408 return ide_error(drive, s, stat); 408 return ide_error(drive, s, stat);
409} 409}
410 410
411static void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat) 411void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat)
412{ 412{
413 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { 413 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
414 ide_task_t *task = rq->special; 414 u8 err = drive->hwif->INB(IDE_ERROR_REG);
415 415
416 if (task->tf_flags & IDE_TFLAG_FLAGGED) { 416 ide_end_drive_cmd(drive, stat, err);
417 u8 err = drive->hwif->INB(IDE_ERROR_REG); 417 return;
418 ide_end_drive_cmd(drive, stat, err);
419 return;
420 }
421 } 418 }
422 419
423 if (rq->rq_disk) { 420 if (rq->rq_disk) {
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 02493dbb156d..6192564fcc5a 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -993,6 +993,8 @@ void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8);
993 993
994ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *); 994ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *);
995 995
996void task_end_request(ide_drive_t *, struct request *, u8);
997
996int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *, u16); 998int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *, u16);
997int ide_no_data_taskfile(ide_drive_t *, ide_task_t *); 999int ide_no_data_taskfile(ide_drive_t *, ide_task_t *);
998 1000