Commit f3e66e78 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branch 'pm-cpuidle'

Merge additional cpuidle changes for 6.13-rc1:

 - Make cpuidle_play_dead() try all idle states with :enter_dead()
   callbacks and change their return type to void (Rafael Wysocki).

* pm-cpuidle:
  cpuidle: Change :enter_dead() driver callback return type to void
  cpuidle: Do not return from cpuidle_play_dead() on callback failures
parents baf4ae80 9cf9f2e7
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -578,7 +578,7 @@ static void __cpuidle acpi_idle_do_entry(struct acpi_processor_cx *cx)
 * @dev: the target CPU
 * @index: the index of suggested state
 */
static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
static void acpi_idle_play_dead(struct cpuidle_device *dev, int index)
{
	struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);

@@ -591,11 +591,8 @@ static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
		else if (cx->entry_method == ACPI_CSTATE_SYSTEMIO) {
			io_idle(cx->address);
		} else
			return -ENODEV;
			return;
	}

	/* Never reached */
	return 0;
}

static __always_inline bool acpi_idle_fallback_to_c1(struct acpi_processor *pr)
+7 −3
Original line number Diff line number Diff line
@@ -69,11 +69,15 @@ int cpuidle_play_dead(void)
	if (!drv)
		return -ENODEV;

	/* Find lowest-power state that supports long-term idle */
	for (i = drv->state_count - 1; i >= 0; i--)
	for (i = drv->state_count - 1; i >= 0; i--) {
		if (drv->states[i].enter_dead)
			return drv->states[i].enter_dead(dev, i);
			drv->states[i].enter_dead(dev, i);
	}

	/*
	 * If :enter_dead() is successful, it will never return, so reaching
	 * here means that all of them failed above or were not present.
	 */
	return -ENODEV;
}

+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ struct cpuidle_state {
			struct cpuidle_driver *drv,
			int index);

	int (*enter_dead) (struct cpuidle_device *dev, int index);
	void (*enter_dead) (struct cpuidle_device *dev, int index);

	/*
	 * CPUs execute ->enter_s2idle with the local tick or entire timekeeping