Skip to content

Commit 3642859

Browse files
committed
Merge tag 'pm-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki: "Fix a recent cpufreq initialization regression (Rafael Wysocki), revert a devfreq commit that made incompatible changes and broke user land on some systems (Orson Zhai), drop a stale reference to a document that has gone away recently (Jonathan Neuschäfer), and fix a typo in a hibernation code comment (Alexandre Belloni)" * tag 'pm-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: Fix policy initialization for internal governor drivers Revert "PM / devfreq: Modify the device name as devfreq(X) for sysfs" PM / hibernate: fix typo "reserverd_size" -> "reserved_size" Documentation: power: Drop reference to interface.rst
2 parents bfeb4f9 + 189c696 commit 3642859

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

Documentation/power/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Power Management
1313
drivers-testing
1414
energy-model
1515
freezing-of-tasks
16-
interface
1716
opp
1817
pci
1918
pm_qos_interface

drivers/cpufreq/cpufreq.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,9 +1076,17 @@ static int cpufreq_init_policy(struct cpufreq_policy *policy)
10761076
pol = policy->last_policy;
10771077
} else if (def_gov) {
10781078
pol = cpufreq_parse_policy(def_gov->name);
1079-
} else {
1080-
return -ENODATA;
1079+
/*
1080+
* In case the default governor is neiter "performance"
1081+
* nor "powersave", fall back to the initial policy
1082+
* value set by the driver.
1083+
*/
1084+
if (pol == CPUFREQ_POLICY_UNKNOWN)
1085+
pol = policy->policy;
10811086
}
1087+
if (pol != CPUFREQ_POLICY_PERFORMANCE &&
1088+
pol != CPUFREQ_POLICY_POWERSAVE)
1089+
return -ENODATA;
10821090
}
10831091

10841092
return cpufreq_set_policy(policy, gov, pol);

drivers/devfreq/devfreq.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,6 @@ struct devfreq *devfreq_add_device(struct device *dev,
738738
{
739739
struct devfreq *devfreq;
740740
struct devfreq_governor *governor;
741-
static atomic_t devfreq_no = ATOMIC_INIT(-1);
742741
int err = 0;
743742

744743
if (!dev || !profile || !governor_name) {
@@ -800,8 +799,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
800799
devfreq->suspend_freq = dev_pm_opp_get_suspend_opp_freq(dev);
801800
atomic_set(&devfreq->suspend_count, 0);
802801

803-
dev_set_name(&devfreq->dev, "devfreq%d",
804-
atomic_inc_return(&devfreq_no));
802+
dev_set_name(&devfreq->dev, "%s", dev_name(dev));
805803
err = device_register(&devfreq->dev);
806804
if (err) {
807805
mutex_unlock(&devfreq->lock);

kernel/power/snapshot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1681,7 +1681,7 @@ static unsigned long minimum_image_size(unsigned long saveable)
16811681
* hibernation for allocations made while saving the image and for device
16821682
* drivers, in case they need to allocate memory from their hibernation
16831683
* callbacks (these two numbers are given by PAGES_FOR_IO (which is a rough
1684-
* estimate) and reserverd_size divided by PAGE_SIZE (which is tunable through
1684+
* estimate) and reserved_size divided by PAGE_SIZE (which is tunable through
16851685
* /sys/power/reserved_size, respectively). To make this happen, we compute the
16861686
* total number of available page frames and allocate at least
16871687
*

0 commit comments

Comments
 (0)