diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-20 00:58:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-20 00:58:57 -0400 |
commit | 3c8fb50445833b93f69b6b703a29aae3523cad0c (patch) | |
tree | b865e35364eb5dd68ca29bcab1775fb6c01a3263 /arch | |
parent | 4ef61076f849ce13af88670f7362a5c9477c2747 (diff) | |
parent | 2ba87ea132a7364dbeb71126f3d7b8ec8e59d0e9 (diff) |
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
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ia64/hp/common/sba_iommu.c | 64 | ||||
-rw-r--r-- | arch/x86/Kconfig | 1 | ||||
-rw-r--r-- | arch/x86/boot/compressed/aslr.c | 9 |
3 files changed, 45 insertions, 29 deletions
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index 1a871b78e570..344387a55406 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c | |||
@@ -242,7 +242,7 @@ struct ioc { | |||
242 | struct pci_dev *sac_only_dev; | 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 | static int reserve_sba_gart = 1; | 246 | static int reserve_sba_gart = 1; |
247 | 247 | ||
248 | static SBA_INLINE void sba_mark_invalid(struct ioc *, dma_addr_t, size_t); | 248 | static SBA_INLINE void sba_mark_invalid(struct ioc *, dma_addr_t, size_t); |
@@ -1809,20 +1809,13 @@ static struct ioc_iommu ioc_iommu_info[] __initdata = { | |||
1809 | { SX2000_IOC_ID, "sx2000", NULL }, | 1809 | { SX2000_IOC_ID, "sx2000", NULL }, |
1810 | }; | 1810 | }; |
1811 | 1811 | ||
1812 | static struct ioc * | 1812 | static void ioc_init(unsigned long hpa, struct ioc *ioc) |
1813 | ioc_init(unsigned long hpa, void *handle) | ||
1814 | { | 1813 | { |
1815 | struct ioc *ioc; | ||
1816 | struct ioc_iommu *info; | 1814 | struct ioc_iommu *info; |
1817 | 1815 | ||
1818 | ioc = kzalloc(sizeof(*ioc), GFP_KERNEL); | ||
1819 | if (!ioc) | ||
1820 | return NULL; | ||
1821 | |||
1822 | ioc->next = ioc_list; | 1816 | ioc->next = ioc_list; |
1823 | ioc_list = ioc; | 1817 | ioc_list = ioc; |
1824 | 1818 | ||
1825 | ioc->handle = handle; | ||
1826 | ioc->ioc_hpa = ioremap(hpa, 0x1000); | 1819 | ioc->ioc_hpa = ioremap(hpa, 0x1000); |
1827 | 1820 | ||
1828 | ioc->func_id = READ_REG(ioc->ioc_hpa + IOC_FUNC_ID); | 1821 | ioc->func_id = READ_REG(ioc->ioc_hpa + IOC_FUNC_ID); |
@@ -1863,8 +1856,6 @@ ioc_init(unsigned long hpa, void *handle) | |||
1863 | "%s %d.%d HPA 0x%lx IOVA space %dMb at 0x%lx\n", | 1856 | "%s %d.%d HPA 0x%lx IOVA space %dMb at 0x%lx\n", |
1864 | ioc->name, (ioc->rev >> 4) & 0xF, ioc->rev & 0xF, | 1857 | ioc->name, (ioc->rev >> 4) & 0xF, ioc->rev & 0xF, |
1865 | hpa, ioc->iov_size >> 20, ioc->ibase); | 1858 | hpa, ioc->iov_size >> 20, ioc->ibase); |
1866 | |||
1867 | return ioc; | ||
1868 | } | 1859 | } |
1869 | 1860 | ||
1870 | 1861 | ||
@@ -2031,22 +2022,21 @@ sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle) | |||
2031 | #endif | 2022 | #endif |
2032 | } | 2023 | } |
2033 | 2024 | ||
2034 | static int | 2025 | static void acpi_sba_ioc_add(struct ioc *ioc) |
2035 | acpi_sba_ioc_add(struct acpi_device *device, | ||
2036 | const struct acpi_device_id *not_used) | ||
2037 | { | 2026 | { |
2038 | struct ioc *ioc; | 2027 | acpi_handle handle = ioc->handle; |
2039 | acpi_status status; | 2028 | acpi_status status; |
2040 | u64 hpa, length; | 2029 | u64 hpa, length; |
2041 | struct acpi_device_info *adi; | 2030 | struct acpi_device_info *adi; |
2042 | 2031 | ||
2043 | status = hp_acpi_csr_space(device->handle, &hpa, &length); | 2032 | ioc_found = ioc->next; |
2033 | status = hp_acpi_csr_space(handle, &hpa, &length); | ||
2044 | if (ACPI_FAILURE(status)) | 2034 | if (ACPI_FAILURE(status)) |
2045 | return 1; | 2035 | goto err; |
2046 | 2036 | ||
2047 | status = acpi_get_object_info(device->handle, &adi); | 2037 | status = acpi_get_object_info(handle, &adi); |
2048 | if (ACPI_FAILURE(status)) | 2038 | if (ACPI_FAILURE(status)) |
2049 | return 1; | 2039 | goto err; |
2050 | 2040 | ||
2051 | /* | 2041 | /* |
2052 | * For HWP0001, only SBA appears in ACPI namespace. It encloses the PCI | 2042 | * For HWP0001, only SBA appears in ACPI namespace. It encloses the PCI |
@@ -2067,13 +2057,13 @@ acpi_sba_ioc_add(struct acpi_device *device, | |||
2067 | if (!iovp_shift) | 2057 | if (!iovp_shift) |
2068 | iovp_shift = 12; | 2058 | iovp_shift = 12; |
2069 | 2059 | ||
2070 | ioc = ioc_init(hpa, device->handle); | 2060 | ioc_init(hpa, ioc); |
2071 | if (!ioc) | ||
2072 | return 1; | ||
2073 | |||
2074 | /* setup NUMA node association */ | 2061 | /* setup NUMA node association */ |
2075 | sba_map_ioc_to_node(ioc, device->handle); | 2062 | sba_map_ioc_to_node(ioc, handle); |
2076 | return 0; | 2063 | return; |
2064 | |||
2065 | err: | ||
2066 | kfree(ioc); | ||
2077 | } | 2067 | } |
2078 | 2068 | ||
2079 | static const struct acpi_device_id hp_ioc_iommu_device_ids[] = { | 2069 | static const struct acpi_device_id hp_ioc_iommu_device_ids[] = { |
@@ -2081,9 +2071,26 @@ static const struct acpi_device_id hp_ioc_iommu_device_ids[] = { | |||
2081 | {"HWP0004", 0}, | 2071 | {"HWP0004", 0}, |
2082 | {"", 0}, | 2072 | {"", 0}, |
2083 | }; | 2073 | }; |
2074 | |||
2075 | static int acpi_sba_ioc_attach(struct acpi_device *device, | ||
2076 | const struct acpi_device_id *not_used) | ||
2077 | { | ||
2078 | struct ioc *ioc; | ||
2079 | |||
2080 | ioc = kzalloc(sizeof(*ioc), GFP_KERNEL); | ||
2081 | if (!ioc) | ||
2082 | return -ENOMEM; | ||
2083 | |||
2084 | ioc->next = ioc_found; | ||
2085 | ioc_found = ioc; | ||
2086 | ioc->handle = device->handle; | ||
2087 | return 1; | ||
2088 | } | ||
2089 | |||
2090 | |||
2084 | static struct acpi_scan_handler acpi_sba_ioc_handler = { | 2091 | static struct acpi_scan_handler acpi_sba_ioc_handler = { |
2085 | .ids = hp_ioc_iommu_device_ids, | 2092 | .ids = hp_ioc_iommu_device_ids, |
2086 | .attach = acpi_sba_ioc_add, | 2093 | .attach = acpi_sba_ioc_attach, |
2087 | }; | 2094 | }; |
2088 | 2095 | ||
2089 | static int __init acpi_sba_ioc_init_acpi(void) | 2096 | static int __init acpi_sba_ioc_init_acpi(void) |
@@ -2118,9 +2125,12 @@ sba_init(void) | |||
2118 | #endif | 2125 | #endif |
2119 | 2126 | ||
2120 | /* | 2127 | /* |
2121 | * ioc_list should be populated by the acpi_sba_ioc_handler's .attach() | 2128 | * ioc_found should be populated by the acpi_sba_ioc_handler's .attach() |
2122 | * routine, but that only happens if acpi_scan_init() has already run. | 2129 | * routine, but that only happens if acpi_scan_init() has already run. |
2123 | */ | 2130 | */ |
2131 | while (ioc_found) | ||
2132 | acpi_sba_ioc_add(ioc_found); | ||
2133 | |||
2124 | if (!ioc_list) { | 2134 | if (!ioc_list) { |
2125 | #ifdef CONFIG_IA64_GENERIC | 2135 | #ifdef CONFIG_IA64_GENERIC |
2126 | /* | 2136 | /* |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index fcefdda5136d..a8f749ef0fdc 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -1672,7 +1672,6 @@ config RELOCATABLE | |||
1672 | config RANDOMIZE_BASE | 1672 | config RANDOMIZE_BASE |
1673 | bool "Randomize the address of the kernel image" | 1673 | bool "Randomize the address of the kernel image" |
1674 | depends on RELOCATABLE | 1674 | depends on RELOCATABLE |
1675 | depends on !HIBERNATION | ||
1676 | default n | 1675 | default n |
1677 | ---help--- | 1676 | ---help--- |
1678 | Randomizes the physical and virtual address at which the | 1677 | Randomizes the physical and virtual address at which the |
diff --git a/arch/x86/boot/compressed/aslr.c b/arch/x86/boot/compressed/aslr.c index 4dbf967da50d..fc6091abedb7 100644 --- a/arch/x86/boot/compressed/aslr.c +++ b/arch/x86/boot/compressed/aslr.c | |||
@@ -289,10 +289,17 @@ unsigned char *choose_kernel_location(unsigned char *input, | |||
289 | unsigned long choice = (unsigned long)output; | 289 | unsigned long choice = (unsigned long)output; |
290 | unsigned long random; | 290 | unsigned long random; |
291 | 291 | ||
292 | #ifdef CONFIG_HIBERNATION | ||
293 | if (!cmdline_find_option_bool("kaslr")) { | ||
294 | debug_putstr("KASLR disabled by default...\n"); | ||
295 | goto out; | ||
296 | } | ||
297 | #else | ||
292 | if (cmdline_find_option_bool("nokaslr")) { | 298 | if (cmdline_find_option_bool("nokaslr")) { |
293 | debug_putstr("KASLR disabled...\n"); | 299 | debug_putstr("KASLR disabled by cmdline...\n"); |
294 | goto out; | 300 | goto out; |
295 | } | 301 | } |
302 | #endif | ||
296 | 303 | ||
297 | /* Record the various known unsafe memory ranges. */ | 304 | /* Record the various known unsafe memory ranges. */ |
298 | mem_avoid_init((unsigned long)input, input_size, | 305 | mem_avoid_init((unsigned long)input, input_size, |