summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
diff options
context:
space:
mode:
authorArto Merilainen <amerilainen@nvidia.com>2014-04-22 01:22:00 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:09:44 -0400
commit4c7065b558dac5968610415770d957f0e3b1ba69 (patch)
tree6973663dcd7016c84421add723fbffdd573d53d9 /drivers/gpu/nvgpu/gk20a/gk20a_scale.c
parentf2ef74fbfff11cad91cd08b3f1be69840f0aadda (diff)
gpu: nvgpu: Create load sysfs node always
Currently creation of the load sysfs node is bound to devfreq profile initialisation, however, this information is useful even if the scaling is not enabled. This patch modifies the code to create the sysfs node always. Bug 1485489 Change-Id: Id20433344aa81108f89a36cd56c9a73dd9d2e1c8 Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-on: http://git-master/r/399474 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_scale.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_scale.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
index d1fd71fe..8a92828f 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
@@ -34,30 +34,6 @@
34#include "clk_gk20a.h" 34#include "clk_gk20a.h"
35#include "gk20a_scale.h" 35#include "gk20a_scale.h"
36 36
37static ssize_t gk20a_scale_load_show(struct device *dev,
38 struct device_attribute *attr,
39 char *buf)
40{
41 struct platform_device *pdev = to_platform_device(dev);
42 struct gk20a *g = get_gk20a(pdev);
43 u32 busy_time;
44 ssize_t res;
45
46 if (!g->power_on) {
47 busy_time = 0;
48 } else {
49 gk20a_busy(g->dev);
50 gk20a_pmu_load_norm(g, &busy_time);
51 gk20a_idle(g->dev);
52 }
53
54 res = snprintf(buf, PAGE_SIZE, "%u\n", busy_time);
55
56 return res;
57}
58
59static DEVICE_ATTR(load, S_IRUGO, gk20a_scale_load_show, NULL);
60
61/* 37/*
62 * gk20a_scale_qos_notify() 38 * gk20a_scale_qos_notify()
63 * 39 *
@@ -293,9 +269,6 @@ void gk20a_scale_init(struct platform_device *pdev)
293 if (err || !profile->devfreq_profile.max_state) 269 if (err || !profile->devfreq_profile.max_state)
294 goto err_get_freqs; 270 goto err_get_freqs;
295 271
296 if (device_create_file(&pdev->dev, &dev_attr_load))
297 goto err_create_sysfs_entry;
298
299 /* Store device profile so we can access it if devfreq governor 272 /* Store device profile so we can access it if devfreq governor
300 * init needs that */ 273 * init needs that */
301 g->scale_profile = profile; 274 g->scale_profile = profile;
@@ -332,8 +305,6 @@ void gk20a_scale_init(struct platform_device *pdev)
332 return; 305 return;
333 306
334err_get_freqs: 307err_get_freqs:
335 device_remove_file(&pdev->dev, &dev_attr_load);
336err_create_sysfs_entry:
337 kfree(g->scale_profile); 308 kfree(g->scale_profile);
338 g->scale_profile = NULL; 309 g->scale_profile = NULL;
339} 310}