diff options
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index e93405f0eac4..c4acfc5273b3 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1557,21 +1557,25 @@ void cpufreq_suspend(void) | |||
1557 | if (!cpufreq_driver) | 1557 | if (!cpufreq_driver) |
1558 | return; | 1558 | return; |
1559 | 1559 | ||
1560 | if (!has_target()) | 1560 | if (!has_target() && !cpufreq_driver->suspend) |
1561 | goto suspend; | 1561 | goto suspend; |
1562 | 1562 | ||
1563 | pr_debug("%s: Suspending Governors\n", __func__); | 1563 | pr_debug("%s: Suspending Governors\n", __func__); |
1564 | 1564 | ||
1565 | for_each_active_policy(policy) { | 1565 | for_each_active_policy(policy) { |
1566 | down_write(&policy->rwsem); | 1566 | if (has_target()) { |
1567 | ret = cpufreq_governor(policy, CPUFREQ_GOV_STOP); | 1567 | down_write(&policy->rwsem); |
1568 | up_write(&policy->rwsem); | 1568 | ret = cpufreq_governor(policy, CPUFREQ_GOV_STOP); |
1569 | up_write(&policy->rwsem); | ||
1569 | 1570 | ||
1570 | if (ret) | 1571 | if (ret) { |
1571 | pr_err("%s: Failed to stop governor for policy: %p\n", | 1572 | pr_err("%s: Failed to stop governor for policy: %p\n", |
1572 | __func__, policy); | 1573 | __func__, policy); |
1573 | else if (cpufreq_driver->suspend | 1574 | continue; |
1574 | && cpufreq_driver->suspend(policy)) | 1575 | } |
1576 | } | ||
1577 | |||
1578 | if (cpufreq_driver->suspend && cpufreq_driver->suspend(policy)) | ||
1575 | pr_err("%s: Failed to suspend driver: %p\n", __func__, | 1579 | pr_err("%s: Failed to suspend driver: %p\n", __func__, |
1576 | policy); | 1580 | policy); |
1577 | } | 1581 | } |
@@ -1596,7 +1600,7 @@ void cpufreq_resume(void) | |||
1596 | 1600 | ||
1597 | cpufreq_suspended = false; | 1601 | cpufreq_suspended = false; |
1598 | 1602 | ||
1599 | if (!has_target()) | 1603 | if (!has_target() && !cpufreq_driver->resume) |
1600 | return; | 1604 | return; |
1601 | 1605 | ||
1602 | pr_debug("%s: Resuming Governors\n", __func__); | 1606 | pr_debug("%s: Resuming Governors\n", __func__); |
@@ -1605,7 +1609,7 @@ void cpufreq_resume(void) | |||
1605 | if (cpufreq_driver->resume && cpufreq_driver->resume(policy)) { | 1609 | if (cpufreq_driver->resume && cpufreq_driver->resume(policy)) { |
1606 | pr_err("%s: Failed to resume driver: %p\n", __func__, | 1610 | pr_err("%s: Failed to resume driver: %p\n", __func__, |
1607 | policy); | 1611 | policy); |
1608 | } else { | 1612 | } else if (has_target()) { |
1609 | down_write(&policy->rwsem); | 1613 | down_write(&policy->rwsem); |
1610 | ret = cpufreq_start_governor(policy); | 1614 | ret = cpufreq_start_governor(policy); |
1611 | up_write(&policy->rwsem); | 1615 | up_write(&policy->rwsem); |