Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137672
b: refs/heads/master
c: e7fedc3
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Mar 27, 2009
1 parent 31cee76 commit cb93bab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 041cea10a86a25b088185d07ad15d728f503f02c
refs/heads/master: e7fedc3ca0b8fcd3350a40c42a7100a9539e6c4a
11 changes: 11 additions & 0 deletions trunk/drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
13 changes: 3 additions & 10 deletions trunk/drivers/ide/ide-taskfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,7 @@ static ide_startstop_t task_no_data_intr(ide_drive_t *drive)
return ide_error(drive, "task_no_data_intr", stat);
}

if (custom && tf->command == ATA_CMD_IDLEIMMEDIATE) {
hwif->tp_ops->tf_read(drive, cmd);
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;
} else if (custom && tf->command == ATA_CMD_SET_MULTI)
if (custom && tf->command == ATA_CMD_SET_MULTI)
drive->mult_count = drive->mult_req;

if (custom == 0 || tf->command == ATA_CMD_IDLEIMMEDIATE) {
Expand All @@ -164,7 +156,8 @@ static ide_startstop_t task_no_data_intr(ide_drive_t *drive)
if (blk_pm_request(rq))
ide_complete_pm_rq(drive, rq);
else {
if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE)
if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE ||
tf->command == ATA_CMD_IDLEIMMEDIATE)
ide_complete_cmd(drive, cmd, stat, err);
ide_complete_rq(drive, err);
}
Expand Down

0 comments on commit cb93bab

Please sign in to comment.