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

Merge branches 'pm-sleep', 'pm-cpufreq' and 'pm-cpuidle'

* pm-sleep:
Revert "PM / hibernate: avoid unsafe pages in e820 reserved regions"

* pm-cpufreq:
cpufreq: Schedule work for the first-online CPU on resume

* pm-cpuidle:
cpuidle: ACPI: do not overwrite name and description of C0
cpuidle: remove state_count field from struct cpuidle_device

+16 -35
+1 -1
drivers/acpi/processor_idle.c
··· 922 922 return -EINVAL; 923 923 924 924 drv->safe_state_index = -1; 925 - for (i = 0; i < CPUIDLE_STATE_MAX; i++) { 925 + for (i = CPUIDLE_DRIVER_STATE_START; i < CPUIDLE_STATE_MAX; i++) { 926 926 drv->states[i].name[0] = '\0'; 927 927 drv->states[i].desc[0] = '\0'; 928 928 }
+11 -8
drivers/cpufreq/cpufreq.c
··· 1698 1698 || __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS)) 1699 1699 pr_err("%s: Failed to start governor for policy: %p\n", 1700 1700 __func__, policy); 1701 - 1702 - /* 1703 - * schedule call cpufreq_update_policy() for boot CPU, i.e. last 1704 - * policy in list. It will verify that the current freq is in 1705 - * sync with what we believe it to be. 1706 - */ 1707 - if (list_is_last(&policy->policy_list, &cpufreq_policy_list)) 1708 - schedule_work(&policy->update); 1709 1701 } 1702 + 1703 + /* 1704 + * schedule call cpufreq_update_policy() for first-online CPU, as that 1705 + * wouldn't be hotplugged-out on suspend. It will verify that the 1706 + * current freq is in sync with what we believe it to be. 1707 + */ 1708 + policy = cpufreq_cpu_get_raw(cpumask_first(cpu_online_mask)); 1709 + if (WARN_ON(!policy)) 1710 + return; 1711 + 1712 + schedule_work(&policy->update); 1710 1713 } 1711 1714 1712 1715 /**
-3
drivers/cpuidle/cpuidle.c
··· 330 330 if (!dev->registered) 331 331 return -EINVAL; 332 332 333 - if (!dev->state_count) 334 - dev->state_count = drv->state_count; 335 - 336 333 ret = cpuidle_add_device_sysfs(dev); 337 334 if (ret) 338 335 return ret;
+3 -2
drivers/cpuidle/sysfs.c
··· 401 401 struct cpuidle_driver *drv = cpuidle_get_cpu_driver(device); 402 402 403 403 /* state statistics */ 404 - for (i = 0; i < device->state_count; i++) { 404 + for (i = 0; i < drv->state_count; i++) { 405 405 kobj = kzalloc(sizeof(struct cpuidle_state_kobj), GFP_KERNEL); 406 406 if (!kobj) 407 407 goto error_state; ··· 433 433 */ 434 434 static void cpuidle_remove_state_sysfs(struct cpuidle_device *device) 435 435 { 436 + struct cpuidle_driver *drv = cpuidle_get_cpu_driver(device); 436 437 int i; 437 438 438 - for (i = 0; i < device->state_count; i++) 439 + for (i = 0; i < drv->state_count; i++) 439 440 cpuidle_free_state_kobj(device, i); 440 441 } 441 442
-1
include/linux/cpuidle.h
··· 77 77 unsigned int cpu; 78 78 79 79 int last_residency; 80 - int state_count; 81 80 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX]; 82 81 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX]; 83 82 struct cpuidle_driver_kobj *kobj_driver;
+1 -20
kernel/power/snapshot.c
··· 955 955 } 956 956 } 957 957 958 - static bool is_nosave_page(unsigned long pfn) 959 - { 960 - struct nosave_region *region; 961 - 962 - list_for_each_entry(region, &nosave_regions, list) { 963 - if (pfn >= region->start_pfn && pfn < region->end_pfn) { 964 - pr_err("PM: %#010llx in e820 nosave region: " 965 - "[mem %#010llx-%#010llx]\n", 966 - (unsigned long long) pfn << PAGE_SHIFT, 967 - (unsigned long long) region->start_pfn << PAGE_SHIFT, 968 - ((unsigned long long) region->end_pfn << PAGE_SHIFT) 969 - - 1); 970 - return true; 971 - } 972 - } 973 - 974 - return false; 975 - } 976 - 977 958 /** 978 959 * create_basic_memory_bitmaps - create bitmaps needed for marking page 979 960 * frames that should not be saved and free page frames. The pointers ··· 2023 2042 do { 2024 2043 pfn = memory_bm_next_pfn(bm); 2025 2044 if (likely(pfn != BM_END_OF_MAP)) { 2026 - if (likely(pfn_valid(pfn)) && !is_nosave_page(pfn)) 2045 + if (likely(pfn_valid(pfn))) 2027 2046 swsusp_set_page_free(pfn_to_page(pfn)); 2028 2047 else 2029 2048 return -EFAULT;