msm: dcvs: functions to start/stop/restart hrtimer
The slack timer is supposed to be activated only when the core
is out of idle and that the governor for that core has started.
If any of the conditions is not met one should not activate
the slack timer.
To implement such a scheme, create two variables idle_entered,
and pending freq protected by their respective spinlocks
idle_state change_lock and pending_freq_lock. Whenever the
idle is entered or exited stop/start_slack_timer is called
which grabs the appropriate spinlocks and udpates the idle_entered
variable and starts and stops the hrtimer.
Moreover there are situations when a activated timer needs to
be restarted. This happens when a frequency is updated and a new
slack timer is received. We provide restart_slack_timer() callback
which cancels the hrtimer and restarts it only if the conditions
mentioned above are met.
There is also a situation when one has to forcefully cancel the timer
when the governor stops. Provide an api for that too. Note that one
cannot use stop_slack_timer becuase stop_slack_timer manipulates
idle_entered flag.
Also on related note, cleanup the code that handles pending_freq.
We get a new freq to set for a core when
- the slack timer expires
- when the governor starts when the cpu is brought back online
- when the cpu comes out of idle
Use pending_freq_lock to serialize updates to pending_freq.
Change-Id: Iedbd8a3fce0cf52aca1b5d6ad3cc8d779df6ebc5
Signed-off-by:
Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Loading
Please register or sign in to comment