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

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

Pull ACPI and power management fixes from Rafael Wysocki:

- The resume part of user space driven hibernation (s2disk) is now
broken after the change that moved the creation of memory bitmaps to
after the freezing of tasks, because I forgot that the resume utility
loaded the image before freezing tasks and needed the bitmaps for
that. The fix adds special handling for that case.

- One of recent commits changed the export of acpi_bus_get_device() to
EXPORT_SYMBOL_GPL(), which was technically correct but broke existing
binary modules using that function including one in particularly
widespread use. Change it back to EXPORT_SYMBOL().

- The intel_pstate driver sometimes fails to disable turbo if its
no_turbo sysfs attribute is set. Fix from Srinivas Pandruvada.

- One of recent cpufreq fixes forgot to update a check in cpufreq-cpu0
which still (incorrectly) treats non-NULL as non-error. Fix from
Philipp Zabel.

- The SPEAr cpufreq driver uses a wrong variable type in one place
preventing it from catching errors returned by one of the functions
called by it. Fix from Sachin Kamat.

* tag 'pm+acpi-3.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI: Use EXPORT_SYMBOL() for acpi_bus_get_device()
intel_pstate: fix no_turbo
cpufreq: cpufreq-cpu0: NULL is a valid regulator, part 2
cpufreq: SPEAr: Fix incorrect variable type
PM / hibernate: Fix user space driven resume regression

+19 -5
+1 -1
drivers/acpi/scan.c
··· 968 968 } 969 969 return 0; 970 970 } 971 - EXPORT_SYMBOL_GPL(acpi_bus_get_device); 971 + EXPORT_SYMBOL(acpi_bus_get_device); 972 972 973 973 int acpi_device_add(struct acpi_device *device, 974 974 void (*release)(struct device *))
+1 -1
drivers/cpufreq/cpufreq-cpu0.c
··· 229 229 if (of_property_read_u32(np, "clock-latency", &transition_latency)) 230 230 transition_latency = CPUFREQ_ETERNAL; 231 231 232 - if (cpu_reg) { 232 + if (!IS_ERR(cpu_reg)) { 233 233 struct opp *opp; 234 234 unsigned long min_uV, max_uV; 235 235 int i;
+4 -1
drivers/cpufreq/intel_pstate.c
··· 394 394 trace_cpu_frequency(pstate * 100000, cpu->cpu); 395 395 396 396 cpu->pstate.current_pstate = pstate; 397 - wrmsrl(MSR_IA32_PERF_CTL, pstate << 8); 397 + if (limits.no_turbo) 398 + wrmsrl(MSR_IA32_PERF_CTL, BIT(32) | (pstate << 8)); 399 + else 400 + wrmsrl(MSR_IA32_PERF_CTL, pstate << 8); 398 401 399 402 } 400 403
+1 -1
drivers/cpufreq/spear-cpufreq.c
··· 113 113 unsigned int target_freq, unsigned int relation) 114 114 { 115 115 struct cpufreq_freqs freqs; 116 - unsigned long newfreq; 116 + long newfreq; 117 117 struct clk *srcclk; 118 118 int index, ret, mult = 1; 119 119
+4 -1
kernel/power/snapshot.c
··· 743 743 struct memory_bitmap *bm1, *bm2; 744 744 int error = 0; 745 745 746 - BUG_ON(forbidden_pages_map || free_pages_map); 746 + if (forbidden_pages_map && free_pages_map) 747 + return 0; 748 + else 749 + BUG_ON(forbidden_pages_map || free_pages_map); 747 750 748 751 bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL); 749 752 if (!bm1)
+8
kernel/power/user.c
··· 39 39 char frozen; 40 40 char ready; 41 41 char platform_support; 42 + bool free_bitmaps; 42 43 } snapshot_state; 43 44 44 45 atomic_t snapshot_device_available = ATOMIC_INIT(1); ··· 83 82 data->swap = -1; 84 83 data->mode = O_WRONLY; 85 84 error = pm_notifier_call_chain(PM_RESTORE_PREPARE); 85 + if (!error) { 86 + error = create_basic_memory_bitmaps(); 87 + data->free_bitmaps = !error; 88 + } 86 89 if (error) 87 90 pm_notifier_call_chain(PM_POST_RESTORE); 88 91 } ··· 116 111 pm_restore_gfp_mask(); 117 112 free_basic_memory_bitmaps(); 118 113 thaw_processes(); 114 + } else if (data->free_bitmaps) { 115 + free_basic_memory_bitmaps(); 119 116 } 120 117 pm_notifier_call_chain(data->mode == O_RDONLY ? 121 118 PM_POST_HIBERNATION : PM_POST_RESTORE); ··· 238 231 break; 239 232 pm_restore_gfp_mask(); 240 233 free_basic_memory_bitmaps(); 234 + data->free_bitmaps = false; 241 235 thaw_processes(); 242 236 data->frozen = 0; 243 237 break;