aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-io.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-01 13:02:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-01 13:02:15 -0400
commitc09bca786ff941ed17c5f381c4eca5b106808c51 (patch)
tree9b79a2f2d3ac441551c9c367f22e2240040c4ef6 /drivers/ide/ide-io.c
parente76e5b2c663ac74ae6a542ac20795c625e36a5cd (diff)
parent5b6c942dd1f13835eff8105ec2aa859544a1498d (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (59 commits) ide-floppy: do not complete rq's prematurely ide: be able to build pmac driver without IDE built-in ide-pmac: IDE cable detection on Apple PowerBook ide: inline SELECT_DRIVE() ide: turn selectproc() method into dev_select() method (take 5) MAINTAINERS: move old ide-{floppy,tape} entries to CREDITS (take 2) ide: move data register access out of tf_{read|load}() methods (take 2) ide: call {in|out}put_data() methods from tf_{read|load}() methods (take 2) ide-io-std: shorten ide_{in|out}put_data() ide: rename IDE_TFLAG_IN_[HOB_]FEATURE ide: turn set_irq() method into write_devctl() method ide: use ATA_HOB ide-disk: use ATA_ERR ide: add support for CFA specified transfer modes (take 3) ide-iops: only clear DMA words on setting DMA mode ide: identify data word 53 bit 1 doesn't cover words 62 and 63 (take 3) au1xxx-ide: auide_{in|out}sw() should be static ide-floppy: use ide_pio_bytes() ide-{floppy,tape}: fix padding for PIO transfers ide: remove CONFIG_BLK_DEV_IDEDOUBLER config option ...
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 1adc5e2e7fb..1deb6d29b18 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 }