Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull power management and ACPI fixes from Rafael Wysocki:
"Fixes for problems introduced or discovered recently (intel_pstate,
sti-cpufreq, ARM64 cpuidle, Operating Performance Points framework,
generic device properties framework) and one fix for a hotplug-related
deadlock in ACPICA that's been there forever, but is nasty enough.

Specifics:

- Fix for a recent regression in the intel_pstate driver causing it
to fail to restore the HWP (HW-managed P-states) configuration of
the boot CPU after suspend-to-RAM (Rafael Wysocki).

- Fix for two recent regressions in the intel_pstate driver, one that
can trigger a divide by zero if the driver is accessed via sysfs
before it manages to take the first sample and one causing it to
fail to update a structure field used in a trace point, so the
information coming from it is less useful (Rafael Wysocki).

- Fix for a problem in the sti-cpufreq driver introduced during the
4.5 cycle that causes it to break CPU PM in multi-platform kernels
by registering cpufreq-dt (which subsequently doesn't work)
unconditionally and preventing the driver that would actually work
from registering (Sudeep Holla).

- Stable-candidate fix for an ARM64 cpuidle issue causing idle state
usage counters to be incorrectly updated for idle states that were
not entered due to errors (James Morse).

- Fix for a recently introduced issue in the OPP (Operating
Performance Points) framework causing it to print bogus error
messages for missing optional regulators (Viresh Kumar).

- Fix for a recently introduced issue in the generic device
properties framework that may cause it to attempt to dereferece and
invalid pointer in some cases (Heikki Krogerus).

- Fix for a deadlock in the ACPICA core that may be triggered by
device (eg Thunderbolt) hotplug (Prarit Bhargava)"

* tag 'pm+acpi-4.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
PM / OPP: Remove useless check
ACPICA: Dispatcher: Update thread ID for recursive method calls
intel_pstate: Fix intel_pstate_get()
cpufreq: intel_pstate: Fix HWP on boot CPU after system resume
cpufreq: st: enable selective initialization based on the platform
ARM: cpuidle: Pass on arm_cpuidle_suspend()'s return value
device property: Avoid potential dereferences of invalid pointers

+45 -27
+3
drivers/acpi/acpica/dsmethod.c
··· 428 428 obj_desc->method.mutex->mutex. 429 429 original_sync_level = 430 430 obj_desc->method.mutex->mutex.sync_level; 431 + 432 + obj_desc->method.mutex->mutex.thread_id = 433 + acpi_os_get_thread_id(); 431 434 } 432 435 } 433 436
-3
drivers/base/power/opp/core.c
··· 259 259 reg = opp_table->regulator; 260 260 if (IS_ERR(reg)) { 261 261 /* Regulator may not be required for device */ 262 - if (reg) 263 - dev_err(dev, "%s: Invalid regulator (%ld)\n", __func__, 264 - PTR_ERR(reg)); 265 262 rcu_read_unlock(); 266 263 return 0; 267 264 }
+1 -1
drivers/base/property.c
··· 21 21 22 22 static inline bool is_pset_node(struct fwnode_handle *fwnode) 23 23 { 24 - return fwnode && fwnode->type == FWNODE_PDATA; 24 + return !IS_ERR_OR_NULL(fwnode) && fwnode->type == FWNODE_PDATA; 25 25 } 26 26 27 27 static inline struct property_set *to_pset_node(struct fwnode_handle *fwnode)
+15 -11
drivers/cpufreq/cpufreq.c
··· 1557 1557 if (!cpufreq_driver) 1558 1558 return; 1559 1559 1560 - if (!has_target()) 1560 + if (!has_target() && !cpufreq_driver->suspend) 1561 1561 goto suspend; 1562 1562 1563 1563 pr_debug("%s: Suspending Governors\n", __func__); 1564 1564 1565 1565 for_each_active_policy(policy) { 1566 - down_write(&policy->rwsem); 1567 - ret = cpufreq_governor(policy, CPUFREQ_GOV_STOP); 1568 - up_write(&policy->rwsem); 1566 + if (has_target()) { 1567 + down_write(&policy->rwsem); 1568 + ret = cpufreq_governor(policy, CPUFREQ_GOV_STOP); 1569 + up_write(&policy->rwsem); 1569 1570 1570 - if (ret) 1571 - pr_err("%s: Failed to stop governor for policy: %p\n", 1572 - __func__, policy); 1573 - else if (cpufreq_driver->suspend 1574 - && cpufreq_driver->suspend(policy)) 1571 + if (ret) { 1572 + pr_err("%s: Failed to stop governor for policy: %p\n", 1573 + __func__, policy); 1574 + continue; 1575 + } 1576 + } 1577 + 1578 + if (cpufreq_driver->suspend && cpufreq_driver->suspend(policy)) 1575 1579 pr_err("%s: Failed to suspend driver: %p\n", __func__, 1576 1580 policy); 1577 1581 } ··· 1600 1596 1601 1597 cpufreq_suspended = false; 1602 1598 1603 - if (!has_target()) 1599 + if (!has_target() && !cpufreq_driver->resume) 1604 1600 return; 1605 1601 1606 1602 pr_debug("%s: Resuming Governors\n", __func__); ··· 1609 1605 if (cpufreq_driver->resume && cpufreq_driver->resume(policy)) { 1610 1606 pr_err("%s: Failed to resume driver: %p\n", __func__, 1611 1607 policy); 1612 - } else { 1608 + } else if (has_target()) { 1613 1609 down_write(&policy->rwsem); 1614 1610 ret = cpufreq_start_governor(policy); 1615 1611 up_write(&policy->rwsem);
+18 -8
drivers/cpufreq/intel_pstate.c
··· 453 453 } 454 454 } 455 455 456 + static int intel_pstate_hwp_set_policy(struct cpufreq_policy *policy) 457 + { 458 + if (hwp_active) 459 + intel_pstate_hwp_set(policy->cpus); 460 + 461 + return 0; 462 + } 463 + 456 464 static void intel_pstate_hwp_set_online_cpus(void) 457 465 { 458 466 get_online_cpus(); ··· 1070 1062 1071 1063 static inline int32_t get_avg_frequency(struct cpudata *cpu) 1072 1064 { 1073 - return div64_u64(cpu->pstate.max_pstate_physical * cpu->sample.aperf * 1074 - cpu->pstate.scaling, cpu->sample.mperf); 1065 + return fp_toint(mul_fp(cpu->sample.core_pct_busy, 1066 + int_tofp(cpu->pstate.max_pstate_physical * 1067 + cpu->pstate.scaling / 100))); 1075 1068 } 1076 1069 1077 1070 static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu) ··· 1114 1105 { 1115 1106 int32_t core_busy, max_pstate, current_pstate, sample_ratio; 1116 1107 u64 duration_ns; 1117 - 1118 - intel_pstate_calc_busy(cpu); 1119 1108 1120 1109 /* 1121 1110 * core_busy is the ratio of actual performance to max ··· 1198 1191 if ((s64)delta_ns >= pid_params.sample_rate_ns) { 1199 1192 bool sample_taken = intel_pstate_sample(cpu, time); 1200 1193 1201 - if (sample_taken && !hwp_active) 1202 - intel_pstate_adjust_busy_pstate(cpu); 1194 + if (sample_taken) { 1195 + intel_pstate_calc_busy(cpu); 1196 + if (!hwp_active) 1197 + intel_pstate_adjust_busy_pstate(cpu); 1198 + } 1203 1199 } 1204 1200 } 1205 1201 ··· 1356 1346 out: 1357 1347 intel_pstate_set_update_util_hook(policy->cpu); 1358 1348 1359 - if (hwp_active) 1360 - intel_pstate_hwp_set(policy->cpus); 1349 + intel_pstate_hwp_set_policy(policy); 1361 1350 1362 1351 return 0; 1363 1352 } ··· 1420 1411 .flags = CPUFREQ_CONST_LOOPS, 1421 1412 .verify = intel_pstate_verify_policy, 1422 1413 .setpolicy = intel_pstate_set_policy, 1414 + .resume = intel_pstate_hwp_set_policy, 1423 1415 .get = intel_pstate_get, 1424 1416 .init = intel_pstate_cpu_init, 1425 1417 .stop_cpu = intel_pstate_stop_cpu,
+4
drivers/cpufreq/sti-cpufreq.c
··· 259 259 { 260 260 int ret; 261 261 262 + if ((!of_machine_is_compatible("st,stih407")) && 263 + (!of_machine_is_compatible("st,stih410"))) 264 + return -ENODEV; 265 + 262 266 ddata.cpu = get_cpu_device(0); 263 267 if (!ddata.cpu) { 264 268 dev_err(ddata.cpu, "Failed to get device for CPU0\n");
+1 -1
drivers/cpuidle/cpuidle-arm.c
··· 50 50 * call the CPU ops suspend protocol with idle index as a 51 51 * parameter. 52 52 */ 53 - arm_cpuidle_suspend(idx); 53 + ret = arm_cpuidle_suspend(idx); 54 54 55 55 cpu_pm_exit(); 56 56 }
+2 -2
include/acpi/acpi_bus.h
··· 394 394 395 395 static inline bool is_acpi_node(struct fwnode_handle *fwnode) 396 396 { 397 - return fwnode && (fwnode->type == FWNODE_ACPI 397 + return !IS_ERR_OR_NULL(fwnode) && (fwnode->type == FWNODE_ACPI 398 398 || fwnode->type == FWNODE_ACPI_DATA); 399 399 } 400 400 401 401 static inline bool is_acpi_device_node(struct fwnode_handle *fwnode) 402 402 { 403 - return fwnode && fwnode->type == FWNODE_ACPI; 403 + return !IS_ERR_OR_NULL(fwnode) && fwnode->type == FWNODE_ACPI; 404 404 } 405 405 406 406 static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
+1 -1
include/linux/of.h
··· 133 133 134 134 static inline bool is_of_node(struct fwnode_handle *fwnode) 135 135 { 136 - return fwnode && fwnode->type == FWNODE_OF; 136 + return !IS_ERR_OR_NULL(fwnode) && fwnode->type == FWNODE_OF; 137 137 } 138 138 139 139 static inline struct device_node *to_of_node(struct fwnode_handle *fwnode)