From f28526bb727679de8016c66607a204f5c294b014 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Wed, 6 Jan 2016 18:24:48 +0530 Subject: gpu: nvgpu: move pmu_load_update() to get_dev_status() We currently call gk20a_pmu_load_update() before calling update_devfreq() But it is possible to disable governor and set a constant/max frequency. In that case we will unnecessarily keep executing gk20a_pmu_load_update() for each submit Hence. move gk20a_pmu_load_update() to gk20a_scale_get_dev_status() so that we call gk20a_pmu_load_update() only when we really have to scale the frequency Bug 200161377 Change-Id: Ifac5a659a3a2d088b636f048213c2fbec801bdb9 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/929509 (cherry picked from commit f857a1b31400dfc0c35c58c6424aaac36bc09e7c) Reviewed-on: http://git-master/r/933704 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a_scale.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_scale.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c index 82e24535..65772d3b 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c @@ -190,18 +190,10 @@ void gk20a_scale_resume(struct platform_device *pdev) static void gk20a_scale_notify(struct platform_device *pdev, bool busy) { - struct gk20a_platform *platform = platform_get_drvdata(pdev); struct gk20a *g = get_gk20a(pdev); struct gk20a_scale_profile *profile = g->scale_profile; struct devfreq *devfreq = g->devfreq; - /* update the software shadow */ - gk20a_pmu_load_update(g); - - /* inform edp about new constraint */ - if (platform->prescale) - platform->prescale(pdev); - /* Is the device profile initialised? */ if (!(profile && devfreq)) return; @@ -237,6 +229,13 @@ static int gk20a_scale_get_dev_status(struct device *dev, struct platform_device *pdev = to_platform_device(dev); struct gk20a_platform *platform = platform_get_drvdata(pdev); + /* update the software shadow */ + gk20a_pmu_load_update(g); + + /* inform edp about new constraint */ + if (platform->prescale) + platform->prescale(pdev); + /* Make sure there are correct values for the current frequency */ profile->dev_stat.current_frequency = platform->clk_get_rate(profile->pdev); -- cgit v1.2.2