aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r--drivers/ide/ide-io.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 1adc5e2e7fb3..1deb6d29b186 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -73,6 +73,7 @@ EXPORT_SYMBOL_GPL(ide_end_rq);
73 73
74void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err) 74void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err)
75{ 75{
76 const struct ide_tp_ops *tp_ops = drive->hwif->tp_ops;
76 struct ide_taskfile *tf = &cmd->tf; 77 struct ide_taskfile *tf = &cmd->tf;
77 struct request *rq = cmd->rq; 78 struct request *rq = cmd->rq;
78 u8 tf_cmd = tf->command; 79 u8 tf_cmd = tf->command;
@@ -80,7 +81,16 @@ void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err)
80 tf->error = err; 81 tf->error = err;
81 tf->status = stat; 82 tf->status = stat;
82 83
83 drive->hwif->tp_ops->tf_read(drive, cmd); 84 if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) {
85 u8 data[2];
86
87 tp_ops->input_data(drive, cmd, data, 2);
88
89 tf->data = data[0];
90 tf->hob_data = data[1];
91 }
92
93 tp_ops->tf_read(drive, cmd);
84 94
85 if ((cmd->tf_flags & IDE_TFLAG_CUSTOM_HANDLER) && 95 if ((cmd->tf_flags & IDE_TFLAG_CUSTOM_HANDLER) &&
86 tf_cmd == ATA_CMD_IDLEIMMEDIATE) { 96 tf_cmd == ATA_CMD_IDLEIMMEDIATE) {
@@ -338,7 +348,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
338 if (blk_pm_request(rq)) 348 if (blk_pm_request(rq))
339 ide_check_pm_state(drive, rq); 349 ide_check_pm_state(drive, rq);
340 350
341 SELECT_DRIVE(drive); 351 drive->hwif->tp_ops->dev_select(drive);
342 if (ide_wait_stat(&startstop, drive, drive->ready_stat, 352 if (ide_wait_stat(&startstop, drive, drive->ready_stat,
343 ATA_BUSY | ATA_DRQ, WAIT_READY)) { 353 ATA_BUSY | ATA_DRQ, WAIT_READY)) {
344 printk(KERN_ERR "%s: drive not ready for command\n", drive->name); 354 printk(KERN_ERR "%s: drive not ready for command\n", drive->name);
@@ -481,11 +491,10 @@ repeat:
481 prev_port = hwif->host->cur_port; 491 prev_port = hwif->host->cur_port;
482 hwif->rq = NULL; 492 hwif->rq = NULL;
483 493
484 if (drive->dev_flags & IDE_DFLAG_SLEEPING) { 494 if (drive->dev_flags & IDE_DFLAG_SLEEPING &&
485 if (time_before(drive->sleep, jiffies)) { 495 time_after(drive->sleep, jiffies)) {
486 ide_unlock_port(hwif); 496 ide_unlock_port(hwif);
487 goto plug_device; 497 goto plug_device;
488 }
489 } 498 }
490 499
491 if ((hwif->host->host_flags & IDE_HFLAG_SERIALIZE) && 500 if ((hwif->host->host_flags & IDE_HFLAG_SERIALIZE) &&
@@ -495,7 +504,9 @@ repeat:
495 * quirk_list may not like intr setups/cleanups 504 * quirk_list may not like intr setups/cleanups
496 */ 505 */
497 if (prev_port && prev_port->cur_dev->quirk_list == 0) 506 if (prev_port && prev_port->cur_dev->quirk_list == 0)
498 prev_port->tp_ops->set_irq(prev_port, 0); 507 prev_port->tp_ops->write_devctl(prev_port,
508 ATA_NIEN |
509 ATA_DEVCTL_OBS);
499 510
500 hwif->host->cur_port = hwif; 511 hwif->host->cur_port = hwif;
501 } 512 }