diff options
Diffstat (limited to 'drivers/ide/ide-pm.c')
| -rw-r--r-- | drivers/ide/ide-pm.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c index c14ca144cffe..ad7be2669dcb 100644 --- a/drivers/ide/ide-pm.c +++ b/drivers/ide/ide-pm.c | |||
| @@ -10,9 +10,11 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg) | |||
| 10 | struct request_pm_state rqpm; | 10 | struct request_pm_state rqpm; |
| 11 | int ret; | 11 | int ret; |
| 12 | 12 | ||
| 13 | /* call ACPI _GTM only once */ | 13 | if (ide_port_acpi(hwif)) { |
| 14 | if ((drive->dn & 1) == 0 || pair == NULL) | 14 | /* call ACPI _GTM only once */ |
| 15 | ide_acpi_get_timing(hwif); | 15 | if ((drive->dn & 1) == 0 || pair == NULL) |
| 16 | ide_acpi_get_timing(hwif); | ||
| 17 | } | ||
| 16 | 18 | ||
| 17 | memset(&rqpm, 0, sizeof(rqpm)); | 19 | memset(&rqpm, 0, sizeof(rqpm)); |
| 18 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); | 20 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); |
| @@ -26,9 +28,11 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg) | |||
| 26 | ret = blk_execute_rq(drive->queue, NULL, rq, 0); | 28 | ret = blk_execute_rq(drive->queue, NULL, rq, 0); |
| 27 | blk_put_request(rq); | 29 | blk_put_request(rq); |
| 28 | 30 | ||
| 29 | /* call ACPI _PS3 only after both devices are suspended */ | 31 | if (ret == 0 && ide_port_acpi(hwif)) { |
| 30 | if (ret == 0 && ((drive->dn & 1) || pair == NULL)) | 32 | /* call ACPI _PS3 only after both devices are suspended */ |
| 31 | ide_acpi_set_state(hwif, 0); | 33 | if ((drive->dn & 1) || pair == NULL) |
| 34 | ide_acpi_set_state(hwif, 0); | ||
| 35 | } | ||
| 32 | 36 | ||
| 33 | return ret; | 37 | return ret; |
| 34 | } | 38 | } |
| @@ -42,13 +46,15 @@ int generic_ide_resume(struct device *dev) | |||
| 42 | struct request_pm_state rqpm; | 46 | struct request_pm_state rqpm; |
| 43 | int err; | 47 | int err; |
| 44 | 48 | ||
| 45 | /* call ACPI _PS0 / _STM only once */ | 49 | if (ide_port_acpi(hwif)) { |
| 46 | if ((drive->dn & 1) == 0 || pair == NULL) { | 50 | /* call ACPI _PS0 / _STM only once */ |
| 47 | ide_acpi_set_state(hwif, 1); | 51 | if ((drive->dn & 1) == 0 || pair == NULL) { |
| 48 | ide_acpi_push_timing(hwif); | 52 | ide_acpi_set_state(hwif, 1); |
| 49 | } | 53 | ide_acpi_push_timing(hwif); |
| 54 | } | ||
| 50 | 55 | ||
| 51 | ide_acpi_exec_tfs(drive); | 56 | ide_acpi_exec_tfs(drive); |
| 57 | } | ||
| 52 | 58 | ||
| 53 | memset(&rqpm, 0, sizeof(rqpm)); | 59 | memset(&rqpm, 0, sizeof(rqpm)); |
| 54 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); | 60 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); |
