Skip to content

Commit b6935d2

Browse files
committed
Merge tag 'pm-4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki: "These address a corner case in the menu cpuidle governor and fix error handling in the PM core's generic clock management code. Specifics: - Make the menu cpuidle governor avoid stopping the scheduler tick if the predicted idle duration exceeds the tick period length, but the selected idle state is shallow and deeper idle states with high target residencies are available (Rafael Wysocki). - Make the PM core's generic clock management code use a proper data type for one variable to make error handling work (Dan Carpenter)" * tag 'pm-4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpuidle: menu: Retain tick when shallow state is selected PM / clk: signedness bug in of_pm_clk_add_clks()
2 parents fb64638 + a0b9c4d commit b6935d2

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

drivers/base/power/clock_ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ EXPORT_SYMBOL_GPL(of_pm_clk_add_clk);
185185
int of_pm_clk_add_clks(struct device *dev)
186186
{
187187
struct clk **clks;
188-
unsigned int i, count;
188+
int i, count;
189189
int ret;
190190

191191
if (!dev || !dev->of_node)

drivers/cpuidle/governors/menu.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,20 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
379379
if (idx == -1)
380380
idx = i; /* first enabled state */
381381
if (s->target_residency > data->predicted_us) {
382-
if (!tick_nohz_tick_stopped())
382+
if (data->predicted_us < TICK_USEC)
383383
break;
384384

385+
if (!tick_nohz_tick_stopped()) {
386+
/*
387+
* If the state selected so far is shallow,
388+
* waking up early won't hurt, so retain the
389+
* tick in that case and let the governor run
390+
* again in the next iteration of the loop.
391+
*/
392+
expected_interval = drv->states[idx].target_residency;
393+
break;
394+
}
395+
385396
/*
386397
* If the state selected so far is shallow and this
387398
* state's target residency matches the time till the

0 commit comments

Comments
 (0)