diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-09-11 15:51:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-09-11 15:51:10 -0400 |
commit | 8381e57a6e1969e103130418622d13dc579fbab3 (patch) | |
tree | 006794aa300b820d8c7883ef7b9f40d11ec04273 | |
parent | 1497e84a49dcfa36e478dbab8ad2212ebee9ba59 (diff) | |
parent | d2be8992df5d113a57374b7f654d667b8f9b32f4 (diff) |
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()
-rw-r--r-- | drivers/acpi/acpi_cmos_rtc.c | 2 | ||||
-rw-r--r-- | drivers/acpi/acpi_lpss.c | 10 | ||||
-rw-r--r-- | drivers/acpi/battery.c | 14 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq_opp.c | 2 |
4 files changed, 7 insertions, 21 deletions
diff --git a/drivers/acpi/acpi_cmos_rtc.c b/drivers/acpi/acpi_cmos_rtc.c index 2da8660262e5..81dc75033f15 100644 --- a/drivers/acpi/acpi_cmos_rtc.c +++ b/drivers/acpi/acpi_cmos_rtc.c | |||
@@ -33,7 +33,7 @@ acpi_cmos_rtc_space_handler(u32 function, acpi_physical_address address, | |||
33 | void *handler_context, void *region_context) | 33 | void *handler_context, void *region_context) |
34 | { | 34 | { |
35 | int i; | 35 | int i; |
36 | u8 *value = (u8 *)&value64; | 36 | u8 *value = (u8 *)value64; |
37 | 37 | ||
38 | if (address > 0xff || !value64) | 38 | if (address > 0xff || !value64) |
39 | return AE_BAD_PARAMETER; | 39 | return AE_BAD_PARAMETER; |
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index 9dfec48dd4e5..fddc1e86f9d0 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c | |||
@@ -610,7 +610,7 @@ static int acpi_lpss_suspend_late(struct device *dev) | |||
610 | return acpi_dev_suspend_late(dev); | 610 | return acpi_dev_suspend_late(dev); |
611 | } | 611 | } |
612 | 612 | ||
613 | static int acpi_lpss_restore_early(struct device *dev) | 613 | static int acpi_lpss_resume_early(struct device *dev) |
614 | { | 614 | { |
615 | int ret = acpi_dev_resume_early(dev); | 615 | int ret = acpi_dev_resume_early(dev); |
616 | 616 | ||
@@ -650,15 +650,15 @@ static int acpi_lpss_runtime_resume(struct device *dev) | |||
650 | static struct dev_pm_domain acpi_lpss_pm_domain = { | 650 | static struct dev_pm_domain acpi_lpss_pm_domain = { |
651 | .ops = { | 651 | .ops = { |
652 | #ifdef CONFIG_PM_SLEEP | 652 | #ifdef CONFIG_PM_SLEEP |
653 | .suspend_late = acpi_lpss_suspend_late, | ||
654 | .restore_early = acpi_lpss_restore_early, | ||
655 | .prepare = acpi_subsys_prepare, | 653 | .prepare = acpi_subsys_prepare, |
656 | .complete = acpi_subsys_complete, | 654 | .complete = acpi_subsys_complete, |
657 | .suspend = acpi_subsys_suspend, | 655 | .suspend = acpi_subsys_suspend, |
658 | .resume_early = acpi_subsys_resume_early, | 656 | .suspend_late = acpi_lpss_suspend_late, |
657 | .resume_early = acpi_lpss_resume_early, | ||
659 | .freeze = acpi_subsys_freeze, | 658 | .freeze = acpi_subsys_freeze, |
660 | .poweroff = acpi_subsys_suspend, | 659 | .poweroff = acpi_subsys_suspend, |
661 | .poweroff_late = acpi_subsys_suspend_late, | 660 | .poweroff_late = acpi_lpss_suspend_late, |
661 | .restore_early = acpi_lpss_resume_early, | ||
662 | #endif | 662 | #endif |
663 | #ifdef CONFIG_PM_RUNTIME | 663 | #ifdef CONFIG_PM_RUNTIME |
664 | .runtime_suspend = acpi_lpss_runtime_suspend, | 664 | .runtime_suspend = acpi_lpss_runtime_suspend, |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 1c162e7be045..5fdfe65fe165 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -534,20 +534,6 @@ static int acpi_battery_get_state(struct acpi_battery *battery) | |||
534 | " invalid.\n"); | 534 | " invalid.\n"); |
535 | } | 535 | } |
536 | 536 | ||
537 | /* | ||
538 | * When fully charged, some batteries wrongly report | ||
539 | * capacity_now = design_capacity instead of = full_charge_capacity | ||
540 | */ | ||
541 | if (battery->capacity_now > battery->full_charge_capacity | ||
542 | && battery->full_charge_capacity != ACPI_BATTERY_VALUE_UNKNOWN) { | ||
543 | if (battery->capacity_now != battery->design_capacity) | ||
544 | printk_once(KERN_WARNING FW_BUG | ||
545 | "battery: reported current charge level (%d) " | ||
546 | "is higher than reported maximum charge level (%d).\n", | ||
547 | battery->capacity_now, battery->full_charge_capacity); | ||
548 | battery->capacity_now = battery->full_charge_capacity; | ||
549 | } | ||
550 | |||
551 | if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags) | 537 | if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags) |
552 | && battery->capacity_now >= 0 && battery->capacity_now <= 100) | 538 | && battery->capacity_now >= 0 && battery->capacity_now <= 100) |
553 | battery->capacity_now = (battery->capacity_now * | 539 | battery->capacity_now = (battery->capacity_now * |
diff --git a/drivers/cpufreq/cpufreq_opp.c b/drivers/cpufreq/cpufreq_opp.c index f7a32d2326c6..773bcde893c0 100644 --- a/drivers/cpufreq/cpufreq_opp.c +++ b/drivers/cpufreq/cpufreq_opp.c | |||
@@ -60,7 +60,7 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev, | |||
60 | goto out; | 60 | goto out; |
61 | } | 61 | } |
62 | 62 | ||
63 | freq_table = kcalloc(sizeof(*freq_table), (max_opps + 1), GFP_ATOMIC); | 63 | freq_table = kcalloc((max_opps + 1), sizeof(*freq_table), GFP_ATOMIC); |
64 | if (!freq_table) { | 64 | if (!freq_table) { |
65 | ret = -ENOMEM; | 65 | ret = -ENOMEM; |
66 | goto out; | 66 | goto out; |