aboutsummaryrefslogtreecommitdiff
path: root/drivers/ide/ide-io.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 12:46:41 +0100
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 12:46:41 +0100
commite7fedc3ca0b8fcd3350a40c42a7100a9539e6c4a (patch)
tree84cd0b58c1c37a4f14f769555ea877b0f4e44efa /drivers/ide/ide-io.c
parent041cea10a86a25b088185d07ad15d728f503f02c (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.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index c27eaab1ffc..c33a8006838 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)
{
struct ide_taskfile *tf = &cmd->tf;
struct request *rq = cmd->rq;
+ u8 tf_cmd = tf->command;
tf->error = err;
tf->status = stat;
drive->hwif->tp_ops->tf_read(drive, cmd);
+ if ((cmd->tf_flags & IDE_TFLAG_CUSTOM_HANDLER) &&
+ tf_cmd == ATA_CMD_IDLEIMMEDIATE) {
+ if (tf->lbal != 0xc4) {
+ printk(KERN_ERR "%s: head unload failed!\n",
+ drive->name);
+ ide_tf_dump(drive->name, tf);
+ } else
+ drive->dev_flags |= IDE_DFLAG_PARKED;
+ }
+
if (rq && rq->cmd_type == REQ_TYPE_ATA_TASKFILE)
memcpy(rq->special, cmd, sizeof(*cmd));