drivers/power/activity_governor.c: Fix timer can't start when meet very small pmtick.

This commit is contained in:
ligd 2019-11-12 08:18:32 -06:00 committed by Gregory Nutt
parent 64aff3bf6d
commit a3646986ea

View file

@ -594,12 +594,16 @@ static void governor_timer(int domain)
pdomstate->wdog = wd_create();
}
if (state < PM_SLEEP && !pdom->stay[pdom->state] &&
pmtick[state])
if (state < PM_SLEEP && !pdom->stay[pdom->state])
{
int delay = pmtick[state] + pdomstate->btime - clock_systimer();
int left = wd_gettime(pdomstate->wdog);
if (delay <= 0)
{
delay = 1;
}
if (!WDOG_ISACTIVE(pdomstate->wdog) || abs(delay - left) > PM_TIMER_GAP)
{
wd_start(pdomstate->wdog, delay, governor_timer_cb, 0);