devfreq: wmark: active: init average target freq

- initializes average target freq parameter of active watermark
  governor parameter to current frequency set during start and
  resume from suspend.

Bug 200165367

Change-Id: I56b43ea371c77e95285944433615660400da94ea
Reviewed-on: http://git-master/r/936632
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1160862
(cherry picked from linux-4.9 commit 331b1f92e097209b3afd9ab92fe5337152c604e2)
Reviewed-on: https://git-master.nvidia.com/r/1770143
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Timo Alho <talho@nvidia.com>
Tested-by: Timo Alho <talho@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Shridhar Rasal
2016-01-23 15:37:03 +05:30
committed by Laxman Dewangan
parent a18f6421d2
commit a55c8f34e2

View File

@@ -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 * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * 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, static int devfreq_watermark_event_handler(struct devfreq *df,
unsigned int event, void *wmark_type) unsigned int event, void *wmark_type)
{ {
struct wmark_gov_info *wmarkinfo;
int ret = 0; int ret = 0;
switch (event) { switch (event) {
@@ -292,6 +293,10 @@ static int devfreq_watermark_event_handler(struct devfreq *df,
if (ret < 0) if (ret < 0)
break; break;
/* initialize average target freq */
wmarkinfo = df->data;
wmarkinfo->average_target_freq = dev_stat.current_frequency;
update_watermarks(df, dev_stat.current_frequency, update_watermarks(df, dev_stat.current_frequency,
dev_stat.current_frequency); dev_stat.current_frequency);
break; break;
@@ -309,6 +314,10 @@ static int devfreq_watermark_event_handler(struct devfreq *df,
if (ret < 0) if (ret < 0)
break; 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, update_watermarks(df, dev_stat.current_frequency,
dev_stat.current_frequency); dev_stat.current_frequency);
devfreq_monitor_resume(df); devfreq_monitor_resume(df);