Skip to content

Commit f3e66e7

Browse files
committed
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
2 parents baf4ae8 + 9cf9f2e commit f3e66e7

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

drivers/acpi/processor_idle.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ static void __cpuidle acpi_idle_do_entry(struct acpi_processor_cx *cx)
578578
* @dev: the target CPU
579579
* @index: the index of suggested state
580580
*/
581-
static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
581+
static void acpi_idle_play_dead(struct cpuidle_device *dev, int index)
582582
{
583583
struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
584584

@@ -591,11 +591,8 @@ static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
591591
else if (cx->entry_method == ACPI_CSTATE_SYSTEMIO) {
592592
io_idle(cx->address);
593593
} else
594-
return -ENODEV;
594+
return;
595595
}
596-
597-
/* Never reached */
598-
return 0;
599596
}
600597

601598
static __always_inline bool acpi_idle_fallback_to_c1(struct acpi_processor *pr)

drivers/cpuidle/cpuidle.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,15 @@ int cpuidle_play_dead(void)
6969
if (!drv)
7070
return -ENODEV;
7171

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

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

include/linux/cpuidle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct cpuidle_state {
6161
struct cpuidle_driver *drv,
6262
int index);
6363

64-
int (*enter_dead) (struct cpuidle_device *dev, int index);
64+
void (*enter_dead) (struct cpuidle_device *dev, int index);
6565

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

0 commit comments

Comments
 (0)