• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision46552e68acf71752c2330929cb97c644e4560155 (tree)
Zeit2016-01-30 08:40:59
AutorLinus Torvalds <torvalds@linu...>
CommiterLinus Torvalds

Log Message

More power management and ACPI fixes for v4.5-rc2

- Fix a recent cpuidle core regression that broke suspend-to-idle
on all systems where cpuidle drivers don't provide ->enter_freeze
callbacks for any states (Sudeep Holla).

- Drop an unnecessary symbol definition from the cpuidle core code
handling coupled CPU cores (Anders Roxell).

- Fix a race condition related to governor initialization and removal
in the cpufreq core (Viresh Kumar).

- Clean up the cpufreq core to use list_is_last() for checking if
the given policy object is the last element of a list instead of
open coding that in a clumsy way (Gautham R Shenoy).

- Fix compiler warnings in the pxa2xx and cpufreq-dt cpufreq drivers
(Arnd Bergmann).

- Fix two locking issues and clean up a comment in the generic power
domains framework (Ulf Hansson, Marek Szyprowski, Moritz Fischer).

- Fix the error code path of one function in the ACPI-based PCI
hotplug framework (ACPIPHP) that forgets to release a lock
acquired previously (Insu Yun).

- Drop the ACPI backlight blacklist entry for Dell Inspiron 5737
that is not necessary any more (Hans de Goede).

- Clean up the top-level PM Kconfig to stop requiring APM emulation
to depend on PM which in fact isn't necessary (Arnd Bergmann).

/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAABCAAGBQJWq9bUAAoJEILEb/54YlRxDIIP/2SPB8xYUAhMDRoPnl70+yqk
CSQ7R0xNT48dKRK76+swqMqxF3IFm7/Khm9JI0gp4fdRhRRIhRIGvMEs95LdwEN/
oaNA+gwnDKfYYFKHYYUcbmA4JmNa7jBrZ2bDZUOYA9U1KApRdotA3JZ+uYjNdgXq
J+LoQdfHEzRo8/jmwjfYd3CPbmT8FR3lN2ndMq0sW9e4QpMjof70al99aiJbXwRh
4eDqkQMnmKPk6vMLKfK/ZcbQ8SSrxq71FbwTfvvXfG9RMA0QsJtrN6u7fvHjNO4G
nm+BuRtuAIwchQ+DiAKvm5/OM3zJbNLsS9CY8W563/gYjfztyZCDylr6whhb2cpz
3cu6WA6kz9yPtHmJAw1Guv+RbFvqsMee/3mLE7ZCLwtAxD7ztXhoy6D/VhXV9lNb
6YBbhWFTRhYPAU7uHk6CT67qa4vJXy/+kHvgpxwSqH+Bm9zB5hCAKquKEVcp6aYU
Y6DOMi2Tx1wQgqp74rM4Nw6uoF84yKY63S+Ahdx345tKUq0KM98mWhs98nRtIiaE
hyTdMHL4OSAkvQCPZBSQ4nkQXe4waozyQuBJ9q97Nd425bx6S5bGBhUq3siT7xFG
tBznZQchn5V2iRXdmnjXLCZuB8W7SeXpNVJ/W1vX2ejMkGIcM/1PO/wAO3SMuuLN
T6tDb6RJa16DVjollV3j
=s0dR
-----END PGP SIGNATURE-----

Merge tag 'pm+acpi-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management and ACPI fixes from Rafael Wysocki:

"These are: cpuidle fixes (including one fix for a recent regression),
cpufreq fixes (including fixes for two issues introduced during the
4.2 cycle), generic power domains framework fixes (two locking fixes
and one cleanup), one locking fix in the ACPI-based PCI hotplug
framework (ACPIPHP), removal of one ACPI backlight blacklist entry
that isn't necessary any more and a PM Kconfig cleanup.
Specifics:
- Fix a recent cpuidle core regression that broke suspend-to-idle on
all systems where cpuidle drivers don't provide ->enter_freeze
callbacks for any states (Sudeep Holla).
- Drop an unnecessary symbol definition from the cpuidle core code
handling coupled CPU cores (Anders Roxell).
- Fix a race condition related to governor initialization and removal
in the cpufreq core (Viresh Kumar).
- Clean up the cpufreq core to use list_is_last() for checking if the
given policy object is the last element of a list instead of open
coding that in a clumsy way (Gautham R Shenoy).
- Fix compiler warnings in the pxa2xx and cpufreq-dt cpufreq drivers
(Arnd Bergmann).
- Fix two locking issues and clean up a comment in the generic power
domains framework (Ulf Hansson, Marek Szyprowski, Moritz Fischer).
- Fix the error code path of one function in the ACPI-based PCI
hotplug framework (ACPIPHP) that forgets to release a lock acquired
previously (Insu Yun).
- Drop the ACPI backlight blacklist entry for Dell Inspiron 5737 that
is not necessary any more (Hans de Goede).
- Clean up the top-level PM Kconfig to stop requiring APM emulation
to depend on PM which in fact isn't necessary (Arnd Bergmann)"

