mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
devfreq: Improve wmark_active initialization
The wmark_active governor initialization assumes that the device frequency is the lowest possible frequency when the governor is started or resumed. However, this may not be correct if the governor was suspended/stopped before the clock had been slowed down. This patch modifies the governor to read the frequency during governor initialization and resume. Change-Id: I38d3256102b344bc8818c5623a015843678a8ce5 Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-on: http://git-master/r/733007 Reviewed-on: http://git-master/r/1160009 (cherry picked from linux-4.9 commit 32e2561dffc5d7390fa4fd503651da9013403ecb) Reviewed-on: https://git-master.nvidia.com/r/1770141 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:
committed by
Laxman Dewangan
parent
6135535c12
commit
29440602f3
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2014-2015, 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,
|
||||||
@@ -233,33 +233,44 @@ static int devfreq_watermark_event_handler(struct devfreq *df,
|
|||||||
unsigned int event, void *wmark_type)
|
unsigned int event, void *wmark_type)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
struct wmark_gov_info *wmarkinfo = df->data;
|
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case DEVFREQ_GOV_START:
|
case DEVFREQ_GOV_START:
|
||||||
devfreq_watermark_start(df);
|
{
|
||||||
wmarkinfo = df->data;
|
struct devfreq_dev_status dev_stat;
|
||||||
update_watermarks(df, wmarkinfo->freqlist[0]);
|
ret = df->profile->get_dev_status(df->dev.parent, &dev_stat);
|
||||||
|
if (ret < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
ret = devfreq_watermark_start(df);
|
||||||
|
if (ret < 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
update_watermarks(df, dev_stat.current_frequency);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case DEVFREQ_GOV_STOP:
|
case DEVFREQ_GOV_STOP:
|
||||||
devfreq_watermark_debug_stop(df);
|
devfreq_watermark_debug_stop(df);
|
||||||
break;
|
break;
|
||||||
case DEVFREQ_GOV_SUSPEND:
|
case DEVFREQ_GOV_SUSPEND:
|
||||||
devfreq_monitor_suspend(df);
|
devfreq_monitor_suspend(df);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEVFREQ_GOV_RESUME:
|
case DEVFREQ_GOV_RESUME:
|
||||||
wmarkinfo = df->data;
|
{
|
||||||
update_watermarks(df, wmarkinfo->freqlist[0]);
|
struct devfreq_dev_status dev_stat;
|
||||||
devfreq_monitor_resume(df);
|
ret = df->profile->get_dev_status(df->dev.parent, &dev_stat);
|
||||||
|
if (ret < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
update_watermarks(df, dev_stat.current_frequency);
|
||||||
|
devfreq_monitor_resume(df);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case DEVFREQ_GOV_WMARK:
|
case DEVFREQ_GOV_WMARK:
|
||||||
mutex_lock(&df->lock);
|
mutex_lock(&df->lock);
|
||||||
update_devfreq(df);
|
update_devfreq(df);
|
||||||
mutex_unlock(&df->lock);
|
mutex_unlock(&df->lock);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user