ACPI and power management fixes for 3.17-rc5

- Fix for the cpufreq Operation Performance Points (OPP) code
    where a recent commit added a kcalloc() call with an incorrect
    ordering of arguments.  From Anand Moon.
 
  - Reverts of two ACPI battery commits that caused incorrect
    diagnostic information to be printed to dmesg in some cases
    from Bjørn Mork.
 
  - Fix for the ACPI RTC operation region handler that applied the
    & operator to an argument already representing an address and
    that caused it to overwrite its own argument instead of writing
    to the address contained in it as expected.  From Chun-Yi Lee.
 
  - Fix for the PM domain implementation in the ACPI LPSS (Low-Power
    Subsystem) driver where one callback pointer pointed to a wrong
    routine and one was NULL, but it shouldn't.  From Fu Zhonghui.
 
 /
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCAAGBQJUEakAAAoJEILEb/54YlRxDfsQAJ6YUQ0ONNwzsKOEWs+Cvk45
 At8U7+qLsr6NEpU7Hr+HGmUrHrRsuSa3SKIWOXtTBIrBTGs12cEry8Wp4e9eTgrJ
 CWWn2LMKILqlOhjJI2xT33VVvEJu8+R1sccgv9mCqVNeQj+hwVc6iTe07jiNKJt9
 V8uWVaRu3IMNqOyq2Sd6IDH/uskF8PIPK39NZ/aZSQoKZzgv//ktfv4UjXmp/UcQ
 DiyajliRiRRXJ4meP399WpdWQ+EykfE6exOZIRj9qohvkXSL4aFmSHc69n7WQN7b
 9Jnkr1rRMbUJrfgstJKSFcY34pETLSl5iocwJJy8aijW9oQxt6Gfde2+HOU4KsJr
 9y0Mf4LYPsQ6t9q+JbxAeXXDgfT48Z1oKV3OYjXV05uo6OpRgA4cW/qbjRoQk0cD
 Egf5lB01VzRz56dAM/2oDtoZ7F7ajPFrlrqW+yy+Eo7A8auFQ05Ydgs9ZZ4TLP1Q
 3RJ2weBZpGpQSwRlxVZtsq0boeYVogMT8AINCLuvnz4WnUD6aDifPWZzIkr7HKGl
 1z8Vig9NgB2yWRyCdjx+dpaTNsWf1bnBNnOKaR0Wi36+GkXM0icjNwR/ho7Gxc7e
 oUS7hgt8s7bFbOZr1ns8ad+8DxVPpQRSp8/lD4Ge94n5G2A9q2+3jLMHcxeb+3vS
 vxkCLIzR4vsgIaENiiT9
 =FgS1
 -----END PGP SIGNATURE-----

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

Pull ACPI and power management fixes from Rafael Wysocki:
 "These are regression fixes (cpufreq, ACPI battery) and fixes for stuff
  that never worked correctly (ACPI RTC operation region handler and PM
  domain implementation in the ACPI LPSS driver).

  Specifics:

   - Fix for the cpufreq Operation Performance Points (OPP) code where a
     recent commit added a kcalloc() call with an incorrect ordering of
     arguments.  From Anand Moon.

   - Reverts of two ACPI battery commits that caused incorrect
     diagnostic information to be printed to dmesg in some cases from
     Bjørn Mork.

   - Fix for the ACPI RTC operation region handler that applied the &
     operator to an argument already representing an address and that
     caused it to overwrite its own argument instead of writing to the
     address contained in it as expected.  From Chun-Yi Lee.

   - Fix for the PM domain implementation in the ACPI LPSS (Low-Power
     Subsystem) driver where one callback pointer pointed to a wrong
     routine and one was NULL, but it shouldn't.  From Fu Zhonghui"

* tag 'pm+acpi-3.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI / LPSS: complete PM entries for LPSS power domain
  Revert "ACPI / battery: fix wrong value of capacity_now reported when fully charged"
  Revert "ACPI / battery: Fix warning message in acpi_battery_get_state()"
  ACPI / RTC: Fix CMOS RTC opregion handler accesses to wrong addresses
  cpufreq / OPP: Fix the order of arguments for kcalloc()
This commit is contained in:
Linus Torvalds 2014-09-11 12:51:10 -07:00
commit 8381e57a6e
4 changed files with 7 additions and 21 deletions

View file

@ -33,7 +33,7 @@ acpi_cmos_rtc_space_handler(u32 function, acpi_physical_address address,
void *handler_context, void *region_context)
{
int i;
u8 *value = (u8 *)&value64;
u8 *value = (u8 *)value64;
if (address > 0xff || !value64)
return AE_BAD_PARAMETER;

View file

@ -610,7 +610,7 @@ static int acpi_lpss_suspend_late(struct device *dev)
return acpi_dev_suspend_late(dev);
}
static int acpi_lpss_restore_early(struct device *dev)
static int acpi_lpss_resume_early(struct device *dev)
{
int ret = acpi_dev_resume_early(dev);
@ -650,15 +650,15 @@ static int acpi_lpss_runtime_resume(struct device *dev)
static struct dev_pm_domain acpi_lpss_pm_domain = {
.ops = {
#ifdef CONFIG_PM_SLEEP
.suspend_late = acpi_lpss_suspend_late,
.restore_early = acpi_lpss_restore_early,
.prepare = acpi_subsys_prepare,
.complete = acpi_subsys_complete,
.suspend = acpi_subsys_suspend,
.resume_early = acpi_subsys_resume_early,
.suspend_late = acpi_lpss_suspend_late,
.resume_early = acpi_lpss_resume_early,
.freeze = acpi_subsys_freeze,
.poweroff = acpi_subsys_suspend,
.poweroff_late = acpi_subsys_suspend_late,
.poweroff_late = acpi_lpss_suspend_late,
.restore_early = acpi_lpss_resume_early,
#endif
#ifdef CONFIG_PM_RUNTIME
.runtime_suspend = acpi_lpss_runtime_suspend,

View file

@ -534,20 +534,6 @@ static int acpi_battery_get_state(struct acpi_battery *battery)
" invalid.\n");
}
/*
* When fully charged, some batteries wrongly report
* capacity_now = design_capacity instead of = full_charge_capacity
*/
if (battery->capacity_now > battery->full_charge_capacity
&& battery->full_charge_capacity != ACPI_BATTERY_VALUE_UNKNOWN) {
if (battery->capacity_now != battery->design_capacity)
printk_once(KERN_WARNING FW_BUG
"battery: reported current charge level (%d) "
"is higher than reported maximum charge level (%d).\n",
battery->capacity_now, battery->full_charge_capacity);
battery->capacity_now = battery->full_charge_capacity;
}
if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags)
&& battery->capacity_now >= 0 && battery->capacity_now <= 100)
battery->capacity_now = (battery->capacity_now *

View file

@ -60,7 +60,7 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
goto out;
}
freq_table = kcalloc(sizeof(*freq_table), (max_opps + 1), GFP_ATOMIC);
freq_table = kcalloc((max_opps + 1), sizeof(*freq_table), GFP_ATOMIC);
if (!freq_table) {
ret = -ENOMEM;
goto out;