Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c8fb504 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 4ef61076 2ba87ea1
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -1474,6 +1474,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
	js=		[HW,JOY] Analog joystick
			See Documentation/input/joystick.txt.

	kaslr/nokaslr	[X86]
			Enable/disable kernel and module base offset ASLR
			(Address Space Layout Randomization) if built into
			the kernel. When CONFIG_HIBERNATION is selected,
			kASLR is disabled by default. When kASLR is enabled,
			hibernation will be disabled.

	keepinitrd	[HW,ARM]

	kernelcore=nn[KMG]	[KNL,X86,IA-64,PPC] This parameter
@@ -2110,10 +2117,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
	noapic		[SMP,APIC] Tells the kernel to not make use of any
			IOAPICs that may be present in the system.

	nokaslr		[X86]
			Disable kernel and module base offset ASLR (Address
			Space Layout Randomization) if built into the kernel.

	noautogroup	Disable scheduler automatic task group creation.

	nobats		[PPC] Do not use BATs for mapping kernel lowmem
@@ -2184,6 +2187,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
			in certain environments such as networked servers or
			real-time systems.

	nohibernate	[HIBERNATION] Disable hibernation and resume.

	nohz=		[KNL] Boottime enable/disable dynamic ticks
			Valid arguments: on, off
			Default: on
@@ -2980,6 +2985,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
		noresume	Don't check if there's a hibernation image
				present during boot.
		nocompress	Don't compress/decompress hibernation images.
		no		Disable hibernation and resume.

	retain_initrd	[RAM] Keep initrd memory after extraction

+37 −27
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@ struct ioc {
	struct pci_dev	*sac_only_dev;
};

static struct ioc *ioc_list;
static struct ioc *ioc_list, *ioc_found;
static int reserve_sba_gart = 1;

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 = {
	{ SX2000_IOC_ID, "sx2000", NULL },
};

static struct ioc *
ioc_init(unsigned long hpa, void *handle)
static void ioc_init(unsigned long hpa, struct ioc *ioc)
{
	struct ioc *ioc;
	struct ioc_iommu *info;

	ioc = kzalloc(sizeof(*ioc), GFP_KERNEL);
	if (!ioc)
		return NULL;

	ioc->next = ioc_list;
	ioc_list = ioc;

	ioc->handle = handle;
	ioc->ioc_hpa = ioremap(hpa, 0x1000);

	ioc->func_id = READ_REG(ioc->ioc_hpa + IOC_FUNC_ID);
@@ -1863,8 +1856,6 @@ ioc_init(unsigned long hpa, void *handle)
		"%s %d.%d HPA 0x%lx IOVA space %dMb at 0x%lx\n",
		ioc->name, (ioc->rev >> 4) & 0xF, ioc->rev & 0xF,
		hpa, ioc->iov_size >> 20, ioc->ibase);

	return ioc;
}


@@ -2031,22 +2022,21 @@ sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle)
#endif
}

static int
acpi_sba_ioc_add(struct acpi_device *device,
		 const struct acpi_device_id *not_used)
static void acpi_sba_ioc_add(struct ioc *ioc)
{
	struct ioc *ioc;
	acpi_handle handle = ioc->handle;
	acpi_status status;
	u64 hpa, length;
	struct acpi_device_info *adi;

	status = hp_acpi_csr_space(device->handle, &hpa, &length);
	ioc_found = ioc->next;
	status = hp_acpi_csr_space(handle, &hpa, &length);
	if (ACPI_FAILURE(status))
		return 1;
		goto err;

	status = acpi_get_object_info(device->handle, &adi);
	status = acpi_get_object_info(handle, &adi);
	if (ACPI_FAILURE(status))
		return 1;
		goto err;

	/*
	 * For HWP0001, only SBA appears in ACPI namespace.  It encloses the PCI
@@ -2067,13 +2057,13 @@ acpi_sba_ioc_add(struct acpi_device *device,
	if (!iovp_shift)
		iovp_shift = 12;

	ioc = ioc_init(hpa, device->handle);
	if (!ioc)
		return 1;

	ioc_init(hpa, ioc);
	/* setup NUMA node association */
	sba_map_ioc_to_node(ioc, device->handle);
	return 0;
	sba_map_ioc_to_node(ioc, handle);
	return;

 err:
	kfree(ioc);
}

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[] = {
	{"HWP0004", 0},
	{"", 0},
};

