Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38035
b: refs/heads/master
c: 8c2c011
h: refs/heads/master
i:
  38033: 65e9802
  38031: 9faa5f8
v: v3
  • Loading branch information
Jason Lunz authored and Linus Torvalds committed Oct 3, 2006
1 parent 7089945 commit 9794522
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 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: 3f63c5e88a5ce45b423f3712293f1664115b09c0
refs/heads/master: 8c2c0118b86183bf4826db990cae5c8a8d6c6746
25 changes: 19 additions & 6 deletions trunk/drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ enum {
ide_pm_flush_cache = ide_pm_state_start_suspend,
idedisk_pm_standby,

idedisk_pm_idle = ide_pm_state_start_resume,
idedisk_pm_restore_pio = ide_pm_state_start_resume,
idedisk_pm_idle,
ide_pm_restore_dma,
};

Expand All @@ -155,7 +156,10 @@ static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 s
case idedisk_pm_standby: /* Suspend step 2 (standby) complete */
pm->pm_step = ide_pm_state_completed;
break;
case idedisk_pm_idle: /* Resume step 1 (idle) complete */
case idedisk_pm_restore_pio: /* Resume step 1 complete */
pm->pm_step = idedisk_pm_idle;
break;
case idedisk_pm_idle: /* Resume step 2 (idle) complete */
pm->pm_step = ide_pm_restore_dma;
break;
}
Expand All @@ -169,8 +173,11 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
memset(args, 0, sizeof(*args));

if (drive->media != ide_disk) {
/* skip idedisk_pm_idle for ATAPI devices */
if (pm->pm_step == idedisk_pm_idle)
/*
* skip idedisk_pm_restore_pio and idedisk_pm_idle for ATAPI
* devices
*/
if (pm->pm_step == idedisk_pm_restore_pio)
pm->pm_step = ide_pm_restore_dma;
}

Expand All @@ -197,13 +204,19 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
args->handler = &task_no_data_intr;
return do_rw_taskfile(drive, args);

case idedisk_pm_idle: /* Resume step 1 (idle) */
case idedisk_pm_restore_pio: /* Resume step 1 (restore PIO) */
if (drive->hwif->tuneproc != NULL)
drive->hwif->tuneproc(drive, 255);
ide_complete_power_step(drive, rq, 0, 0);
return ide_stopped;

case idedisk_pm_idle: /* Resume step 2 (idle) */
args->tfRegister[IDE_COMMAND_OFFSET] = WIN_IDLEIMMEDIATE;
args->command_type = IDE_DRIVE_TASK_NO_DATA;
args->handler = task_no_data_intr;
return do_rw_taskfile(drive, args);

case ide_pm_restore_dma: /* Resume step 2 (restore DMA) */
case ide_pm_restore_dma: /* Resume step 3 (restore DMA) */
/*
* Right now, all we do is call hwif->ide_dma_check(drive),
* we could be smarter and check for current xfer_speed
Expand Down

0 comments on commit 9794522

Please sign in to comment.