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-3.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI and power management fixes from Rafael Wysocki:
"These are fixes mostly (ia64 regression related to the ACPI
enumeration of devices, cpufreq regressions, fix for I2C controllers
included in Intel SoCs, mvebu cpuidle driver fix related to sysfs)
plus additional kernel command line arguments from Kees to make it
possible to build kernel images with hibernation and the kernel
address space randomization included simultaneously, a new ACPI
battery driver quirk for a system with a broken BIOS and a couple of
ACPI core cleanups.

Specifics:

- Fix for an ia64 regression introduced during the 3.11 cycle by a
commit that modified the hardware initialization ordering and made
device discovery fail on some systems.

- Fix for a build problem on systems where the cpufreq-cpu0 driver is
built-in and the cpu-thermal driver is modular from Arnd Bergmann.

- Fix for a recently introduced computational mistake in the
intel_pstate driver that leads to excessive rounding errors from
Doug Smythies.

- Fix for a failure code path in cpufreq_update_policy() that fails
to unlock the locks acquired previously from Aaron Plattner.

- Fix for the cpuidle mvebu driver to use shorter state names which
will prevent the sysfs interface from returning mangled strings.
From Gregory Clement.

- ACPI LPSS driver fix to make sure that the I2C controllers included
in BayTrail SoCs are not held in the reset state while they are
being probed from Mika Westerberg.

- New kernel command line arguments making it possible to build
kernel images with hibernation and kASLR included at the same time
and to select which of them will be used via the command line (they
are still functionally mutually exclusive, though). From Kees
Cook.

- ACPI battery driver quirk for Acer Aspire V5-573G that fails to
send battery status change notifications timely from Alexander
Mezin.

- Two ACPI core cleanups from Christoph Jaeger and Fabian Frederick"

* tag 'pm+acpi-3.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
cpuidle: mvebu: Fix the name of the states
cpufreq: unlock when failing cpufreq_update_policy()
intel_pstate: Correct rounding in busy calculation
ACPI: use kstrto*() instead of simple_strto*()
ACPI / processor replace __attribute__((packed)) by __packed
ACPI / battery: add quirk for Acer Aspire V5-573G
ACPI / battery: use callback for setting up quirks
ACPI / LPSS: Take I2C host controllers out of reset
x86, kaslr: boot-time selectable with hibernation
PM / hibernate: introduce "nohibernate" boot parameter
cpufreq: cpufreq-cpu0: fix CPU_THERMAL dependency
ACPI / ia64 / sba_iommu: Restore the working initialization ordering