static int acpi_sba_ioc_attach(struct acpi_device *device,
			       const struct acpi_device_id *not_used)
{
	struct ioc *ioc;

	ioc = kzalloc(sizeof(*ioc), GFP_KERNEL);
	if (!ioc)
		return -ENOMEM;

	ioc->next = ioc_found;
	ioc_found = ioc;
	ioc->handle = device->handle;
	return 1;
}


static struct acpi_scan_handler acpi_sba_ioc_handler = {
	.ids	= hp_ioc_iommu_device_ids,
	.attach	= acpi_sba_ioc_add,
	.attach	= acpi_sba_ioc_attach,
};

static int __init acpi_sba_ioc_init_acpi(void)
@@ -2118,9 +2125,12 @@ sba_init(void)
#endif

	/*
	 * ioc_list should be populated by the acpi_sba_ioc_handler's .attach()
	 * ioc_found should be populated by the acpi_sba_ioc_handler's .attach()
	 * routine, but that only happens if acpi_scan_init() has already run.
	 */
	while (ioc_found)
		acpi_sba_ioc_add(ioc_found);

	if (!ioc_list) {
#ifdef CONFIG_IA64_GENERIC
		/*
+0 −1
Original line number Diff line number Diff line
@@ -1672,7 +1672,6 @@ config RELOCATABLE
config RANDOMIZE_BASE
	bool "Randomize the address of the kernel image"
	depends on RELOCATABLE
	depends on !HIBERNATION
	default n
	---help---
	   Randomizes the physical and virtual address at which the
+8 −1
Original line number Diff line number Diff line
@@ -289,10 +289,17 @@ unsigned char *choose_kernel_location(unsigned char *input,
	unsigned long choice = (unsigned long)output;
	unsigned long random;

#ifdef CONFIG_HIBERNATION
	if (!cmdline_find_option_bool("kaslr")) {
		debug_putstr("KASLR disabled by default...\n");
		goto out;
	}
#else
	if (cmdline_find_option_bool("nokaslr")) {
		debug_putstr("KASLR disabled...\n");
		debug_putstr("KASLR disabled by cmdline...\n");
		goto out;
	}
#endif

	/* Record the various known unsafe memory ranges. */
	mem_avoid_init((unsigned long)input, input_size,
+15 −0
Original line number Diff line number Diff line
@@ -34,6 +34,9 @@ ACPI_MODULE_NAME("acpi_lpss");

/* Offsets relative to LPSS_PRIVATE_OFFSET */
#define LPSS_CLK_DIVIDER_DEF_MASK	(BIT(1) | BIT(16))
#define LPSS_RESETS			0x04
#define LPSS_RESETS_RESET_FUNC		BIT(0)
#define LPSS_RESETS_RESET_APB		BIT(1)
#define LPSS_GENERAL			0x08
#define LPSS_GENERAL_LTR_MODE_SW	BIT(2)
#define LPSS_GENERAL_UART_RTS_OVRD	BIT(3)
@@ -99,6 +102,17 @@ static void lpss_uart_setup(struct lpss_private_data *pdata)
	writel(reg | LPSS_GENERAL_UART_RTS_OVRD, pdata->mmio_base + offset);
}

static void lpss_i2c_setup(struct lpss_private_data *pdata)
{
	unsigned int offset;
	u32 val;

	offset = pdata->dev_desc->prv_offset + LPSS_RESETS;
	val = readl(pdata->mmio_base + offset);
	val |= LPSS_RESETS_RESET_APB | LPSS_RESETS_RESET_FUNC;
	writel(val, pdata->mmio_base + offset);
}

static struct lpss_device_desc lpt_dev_desc = {
	.clk_required = true,
	.prv_offset = 0x800,
@@ -171,6 +185,7 @@ static struct lpss_device_desc byt_i2c_dev_desc = {
	.prv_offset = 0x800,
	.save_ctx = true,
	.shared_clock = &i2c_clock,
	.setup = lpss_i2c_setup,
};

#else
Loading