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

Commit be6b6947 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
  ACPI / PM: Avoid infinite recurrence while registering power resources
  PM / Wakeup: Fix initialization of wakeup-related device sysfs files
parents 0fd97ab4 7bed50c5
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -943,6 +943,10 @@ static int acpi_bus_get_flags(struct acpi_device *device)
	if (ACPI_SUCCESS(status))
	if (ACPI_SUCCESS(status))
		device->flags.lockable = 1;
		device->flags.lockable = 1;


	/* Power resources cannot be power manageable. */
	if (device->device_type == ACPI_BUS_TYPE_POWER)
		return 0;

	/* Presence of _PS0|_PR0 indicates 'power manageable' */
	/* Presence of _PS0|_PR0 indicates 'power manageable' */
	status = acpi_get_handle(device->handle, "_PS0", &temp);
	status = acpi_get_handle(device->handle, "_PS0", &temp);
	if (ACPI_FAILURE(status))
	if (ACPI_FAILURE(status))
+1 −0
Original line number Original line Diff line number Diff line
@@ -63,6 +63,7 @@ void device_pm_init(struct device *dev)
	dev->power.wakeup = NULL;
	dev->power.wakeup = NULL;
	spin_lock_init(&dev->power.lock);
	spin_lock_init(&dev->power.lock);
	pm_runtime_init(dev);
	pm_runtime_init(dev);
	INIT_LIST_HEAD(&dev->power.entry);
}
}


/**
/**
+1 −1
Original line number Original line Diff line number Diff line
@@ -258,7 +258,7 @@ void device_set_wakeup_capable(struct device *dev, bool capable)
	if (!!dev->power.can_wakeup == !!capable)
	if (!!dev->power.can_wakeup == !!capable)
		return;
		return;


	if (device_is_registered(dev)) {
	if (device_is_registered(dev) && !list_empty(&dev->power.entry)) {
		if (capable) {
		if (capable) {
			if (wakeup_sysfs_add(dev))
			if (wakeup_sysfs_add(dev))
				return;
				return;