Power management fixes for 4.19-rc2

- 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).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJbiH91AAoJEILEb/54YlRxhgwQAITWMBHl0zWwqD7NrXwR96Nw
 hKpJLjhdJb7i9ZYI9TwvlPlivNgheY2h4pmsGrT4QoKxj9HWH3L8+8tvapucXWcM
 FtgaS9klvFaoPWDqMUpdt59nKcjhUrq8N17NRacqH2aYgRRV1jgYEdwrsYuV+HfE
 YfYeCsulKhhueWRPC9OeKzn2XGv9P/gQZRn0qRpybrChxN8IzWmrlBPfTDU1lh3m
 mr1ggVWVofljjRsi0zwi2Rv0dsE4HcofAqHE99u64Vv7NEtO+IDyOUZP/VHfmJop
 IniaKWhOEjlaBysBnTLo0XKhAOq/7suNzamF74oWg6waEIjwV2qGvYaR/o1nXR/9
 SCA+OptJ+jEVuzgzpfRtpR9u4u22/m+oZ0+lK5GxbgJEz46PdDhrl5gYNeLCy3va
 ArWZ9T9CBJhOdeD/lXfg9yX8r+mwb3hwJCFSsG6Grcrh7hGRCkqcv6XBT+KeoO9Z
 XG4d0ftInOTc8AiztmfhFntpDCSDEf6YFLaLsyz3BDECN0ZChW5AmVJ/XmoiaZ8Y
 J6dRjPVzOFwh6TfHmUKilbSoRz0dHsTmGKxOJJAEOlExO+R1AS4vIFHXZTWqF3Re
 M1YCxQ5CnKGxJbH3EKXuFlx5dXOglS6//LLTT+EgOtXKF13VXzNrx2oUlR56c0By
 MGDrS+8cedr8eeh5Y3p1
 =Kx6O
 -----END PGP SIGNATURE-----

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()
This commit is contained in:
Linus Torvalds 2018-08-30 18:02:02 -07:00
commit b6935d2aa4
2 changed files with 13 additions and 2 deletions

View File

@ -185,7 +185,7 @@ EXPORT_SYMBOL_GPL(of_pm_clk_add_clk);
int of_pm_clk_add_clks(struct device *dev)
{
struct clk **clks;
unsigned int i, count;
int i, count;
int ret;
if (!dev || !dev->of_node)

View File

@ -379,9 +379,20 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
if (idx == -1)
idx = i; /* first enabled state */
if (s->target_residency > data->predicted_us) {
if (!tick_nohz_tick_stopped())
if (data->predicted_us < TICK_USEC)
break;
if (!tick_nohz_tick_stopped()) {
/*
* If the state selected so far is shallow,
* waking up early won't hurt, so retain the
* tick in that case and let the governor run
* again in the next iteration of the loop.
*/
expected_interval = drv->states[idx].target_residency;
break;
}
/*
* If the state selected so far is shallow and this
* state's target residency matches the time till the