+168 -61
+10 -4
Documentation/kernel-parameters.txt
··· 1474 1474 js= [HW,JOY] Analog joystick 1475 1475 See Documentation/input/joystick.txt. 1476 1476 1477 + kaslr/nokaslr [X86] 1478 + Enable/disable kernel and module base offset ASLR 1479 + (Address Space Layout Randomization) if built into 1480 + the kernel. When CONFIG_HIBERNATION is selected, 1481 + kASLR is disabled by default. When kASLR is enabled, 1482 + hibernation will be disabled. 1483 + 1477 1484 keepinitrd [HW,ARM] 1478 1485 1479 1486 kernelcore=nn[KMG] [KNL,X86,IA-64,PPC] This parameter ··· 2117 2110 noapic [SMP,APIC] Tells the kernel to not make use of any 2118 2111 IOAPICs that may be present in the system. 2119 2112 2120 - nokaslr [X86] 2121 - Disable kernel and module base offset ASLR (Address 2122 - Space Layout Randomization) if built into the kernel. 2123 - 2124 2113 noautogroup Disable scheduler automatic task group creation. 2125 2114 2126 2115 nobats [PPC] Do not use BATs for mapping kernel lowmem ··· 2186 2183 interrupt wake-up latency, which may improve performance 2187 2184 in certain environments such as networked servers or 2188 2185 real-time systems. 2186 + 2187 + nohibernate [HIBERNATION] Disable hibernation and resume. 2189 2188 2190 2189 nohz= [KNL] Boottime enable/disable dynamic ticks 2191 2190 Valid arguments: on, off ··· 2985 2980 noresume Don't check if there's a hibernation image 2986 2981 present during boot. 2987 2982 nocompress Don't compress/decompress hibernation images. 2983 + no Disable hibernation and resume. 2988 2984 2989 2985 retain_initrd [RAM] Keep initrd memory after extraction 2990 2986
+37 -27
arch/ia64/hp/common/sba_iommu.c
··· 242 242 struct pci_dev *sac_only_dev; 243 243 }; 244 244 245 - static struct ioc *ioc_list; 245 + static struct ioc *ioc_list, *ioc_found; 246 246 static int reserve_sba_gart = 1; 247 247 248 248 static SBA_INLINE void sba_mark_invalid(struct ioc *, dma_addr_t, size_t); ··· 1809 1809 { SX2000_IOC_ID, "sx2000", NULL }, 1810 1810 }; 1811 1811 1812 - static struct ioc * 1813 - ioc_init(unsigned long hpa, void *handle) 1812 + static void ioc_init(unsigned long hpa, struct ioc *ioc) 1814 1813 { 1815 - struct ioc *ioc; 1816 1814 struct ioc_iommu *info; 1817 - 1818 - ioc = kzalloc(sizeof(*ioc), GFP_KERNEL); 1819 - if (!ioc) 1820 - return NULL; 1821 1815 1822 1816 ioc->next = ioc_list; 1823 1817 ioc_list = ioc; 1824 1818 1825 - ioc->handle = handle; 1826 1819 ioc->ioc_hpa = ioremap(hpa, 0x1000); 1827 1820 1828 1821 ioc->func_id = READ_REG(ioc->ioc_hpa + IOC_FUNC_ID); ··· 1856 1863 "%s %d.%d HPA 0x%lx IOVA space %dMb at 0x%lx\n", 1857 1864 ioc->name, (ioc->rev >> 4) & 0xF, ioc->rev & 0xF, 1858 1865 hpa, ioc->iov_size >> 20, ioc->ibase); 1859 - 1860 - return ioc; 1861 1866 } 1862 1867 1863 1868 ··· 2022 2031 #endif 2023 2032 } 2024 2033 2025 - static int 2026 - acpi_sba_ioc_add(struct acpi_device *device, 2027 - const struct acpi_device_id *not_used) 2034 + static void acpi_sba_ioc_add(struct ioc *ioc) 2028 2035 { 2029 - struct ioc *ioc; 2036 + acpi_handle handle = ioc->handle; 2030 2037 acpi_status status; 2031 2038 u64 hpa, length; 2032 2039 struct acpi_device_info *adi; 2033 2040 2034 - status = hp_acpi_csr_space(device->handle, &hpa, &length); 2041 + ioc_found = ioc->next; 2042 + status = hp_acpi_csr_space(handle, &hpa, &length); 2035 2043 if (ACPI_FAILURE(status)) 2036 - return 1; 2044 + goto err; 2037 2045 2038 - status = acpi_get_object_info(device->handle, &adi); 2046 + status = acpi_get_object_info(handle, &adi); 2039 2047 if (ACPI_FAILURE(status)) 2040 - return 1; 2048 + goto err; 2041 2049 2042 2050 /* 2043 2051 * For HWP0001, only SBA appears in ACPI namespace. It encloses the PCI ··· 2057 2067 if (!iovp_shift) 2058 2068 iovp_shift = 12; 2059 2069 2060 - ioc = ioc_init(hpa, device->handle); 2061 - if (!ioc) 2062 - return 1; 2063 - 2070 + ioc_init(hpa, ioc); 2064 2071 /* setup NUMA node association */ 2065 - sba_map_ioc_to_node(ioc, device->handle); 2066 - return 0; 2072 + sba_map_ioc_to_node(ioc, handle); 2073 + return; 2074 + 2075 + err: 2076 + kfree(ioc); 2067 2077 } 2068 2078 2069 2079 static const struct acpi_device_id hp_ioc_iommu_device_ids[] = { ··· 2071 2081 {"HWP0004", 0}, 2072 2082 {"", 0}, 2073 2083 }; 2084 + 2085 + static int acpi_sba_ioc_attach(struct acpi_device *device, 2086 + const struct acpi_device_id *not_used) 2087 + { 2088 + struct ioc *ioc; 2089 + 2090 + ioc = kzalloc(sizeof(*ioc), GFP_KERNEL); 2091 + if (!ioc) 2092 + return -ENOMEM; 2093 + 2094 + ioc->next = ioc_found; 2095 + ioc_found = ioc; 2096 + ioc->handle = device->handle; 2097 + return 1; 2098 + } 2099 + 2100 + 2074 2101 static struct acpi_scan_handler acpi_sba_ioc_handler = { 2075 2102 .ids = hp_ioc_iommu_device_ids, 2076 - .attach = acpi_sba_ioc_add, 2103 + .attach = acpi_sba_ioc_attach, 2077 2104 }; 2078 2105 2079 2106 static int __init acpi_sba_ioc_init_acpi(void) ··· 2125 2118 #endif 2126 2119 2127 2120 /* 2128 - * ioc_list should be populated by the acpi_sba_ioc_handler's .attach() 2121 + * ioc_found should be populated by the acpi_sba_ioc_handler's .attach() 2129 2122 * routine, but that only happens if acpi_scan_init() has already run. 2130 2123 */ 2124 + while (ioc_found) 2125 + acpi_sba_ioc_add(ioc_found); 2126 + 2131 2127 if (!ioc_list) { 2132 2128 #ifdef CONFIG_IA64_GENERIC 2133 2129 /*
-1
arch/x86/Kconfig
··· 1672 1672 config RANDOMIZE_BASE 1673 1673 bool "Randomize the address of the kernel image" 1674 1674 depends on RELOCATABLE 1675 - depends on !HIBERNATION 1676 1675 default n 1677 1676 ---help--- 1678 1677 Randomizes the physical and virtual address at which the
+9 -2
arch/x86/boot/compressed/aslr.c
··· 289 289 unsigned long choice = (unsigned long)output; 290 290 unsigned long random; 291 291 292 - if (cmdline_find_option_bool("nokaslr")) { 293 - debug_putstr("KASLR disabled...\n"); 292 + #ifdef CONFIG_HIBERNATION 293 + if (!cmdline_find_option_bool("kaslr")) { 294 + debug_putstr("KASLR disabled by default...\n"); 294 295 goto out; 295 296 } 297 + #else 298 + if (cmdline_find_option_bool("nokaslr")) { 299 + debug_putstr("KASLR disabled by cmdline...\n"); 300 + goto out; 301 + } 302 + #endif 296 303 297 304 /* Record the various known unsafe memory ranges. */ 298 305 mem_avoid_init((unsigned long)input, input_size,
+15
drivers/acpi/acpi_lpss.c
··· 34 34 35 35 /* Offsets relative to LPSS_PRIVATE_OFFSET */ 36 36 #define LPSS_CLK_DIVIDER_DEF_MASK (BIT(1) | BIT(16)) 37 + #define LPSS_RESETS 0x04 38 + #define LPSS_RESETS_RESET_FUNC BIT(0) 39 + #define LPSS_RESETS_RESET_APB BIT(1) 37 40 #define LPSS_GENERAL 0x08 38 41 #define LPSS_GENERAL_LTR_MODE_SW BIT(2) 39 42 #define LPSS_GENERAL_UART_RTS_OVRD BIT(3) ··· 100 97 offset = pdata->dev_desc->prv_offset + LPSS_GENERAL; 101 98 reg = readl(pdata->mmio_base + offset); 102 99 writel(reg | LPSS_GENERAL_UART_RTS_OVRD, pdata->mmio_base + offset); 100 + } 101 + 102 + static void lpss_i2c_setup(struct lpss_private_data *pdata) 103 + { 104 + unsigned int offset; 105 + u32 val; 106 + 107 + offset = pdata->dev_desc->prv_offset + LPSS_RESETS; 108 + val = readl(pdata->mmio_base + offset); 109 + val |= LPSS_RESETS_RESET_APB | LPSS_RESETS_RESET_FUNC; 110 + writel(val, pdata->mmio_base + offset); 103 111 } 104 112 105 113 static struct lpss_device_desc lpt_dev_desc = { ··· 185 171 .prv_offset = 0x800, 186 172 .save_ctx = true, 187 173 .shared_clock = &i2c_clock, 174 + .setup = lpss_i2c_setup, 188 175 }; 189 176 190 177 #else
+36 -3
drivers/acpi/battery.c
··· 32 32 #include <linux/jiffies.h> 33 33 #include <linux/async.h> 34 34 #include <linux/dmi.h> 35 + #include <linux/delay.h> 35 36 #include <linux/slab.h> 36 37 #include <linux/suspend.h> 37 38 #include <asm/unaligned.h> ··· 71 70 MODULE_LICENSE("GPL"); 72 71 73 72 static int battery_bix_broken_package; 73 + static int battery_notification_delay_ms; 74 74 static unsigned int cache_time = 1000; 75 75 module_param(cache_time, uint, 0644); 76 76 MODULE_PARM_DESC(cache_time, "cache time in milliseconds"); ··· 932 930 goto end; 933 931 } 934 932 alarm_string[count] = '\0'; 935 - battery->alarm = simple_strtol(alarm_string, NULL, 0); 933 + if (kstrtoint(alarm_string, 0, &battery->alarm)) { 934 + result = -EINVAL; 935 + goto end; 936 + } 936 937 result = acpi_battery_set_alarm(battery); 937 938 end: 938 939 if (!result) ··· 1067 1062 if (!battery) 1068 1063 return; 1069 1064 old = battery->bat.dev; 1065 + /* 1066 + * On Acer Aspire V5-573G notifications are sometimes triggered too 1067 + * early. For example, when AC is unplugged and notification is 1068 + * triggered, battery state is still reported as "Full", and changes to 1069 + * "Discharging" only after short delay, without any notification. 1070 + */ 1071 + if (battery_notification_delay_ms > 0) 1072 + msleep(battery_notification_delay_ms); 1070 1073 if (event == ACPI_BATTERY_NOTIFY_INFO) 1071 1074 acpi_battery_refresh(battery); 1072 1075 acpi_battery_update(battery, false); ··· 1119 1106 return 0; 1120 1107 } 1121 1108 1109 + static int battery_bix_broken_package_quirk(const struct dmi_system_id *d) 1110 + { 1111 + battery_bix_broken_package = 1; 1112 + return 0; 1113 + } 1114 + 1115 + static int battery_notification_delay_quirk(const struct dmi_system_id *d) 1116 + { 1117 + battery_notification_delay_ms = 1000; 1118 + return 0; 1119 + } 1120 + 1122 1121 static struct dmi_system_id bat_dmi_table[] = { 1123 1122 { 1123 + .callback = battery_bix_broken_package_quirk, 1124 1124 .ident = "NEC LZ750/LS", 1125 1125 .matches = { 1126 1126 DMI_MATCH(DMI_SYS_VENDOR, "NEC"), 1127 1127 DMI_MATCH(DMI_PRODUCT_NAME, "PC-LZ750LS"), 1128 + }, 1129 + }, 1130 + { 1131 + .callback = battery_notification_delay_quirk, 1132 + .ident = "Acer Aspire V5-573G", 1133 + .matches = { 1134 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1135 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire V5-573G"), 1128 1136 }, 1129 1137 }, 1130 1138 {}, ··· 1261 1227 if (acpi_disabled) 1262 1228 return; 1263 1229 1264 - if (dmi_check_system(bat_dmi_table)) 1265 - battery_bix_broken_package = 1; 1230 + dmi_check_system(bat_dmi_table); 1266 1231 1267 1232 #ifdef CONFIG_ACPI_PROCFS_POWER 1268 1233 acpi_battery_dir = acpi_lock_battery_dir();
+2 -1
drivers/acpi/osl.c
··· 235 235 static unsigned long acpi_rsdp; 236 236 static int __init setup_acpi_rsdp(char *arg) 237 237 { 238 - acpi_rsdp = simple_strtoul(arg, NULL, 16); 238 + if (kstrtoul(arg, 16, &acpi_rsdp)) 239 + return -EINVAL; 239 240 return 0; 240 241 } 241 242 early_param("acpi_rsdp", setup_acpi_rsdp);
+2 -1
drivers/acpi/tables.c
··· 360 360 if (!str) 361 361 return -EINVAL; 362 362 363 - acpi_apic_instance = simple_strtoul(str, NULL, 0); 363 + if (kstrtoint(str, 0, &acpi_apic_instance)) 364 + return -EINVAL; 364 365 365 366 pr_notice("Shall use APIC/MADT table %d\n", acpi_apic_instance); 366 367
+2
drivers/cpufreq/Kconfig
··· 186 186 config GENERIC_CPUFREQ_CPU0 187 187 tristate "Generic CPU0 cpufreq driver" 188 188 depends on HAVE_CLK && OF 189 + # if CPU_THERMAL is on and THERMAL=m, CPU0 cannot be =y: 190 + depends on !CPU_THERMAL || THERMAL 189 191 select PM_OPP 190 192 help 191 193 This adds a generic cpufreq driver for CPU0 frequency management.
+4 -6
drivers/cpufreq/cpufreq.c
··· 2242 2242 struct cpufreq_policy new_policy; 2243 2243 int ret; 2244 2244 2245 - if (!policy) { 2246 - ret = -ENODEV; 2247 - goto no_policy; 2248 - } 2245 + if (!policy) 2246 + return -ENODEV; 2249 2247 2250 2248 down_write(&policy->rwsem); 2251 2249 ··· 2262 2264 new_policy.cur = cpufreq_driver->get(cpu); 2263 2265 if (WARN_ON(!new_policy.cur)) { 2264 2266 ret = -EIO; 2265 - goto no_policy; 2267 + goto unlock; 2266 2268 } 2267 2269 2268 2270 if (!policy->cur) { ··· 2277 2279 2278 2280 ret = cpufreq_set_policy(policy, &new_policy); 2279 2281 2282 + unlock: 2280 2283 up_write(&policy->rwsem); 2281 2284 2282 2285 cpufreq_cpu_put(policy); 2283 - no_policy: 2284 2286 return ret; 2285 2287 } 2286 2288 EXPORT_SYMBOL(cpufreq_update_policy);
+1 -4
drivers/cpufreq/intel_pstate.c
··· 196 196 pid->last_err = fp_error; 197 197 198 198 result = pterm + mul_fp(pid->integral, pid->i_gain) + dterm; 199 - if (result >= 0) 200 - result = result + (1 << (FRAC_BITS-1)); 201 - else 202 - result = result - (1 << (FRAC_BITS-1)); 199 + result = result + (1 << (FRAC_BITS-1)); 203 200 return (signed int)fp_toint(result); 204 201 } 205 202
+2 -2
drivers/cpuidle/cpuidle-armada-370-xp.c
··· 55 55 .power_usage = 50, 56 56 .target_residency = 100, 57 57 .flags = CPUIDLE_FLAG_TIME_VALID, 58 - .name = "MV CPU IDLE", 58 + .name = "Idle", 59 59 .desc = "CPU power down", 60 60 }, 61 61 .states[2] = { ··· 65 65 .target_residency = 1000, 66 66 .flags = CPUIDLE_FLAG_TIME_VALID | 67 67 ARMADA_370_XP_FLAG_DEEP_IDLE, 68 - .name = "MV CPU DEEP IDLE", 68 + .name = "Deep idle", 69 69 .desc = "CPU and L2 Fabric power down", 70 70 }, 71 71 .state_count = ARMADA_370_XP_MAX_STATES,
+5 -5
include/acpi/processor.h
··· 53 53 u8 bit_offset; 54 54 u8 access_size; 55 55 u64 address; 56 - } __attribute__ ((packed)); 56 + } __packed; 57 57 58 58 struct acpi_processor_cx { 59 59 u8 valid; ··· 83 83 u64 domain; 84 84 u64 coord_type; 85 85 u64 num_processors; 86 - } __attribute__ ((packed)); 86 + } __packed; 87 87 88 88 struct acpi_pct_register { 89 89 u8 descriptor; ··· 93 93 u8 bit_offset; 94 94 u8 reserved; 95 95 u64 address; 96 - } __attribute__ ((packed)); 96 + } __packed; 97 97 98 98 struct acpi_processor_px { 99 99 u64 core_frequency; /* megahertz */ ··· 124 124 u64 domain; 125 125 u64 coord_type; 126 126 u64 num_processors; 127 - } __attribute__ ((packed)); 127 + } __packed; 128 128 129 129 struct acpi_ptc_register { 130 130 u8 descriptor; ··· 134 134 u8 bit_offset; 135 135 u8 reserved; 136 136 u64 address; 137 - } __attribute__ ((packed)); 137 + } __packed; 138 138 139 139 struct acpi_processor_tx_tss { 140 140 u64 freqpercentage; /* */
+2
include/linux/suspend.h
··· 327 327 extern void hibernation_set_ops(const struct platform_hibernation_ops *ops); 328 328 extern int hibernate(void); 329 329 extern bool system_entering_hibernation(void); 330 + extern bool hibernation_available(void); 330 331 asmlinkage int swsusp_save(void); 331 332 extern struct pbe *restore_pblist; 332 333 #else /* CONFIG_HIBERNATION */ ··· 340 339 static inline void hibernation_set_ops(const struct platform_hibernation_ops *ops) {} 341 340 static inline int hibernate(void) { return -ENOSYS; } 342 341 static inline bool system_entering_hibernation(void) { return false; } 342 + static inline bool hibernation_available(void) { return false; } 343 343 #endif /* CONFIG_HIBERNATION */ 344 344 345 345 /* Hibernation and suspend events */
+36 -1
kernel/power/hibernate.c
··· 35 35 36 36 static int nocompress; 37 37 static int noresume; 38 + static int nohibernate; 38 39 static int resume_wait; 39 40 static unsigned int resume_delay; 40 41 static char resume_file[256] = CONFIG_PM_STD_PARTITION; ··· 62 61 bool freezer_test_done; 63 62 64 63 static const struct platform_hibernation_ops *hibernation_ops; 64 + 65 + bool hibernation_available(void) 66 + { 67 + return (nohibernate == 0); 68 + } 65 69 66 70 /** 67 71 * hibernation_set_ops - Set the global hibernate operations. ··· 648 642 { 649 643 int error; 650 644 645 + if (!hibernation_available()) { 646 + pr_debug("PM: Hibernation not available.\n"); 647 + return -EPERM; 648 + } 649 + 651 650 lock_system_sleep(); 652 651 /* The snapshot device should not be opened while we're running */ 653 652 if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { ··· 745 734 /* 746 735 * If the user said "noresume".. bail out early. 747 736 */ 748 - if (noresume) 737 + if (noresume || !hibernation_available()) 749 738 return 0; 750 739 751 740 /* ··· 911 900 int i; 912 901 char *start = buf; 913 902 903 + if (!hibernation_available()) 904 + return sprintf(buf, "[disabled]\n"); 905 + 914 906 for (i = HIBERNATION_FIRST; i <= HIBERNATION_MAX; i++) { 915 907 if (!hibernation_modes[i]) 916 908 continue; ··· 947 933 int len; 948 934 char *p; 949 935 int mode = HIBERNATION_INVALID; 936 + 937 + if (!hibernation_available()) 938 + return -EPERM; 950 939 951 940 p = memchr(buf, '\n', n); 952 941 len = p ? p - buf : n; ··· 1118 1101 noresume = 1; 1119 1102 else if (!strncmp(str, "nocompress", 10)) 1120 1103 nocompress = 1; 1104 + else if (!strncmp(str, "no", 2)) { 1105 + noresume = 1; 1106 + nohibernate = 1; 1107 + } 1121 1108 return 1; 1122 1109 } 1123 1110 ··· 1146 1125 return 1; 1147 1126 } 1148 1127 1128 + static int __init nohibernate_setup(char *str) 1129 + { 1130 + noresume = 1; 1131 + nohibernate = 1; 1132 + return 1; 1133 + } 1134 + 1135 + static int __init kaslr_nohibernate_setup(char *str) 1136 + { 1137 + return nohibernate_setup(str); 1138 + } 1139 + 1149 1140 __setup("noresume", noresume_setup); 1150 1141 __setup("resume_offset=", resume_offset_setup); 1151 1142 __setup("resume=", resume_setup); 1152 1143 __setup("hibernate=", hibernate_setup); 1153 1144 __setup("resumewait", resumewait_setup); 1154 1145 __setup("resumedelay=", resumedelay_setup); 1146 + __setup("nohibernate", nohibernate_setup); 1147 + __setup("kaslr", kaslr_nohibernate_setup);
+2 -4
kernel/power/main.c
··· 300 300 s += sprintf(s,"%s ", pm_states[i].label); 301 301 302 302 #endif 303 - #ifdef CONFIG_HIBERNATION 304 - s += sprintf(s, "%s\n", "disk"); 305 - #else 303 + if (hibernation_available()) 304 + s += sprintf(s, "disk "); 306 305 if (s != buf) 307 306 /* convert the last space to a newline */ 308 307 *(s-1) = '\n'; 309 - #endif 310 308 return (s - buf); 311 309 } 312 310
+3
kernel/power/user.c
··· 49 49 struct snapshot_data *data; 50 50 int error; 51 51 52 + if (!hibernation_available()) 53 + return -EPERM; 54 + 52 55 lock_system_sleep(); 53 56 54 57 if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {