devfreq: update mon status when updating the polling interval
When handling the polling interval update, ensure to set the
mon_started to false since the hwmon would be suspended anyway. This
would prevent unclocked access of BWMON when update_devfreq races
with the polling interval update. Also set the mon_started to true
as soon as the interval update and hwmon resume are completed.
This patch fixes the following race condition that could happen.
devfreq_bw_hwmon_ev_handler { update_devfreq {
.... get_target_freq
.... devfreq_bw_hwmon_get_freq {
hw->suspend_hwmon(hw); ....
devfreq_interval_update(df, &sample_ms); __bw_hwmon_hw_sample_end {
ret = hw->resume_hwmon(hw); hwmon->get_bytes_and_clear
.... ....
Change-Id: I4cdab066ff184891aaeb22cb8b3af31213015ff1
Signed-off-by:
Rama Aparna Mallavarapu <aparnam@codeaurora.org>
Loading
Please register or sign in to comment