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.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index e205f46c3c7a..77c6eaeacefa 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -672,7 +672,32 @@ EXPORT_SYMBOL_GPL(ide_devset_execute);
672 672
673static ide_startstop_t ide_special_rq(ide_drive_t *drive, struct request *rq) 673static ide_startstop_t ide_special_rq(ide_drive_t *drive, struct request *rq)
674{ 674{
675 switch (rq->cmd[0]) { 675 u8 cmd = rq->cmd[0];
676
677 if (cmd == REQ_PARK_HEADS || cmd == REQ_UNPARK_HEADS) {
678 ide_task_t task;
679 struct ide_taskfile *tf = &task.tf;
680
681 memset(&task, 0, sizeof(task));
682 if (cmd == REQ_PARK_HEADS) {
683 drive->sleep = *(unsigned long *)rq->special;
684 drive->dev_flags |= IDE_DFLAG_SLEEPING;
685 tf->command = ATA_CMD_IDLEIMMEDIATE;
686 tf->feature = 0x44;
687 tf->lbal = 0x4c;
688 tf->lbam = 0x4e;
689 tf->lbah = 0x55;
690 task.tf_flags |= IDE_TFLAG_CUSTOM_HANDLER;
691 } else /* cmd == REQ_UNPARK_HEADS */
692 tf->command = ATA_CMD_CHK_POWER;
693
694 task.tf_flags |= IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
695 task.rq = rq;
696 drive->hwif->data_phase = task.data_phase = TASKFILE_NO_DATA;
697 return do_rw_taskfile(drive, &task);
698 }
699
700 switch (cmd) {
676 case REQ_DEVSET_EXEC: 701 case REQ_DEVSET_EXEC:
677 { 702 {
678 int err, (*setfunc)(ide_drive_t *, int) = rq->special; 703 int err, (*setfunc)(ide_drive_t *, int) = rq->special;
@@ -1008,7 +1033,7 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq)
1008 } 1033 }
1009 hwgroup->hwif = hwif; 1034 hwgroup->hwif = hwif;
1010 hwgroup->drive = drive; 1035 hwgroup->drive = drive;
1011 drive->dev_flags &= ~IDE_DFLAG_SLEEPING; 1036 drive->dev_flags &= ~(IDE_DFLAG_SLEEPING | IDE_DFLAG_PARKED);
1012 drive->service_start = jiffies; 1037 drive->service_start = jiffies;
1013 1038
1014 if (blk_queue_plugged(drive->queue)) { 1039 if (blk_queue_plugged(drive->queue)) {