* tag 'pm+acpi-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:

cpufreq: cpufreq-dt: avoid uninitialized variable warnings:
cpufreq: pxa2xx: fix pxa_cpufreq_change_voltage prototype
PM: APM_EMULATION does not depend on PM
cpufreq: Use list_is_last() to check last entry of the policy list
cpufreq: Fix NULL reference crash while accessing policy->governor_data
cpuidle: coupled: remove unused define cpuidle_coupled_lock
PM / Domains: Fix typo in comment
PM / Domains: Fix potential deadlock while adding/removing subdomains
ACPI / PCI / hotplug: unlock in error path in acpiphp_enable_slot()
ACPI: Revert "ACPI / video: Add Dell Inspiron 5737 to the blacklist"
cpuidle: fix fallback mechanism for suspend to idle in absence of enter_freeze
PM / domains: fix lockdep issue for all subdomains

Ändern Zusammenfassung

Diff

--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -135,14 +135,6 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
135135 DMI_MATCH(DMI_PRODUCT_NAME, "UL30A"),
136136 },
137137 },
138- {
139- .callback = video_detect_force_vendor,
140- .ident = "Dell Inspiron 5737",
141- .matches = {
142- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
143- DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 5737"),
144- },
145- },
146138
147139 /*
148140 * These models have a working acpi_video backlight control, and using
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -162,7 +162,7 @@ static int genpd_power_off(struct generic_pm_domain *genpd, bool timed)
162162
163163 /**
164164 * genpd_queue_power_off_work - Queue up the execution of genpd_poweroff().
165- * @genpd: PM domait to power off.
165+ * @genpd: PM domain to power off.
166166 *
167167 * Queue up the execution of genpd_poweroff() unless it's already been done
168168 * before.
@@ -172,16 +172,15 @@ static void genpd_queue_power_off_work(struct generic_pm_domain *genpd)
172172 queue_work(pm_wq, &genpd->power_off_work);
173173 }
174174
175-static int genpd_poweron(struct generic_pm_domain *genpd);
176-
177175 /**
178176 * __genpd_poweron - Restore power to a given PM domain and its masters.
179177 * @genpd: PM domain to power up.
178+ * @depth: nesting count for lockdep.
180179 *
181180 * Restore power to @genpd and all of its masters so that it is possible to
182181 * resume a device belonging to it.
183182 */
184-static int __genpd_poweron(struct generic_pm_domain *genpd)
183+static int __genpd_poweron(struct generic_pm_domain *genpd, unsigned int depth)
185184 {
186185 struct gpd_link *link;
187186 int ret = 0;
@@ -196,11 +195,16 @@ static int __genpd_poweron(struct generic_pm_domain *genpd)
196195 * with it.
197196 */
198197 list_for_each_entry(link, &genpd->slave_links, slave_node) {
199- genpd_sd_counter_inc(link->master);
198+ struct generic_pm_domain *master = link->master;
199+
200+ genpd_sd_counter_inc(master);
201+
202+ mutex_lock_nested(&master->lock, depth + 1);
203+ ret = __genpd_poweron(master, depth + 1);
204+ mutex_unlock(&master->lock);
200205
201- ret = genpd_poweron(link->master);
202206 if (ret) {
203- genpd_sd_counter_dec(link->master);
207+ genpd_sd_counter_dec(master);
204208 goto err;
205209 }
206210 }
@@ -232,11 +236,12 @@ static int genpd_poweron(struct generic_pm_domain *genpd)
232236 int ret;
233237
234238 mutex_lock(&genpd->lock);
235- ret = __genpd_poweron(genpd);
239+ ret = __genpd_poweron(genpd, 0);
236240 mutex_unlock(&genpd->lock);
237241 return ret;
238242 }
239243
244+
240245 static int genpd_save_dev(struct generic_pm_domain *genpd, struct device *dev)
241246 {
242247 return GENPD_DEV_CALLBACK(genpd, int, save_state, dev);
@@ -484,7 +489,7 @@ static int pm_genpd_runtime_resume(struct device *dev)
484489 }
485490
486491 mutex_lock(&genpd->lock);
487- ret = __genpd_poweron(genpd);
492+ ret = __genpd_poweron(genpd, 0);
488493 mutex_unlock(&genpd->lock);
489494
490495 if (ret)
@@ -1339,8 +1344,8 @@ int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
13391344 if (!link)
13401345 return -ENOMEM;
13411346
1342- mutex_lock(&genpd->lock);
1343- mutex_lock_nested(&subdomain->lock, SINGLE_DEPTH_NESTING);
1347+ mutex_lock(&subdomain->lock);
1348+ mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
13441349
13451350 if (genpd->status == GPD_STATE_POWER_OFF
13461351 && subdomain->status != GPD_STATE_POWER_OFF) {
@@ -1363,8 +1368,8 @@ int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
13631368 genpd_sd_counter_inc(genpd);
13641369
13651370 out:
1366- mutex_unlock(&subdomain->lock);
13671371 mutex_unlock(&genpd->lock);
1372+ mutex_unlock(&subdomain->lock);
13681373 if (ret)
13691374 kfree(link);
13701375 return ret;
@@ -1385,7 +1390,8 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
13851390 if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(subdomain))
13861391 return -EINVAL;
13871392
1388- mutex_lock(&genpd->lock);
1393+ mutex_lock(&subdomain->lock);
1394+ mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
13891395
13901396 if (!list_empty(&subdomain->slave_links) || subdomain->device_count) {
13911397 pr_warn("%s: unable to remove subdomain %s\n", genpd->name,
@@ -1398,22 +1404,19 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
13981404 if (link->slave != subdomain)
13991405 continue;
14001406
1401- mutex_lock_nested(&subdomain->lock, SINGLE_DEPTH_NESTING);
1402-
14031407 list_del(&link->master_node);
14041408 list_del(&link->slave_node);
14051409 kfree(link);
14061410 if (subdomain->status != GPD_STATE_POWER_OFF)
14071411 genpd_sd_counter_dec(genpd);
14081412
1409- mutex_unlock(&subdomain->lock);
1410-
14111413 ret = 0;
14121414 break;
14131415 }
14141416
14151417 out:
14161418 mutex_unlock(&genpd->lock);
1419+ mutex_unlock(&subdomain->lock);
14171420
14181421 return ret;
14191422 }
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -142,15 +142,16 @@ static int allocate_resources(int cpu, struct device **cdev,
142142
143143 try_again:
144144 cpu_reg = regulator_get_optional(cpu_dev, reg);
145- if (IS_ERR(cpu_reg)) {
145+ ret = PTR_ERR_OR_ZERO(cpu_reg);
146+ if (ret) {
146147 /*
147148 * If cpu's regulator supply node is present, but regulator is
148149 * not yet registered, we should try defering probe.
149150 */
150- if (PTR_ERR(cpu_reg) == -EPROBE_DEFER) {
151+ if (ret == -EPROBE_DEFER) {
151152 dev_dbg(cpu_dev, "cpu%d regulator not ready, retry\n",
152153 cpu);
153- return -EPROBE_DEFER;
154+ return ret;
154155 }
155156
156157 /* Try with "cpu-supply" */
@@ -159,18 +160,16 @@ try_again:
159160 goto try_again;
160161 }
161162
162- dev_dbg(cpu_dev, "no regulator for cpu%d: %ld\n",
163- cpu, PTR_ERR(cpu_reg));
163+ dev_dbg(cpu_dev, "no regulator for cpu%d: %d\n", cpu, ret);
164164 }
165165
166166 cpu_clk = clk_get(cpu_dev, NULL);
167- if (IS_ERR(cpu_clk)) {
167+ ret = PTR_ERR_OR_ZERO(cpu_clk);
168+ if (ret) {
168169 /* put regulator */
169170 if (!IS_ERR(cpu_reg))
170171 regulator_put(cpu_reg);
171172
172- ret = PTR_ERR(cpu_clk);
173-
174173 /*
175174 * If cpu's clk node is present, but clock is not yet
176175 * registered, we should try defering probe.
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -48,11 +48,11 @@ static struct cpufreq_policy *next_policy(struct cpufreq_policy *policy,
4848 bool active)
4949 {
5050 do {
51- policy = list_next_entry(policy, policy_list);
52-
5351 /* No more policies in the list */
54- if (&policy->policy_list == &cpufreq_policy_list)
52+ if (list_is_last(&policy->policy_list, &cpufreq_policy_list))
5553 return NULL;
54+
55+ policy = list_next_entry(policy, policy_list);
5656 } while (!suitable_policy(policy, active));
5757
5858 return policy;
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
@@ -387,16 +387,18 @@ static int cpufreq_governor_init(struct cpufreq_policy *policy,
387387 if (!have_governor_per_policy())
388388 cdata->gdbs_data = dbs_data;
389389
390+ policy->governor_data = dbs_data;
391+
390392 ret = sysfs_create_group(get_governor_parent_kobj(policy),
391393 get_sysfs_attr(dbs_data));
392394 if (ret)
393395 goto reset_gdbs_data;
394396
395- policy->governor_data = dbs_data;
396-
397397 return 0;
398398
399399 reset_gdbs_data:
400+ policy->governor_data = NULL;
401+
400402 if (!have_governor_per_policy())
401403 cdata->gdbs_data = NULL;
402404 cdata->exit(dbs_data, !policy->governor->initialized);
@@ -417,16 +419,19 @@ static int cpufreq_governor_exit(struct cpufreq_policy *policy,
417419 if (!cdbs->shared || cdbs->shared->policy)
418420 return -EBUSY;
419421
420- policy->governor_data = NULL;
421422 if (!--dbs_data->usage_count) {
422423 sysfs_remove_group(get_governor_parent_kobj(policy),
423424 get_sysfs_attr(dbs_data));
424425
426+ policy->governor_data = NULL;
427+
425428 if (!have_governor_per_policy())
426429 cdata->gdbs_data = NULL;
427430
428431 cdata->exit(dbs_data, policy->governor->initialized == 1);
429432 kfree(dbs_data);
433+ } else {
434+ policy->governor_data = NULL;
430435 }
431436
432437 free_common_dbs_info(policy, cdata);
--- a/drivers/cpufreq/pxa2xx-cpufreq.c
+++ b/drivers/cpufreq/pxa2xx-cpufreq.c
@@ -202,7 +202,7 @@ static void __init pxa_cpufreq_init_voltages(void)
202202 }
203203 }
204204 #else
205-static int pxa_cpufreq_change_voltage(struct pxa_freqs *pxa_freq)
205+static int pxa_cpufreq_change_voltage(const struct pxa_freqs *pxa_freq)
206206 {
207207 return 0;
208208 }
--- a/drivers/cpuidle/coupled.c
+++ b/drivers/cpuidle/coupled.c
@@ -119,7 +119,6 @@ struct cpuidle_coupled {
119119
120120 #define CPUIDLE_COUPLED_NOT_IDLE (-1)
121121
122-static DEFINE_MUTEX(cpuidle_coupled_lock);
123122 static DEFINE_PER_CPU(struct call_single_data, cpuidle_coupled_poke_cb);
124123
125124 /*
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -153,7 +153,7 @@ int cpuidle_enter_freeze(struct cpuidle_driver *drv, struct cpuidle_device *dev)
153153 * be frozen safely.
154154 */
155155 index = find_deepest_state(drv, dev, UINT_MAX, 0, true);
156- if (index >= 0)
156+ if (index > 0)
157157 enter_freeze_proper(drv, dev, index);
158158
159159 return index;
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -953,8 +953,10 @@ int acpiphp_enable_slot(struct acpiphp_slot *slot)
953953 {
954954 pci_lock_rescan_remove();
955955
956- if (slot->flags & SLOT_IS_GOING_AWAY)
956+ if (slot->flags & SLOT_IS_GOING_AWAY) {
957+ pci_unlock_rescan_remove();
957958 return -ENODEV;
959+ }
958960
959961 /* configure all functions */
960962 if (!(slot->flags & SLOT_ENABLED))
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -235,7 +235,7 @@ config PM_TRACE_RTC
235235
236236 config APM_EMULATION
237237 tristate "Advanced Power Management Emulation"
238- depends on PM && SYS_SUPPORTS_APM_EMULATION
238+ depends on SYS_SUPPORTS_APM_EMULATION
239239 help
240240 APM is a BIOS specification for saving power using several different
241241 techniques. This is mostly useful for battery powered laptops with
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -162,7 +162,7 @@ static void cpuidle_idle_call(void)
162162 */
163163 if (idle_should_freeze()) {
164164 entered_state = cpuidle_enter_freeze(drv, dev);
165- if (entered_state >= 0) {
165+ if (entered_state > 0) {
166166 local_irq_enable();
167167 goto exit_idle;
168168 }