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

Commit 23e8e590 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull ACPI and PM fixes and new device IDs from Rafael Wysocki:
 "These commits, except for one, are regression fixes and the remaining
  one fixes a divide error leading to a kernel panic.  The majority of
  the regressions fixed here were introduced during the 3.12 cycle, one
  of them is from this cycle and one is older.

  Specifics:

   - VGA switcheroo was broken for some users as a result of the
     ACPI-based PCI hotplug (ACPIPHP) changes in 3.12, because some
     previously ignored hotplug events started to be handled.  The fix
     causes them to be ignored again.

   - There are two more issues related to cpufreq's suspend/resume
     handling changes from the 3.12 cycle addressed by Viresh Kumar's
     fixes.

   - intel_pstate triggers a divide error in a timer function if the
     P-state information it needs is missing during initialization.
     This leads to kernel panics on nested KVM clients and is fixed by
     failing the initialization cleanly in those cases.

   - PCI initalization code changes during the 3.9 cycle uncovered BIOS
     issues related to ACPI wakeup notifications (some BIOSes send them
     for devices that aren't supposed to support ACPI wakeup).  Work
     around them by installing an ACPI wakeup notify handler for all PCI
     devices with ACPI support.

   - The Calxeda cpuilde driver's probe function is tagged as __init,
     which is incorrect and causes a section mismatch to occur during
     build.  Fix from Andre Przywara removes the __init tag from there.

   - During the 3.12 cycle ACPIPHP started to print warnings about
     missing _ADR for devices that legitimately don't have it.  Fix from
     Toshi Kani makes it only print the warnings where they make sense"

* tag 'pm+acpi-3.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPIPHP / radeon / nouveau: Fix VGA switcheroo problem related to hotplug
  intel_pstate: Fail initialization if P-state information is missing
  ARM/cpuidle: remove __init tag from Calxeda cpuidle probe function
  PCI / ACPI: Install wakeup notify handlers for all PCI devs with ACPI
  cpufreq: preserve user_policy across suspend/resume
  cpufreq: Clean up after a failing light-weight initialization
  ACPI / PCI / hotplug: Avoid warning when _ADR not present
parents 7a262d2e 0a405fe9
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -156,6 +156,16 @@ int acpi_bus_get_private_data(acpi_handle handle, void **data)
}
EXPORT_SYMBOL(acpi_bus_get_private_data);

void acpi_bus_no_hotplug(acpi_handle handle)
{
	struct acpi_device *adev = NULL;

	acpi_bus_get_device(handle, &adev);
	if (adev)
		adev->flags.no_hotplug = true;
}
EXPORT_SYMBOL_GPL(acpi_bus_no_hotplug);

static void acpi_print_osc_error(acpi_handle handle,
	struct acpi_osc_context *context, char *error)
{
+23 −14
Original line number Diff line number Diff line
@@ -839,9 +839,6 @@ static void cpufreq_init_policy(struct cpufreq_policy *policy)

	/* set default policy */
	ret = cpufreq_set_policy(policy, &new_policy);
	policy->user_policy.policy = policy->policy;
	policy->user_policy.governor = policy->governor;

	if (ret) {
		pr_debug("setting policy failed\n");
		if (cpufreq_driver->exit)
@@ -1016,15 +1013,17 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif,
	read_unlock_irqrestore(&cpufreq_driver_lock, flags);
#endif

	if (frozen)
		/* Restore the saved policy when doing light-weight init */
		policy = cpufreq_policy_restore(cpu);
	else
	/*
	 * Restore the saved policy when doing light-weight init and fall back
	 * to the full init if that fails.
	 */
	policy = frozen ? cpufreq_policy_restore(cpu) : NULL;
	if (!policy) {
		frozen = false;
		policy = cpufreq_policy_alloc();

		if (!policy)
			goto nomem_out;

	}

	/*
	 * In the resume path, since we restore a saved policy, the assignment
@@ -1069,8 +1068,10 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif,
	 */
	cpumask_and(policy->cpus, policy->cpus, cpu_online_mask);

	if (!frozen) {
		policy->user_policy.min = policy->min;
		policy->user_policy.max = policy->max;
	}

	blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
				     CPUFREQ_START, policy);
@@ -1101,6 +1102,11 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif,

	cpufreq_init_policy(policy);

	if (!frozen) {
		policy->user_policy.policy = policy->policy;
		policy->user_policy.governor = policy->governor;
	}

	kobject_uevent(&policy->kobj, KOBJ_ADD);
	up_read(&cpufreq_rwsem);

@@ -1118,8 +1124,11 @@ err_get_freq:
	if (cpufreq_driver->exit)
		cpufreq_driver->exit(policy);
err_set_policy_cpu:
	if (frozen)
	if (frozen) {
		/* Do not leave stale fallback data behind. */
		per_cpu(cpufreq_cpu_data_fallback, cpu) = NULL;
		cpufreq_policy_put_kobj(policy);
	}
	cpufreq_policy_free(policy);

nomem_out:
+5 −0
Original line number Diff line number Diff line
@@ -614,6 +614,11 @@ static int intel_pstate_init_cpu(unsigned int cpunum)
	cpu = all_cpu_data[cpunum];

	intel_pstate_get_cpu_pstates(cpu);
	if (!cpu->pstate.current_pstate) {
		all_cpu_data[cpunum] = NULL;
		kfree(cpu);
		return -ENODATA;
	}

	cpu->cpu = cpunum;

+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ static struct cpuidle_driver calxeda_idle_driver = {
	.state_count = 2,
};

static int __init calxeda_cpuidle_probe(struct platform_device *pdev)
static int calxeda_cpuidle_probe(struct platform_device *pdev)
{
	return cpuidle_register(&calxeda_idle_driver, NULL);
}
+14 −2
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ static struct nouveau_dsm_priv {
	bool dsm_detected;
	bool optimus_detected;
	acpi_handle dhandle;
	acpi_handle other_handle;
	acpi_handle rom_handle;
} nouveau_dsm_priv;

@@ -260,9 +261,10 @@ static int nouveau_dsm_pci_probe(struct pci_dev *pdev)
	if (!dhandle)
		return false;

	if (!acpi_has_method(dhandle, "_DSM"))
	if (!acpi_has_method(dhandle, "_DSM")) {
		nouveau_dsm_priv.other_handle = dhandle;
		return false;

	}
	if (nouveau_test_dsm(dhandle, nouveau_dsm, NOUVEAU_DSM_POWER))
		retval |= NOUVEAU_DSM_HAS_MUX;

@@ -338,6 +340,16 @@ static bool nouveau_dsm_detect(void)
		printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n",
			acpi_method_name);
		nouveau_dsm_priv.dsm_detected = true;
		/*
		 * On some systems hotplug events are generated for the device
		 * being switched off when _DSM is executed.  They cause ACPI
		 * hotplug to trigger and attempt to remove the device from
		 * the system, which causes it to break down.  Prevent that from
		 * happening by setting the no_hotplug flag for the involved
		 * ACPI device objects.
		 */
		acpi_bus_no_hotplug(nouveau_dsm_priv.dhandle);
		acpi_bus_no_hotplug(nouveau_dsm_priv.other_handle);
		ret = true;
	}

Loading