diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:41 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:41 -0400 |
commit | e7fedc3ca0b8fcd3350a40c42a7100a9539e6c4a (patch) | |
tree | 84cd0b58c1c37a4f14f769555ea877b0f4e44efa /drivers/ide/ide-io.c | |
parent | 041cea10a86a25b088185d07ad15d728f503f02c (diff) |
ide: use ide_complete_cmd() for head unload commands
Move handling of head unload commands from task_no_data_intr()
to ide_complete_cmd() and then use ide_complete_cmd() also for
head unload commands.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r-- | drivers/ide/ide-io.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index c27eaab1ffcf..c33a8006838b 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -147,12 +147,23 @@ void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err) | |||
147 | { | 147 | { |
148 | struct ide_taskfile *tf = &cmd->tf; | 148 | struct ide_taskfile *tf = &cmd->tf; |
149 | struct request *rq = cmd->rq; | 149 | struct request *rq = cmd->rq; |
150 | u8 tf_cmd = tf->command; | ||
150 | 151 | ||
151 | tf->error = err; | 152 | tf->error = err; |
152 | tf->status = stat; | 153 | tf->status = stat; |
153 | 154 | ||
154 | drive->hwif->tp_ops->tf_read(drive, cmd); | 155 | drive->hwif->tp_ops->tf_read(drive, cmd); |
155 | 156 | ||
157 | if ((cmd->tf_flags & IDE_TFLAG_CUSTOM_HANDLER) && | ||
158 | tf_cmd == ATA_CMD_IDLEIMMEDIATE) { | ||
159 | if (tf->lbal != 0xc4) { | ||
160 | printk(KERN_ERR "%s: head unload failed!\n", | ||
161 | drive->name); | ||
162 | ide_tf_dump(drive->name, tf); | ||
163 | } else | ||
164 | drive->dev_flags |= IDE_DFLAG_PARKED; | ||
165 | } | ||
166 | |||
156 | if (rq && rq->cmd_type == REQ_TYPE_ATA_TASKFILE) | 167 | if (rq && rq->cmd_type == REQ_TYPE_ATA_TASKFILE) |
157 | memcpy(rq->special, cmd, sizeof(*cmd)); | 168 | memcpy(rq->special, cmd, sizeof(*cmd)); |
158 | 169 | ||