]> err.no Git - linux-2.6/commitdiff
ide: fix PIO setup on resume for ATAPI devices
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Wed, 9 May 2007 22:01:11 +0000 (00:01 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Wed, 9 May 2007 22:01:11 +0000 (00:01 +0200)
PIO should be restored also for ATAPI devices during resume, fix it.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-io.c

index 8670112f1d3947a579fef59d59ec431485c9d288..8e568143d90d73e74da45f99878bceb4ea5a62b6 100644 (file)
@@ -172,15 +172,6 @@ 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_restore_pio and idedisk_pm_idle for ATAPI
-                * devices
-                */
-               if (pm->pm_step == idedisk_pm_restore_pio)
-                       pm->pm_step = ide_pm_restore_dma;
-       }
-
        switch (pm->pm_step) {
        case ide_pm_flush_cache:        /* Suspend step 1 (flush cache) */
                if (drive->media != ide_disk)
@@ -207,7 +198,13 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
        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);
+               /*
+                * skip idedisk_pm_idle for ATAPI devices
+                */
+               if (drive->media != ide_disk)
+                       pm->pm_step = ide_pm_restore_dma;
+               else
+                       ide_complete_power_step(drive, rq, 0, 0);
                return ide_stopped;
 
        case idedisk_pm_idle:           /* Resume step 2 (idle) */