diff --git a/drivers/devfreq/governor_wmark_active.c b/drivers/devfreq/governor_wmark_active.c index f96349d5..48433e66 100644 --- a/drivers/devfreq/governor_wmark_active.c +++ b/drivers/devfreq/governor_wmark_active.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -278,6 +278,7 @@ static int devfreq_watermark_start(struct devfreq *df) static int devfreq_watermark_event_handler(struct devfreq *df, unsigned int event, void *wmark_type) { + struct wmark_gov_info *wmarkinfo; int ret = 0; switch (event) { @@ -292,6 +293,10 @@ static int devfreq_watermark_event_handler(struct devfreq *df, if (ret < 0) break; + /* initialize average target freq */ + wmarkinfo = df->data; + wmarkinfo->average_target_freq = dev_stat.current_frequency; + update_watermarks(df, dev_stat.current_frequency, dev_stat.current_frequency); break; @@ -309,6 +314,10 @@ static int devfreq_watermark_event_handler(struct devfreq *df, if (ret < 0) break; + /* reset average target freq to current freq */ + wmarkinfo = df->data; + wmarkinfo->average_target_freq = dev_stat.current_frequency; + update_watermarks(df, dev_stat.current_frequency, dev_stat.current_frequency); devfreq_monitor_resume(df);