summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
index 0e6b576b..d433c9bb 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * GK20A Graphics 4 * GK20A Graphics
5 * 5 *
6 * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved. 6 * Copyright (c) 2011-2016, NVIDIA CORPORATION. All rights reserved.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify it 8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License, 9 * under the terms and conditions of the GNU General Public License,
@@ -30,7 +30,6 @@
30#include "fifo_gk20a.h" 30#include "fifo_gk20a.h"
31#include "pmu_gk20a.h" 31#include "pmu_gk20a.h"
32 32
33
34#define PTIMER_FP_FACTOR 1000000 33#define PTIMER_FP_FACTOR 1000000
35 34
36#define ROOTRW (S_IRWXU|S_IRGRP|S_IROTH) 35#define ROOTRW (S_IRWXU|S_IRGRP|S_IROTH)
@@ -100,6 +99,9 @@ static ssize_t blcg_enable_store(struct device *device,
100 99
101 if (g->ops.clock_gating.blcg_bus_load_gating_prod) 100 if (g->ops.clock_gating.blcg_bus_load_gating_prod)
102 g->ops.clock_gating.blcg_bus_load_gating_prod(g, g->blcg_enabled); 101 g->ops.clock_gating.blcg_bus_load_gating_prod(g, g->blcg_enabled);
102 if (g->ops.clock_gating.blcg_ce_load_gating_prod)
103 g->ops.clock_gating.blcg_ce_load_gating_prod(g,
104 g->blcg_enabled);
103 if (g->ops.clock_gating.blcg_ctxsw_firmware_load_gating_prod) 105 if (g->ops.clock_gating.blcg_ctxsw_firmware_load_gating_prod)
104 g->ops.clock_gating.blcg_ctxsw_firmware_load_gating_prod(g, g->blcg_enabled); 106 g->ops.clock_gating.blcg_ctxsw_firmware_load_gating_prod(g, g->blcg_enabled);
105 if (g->ops.clock_gating.blcg_fb_load_gating_prod) 107 if (g->ops.clock_gating.blcg_fb_load_gating_prod)
@@ -784,8 +786,15 @@ void gk20a_remove_sysfs(struct device *dev)
784 device_remove_file(dev, &dev_attr_allow_all); 786 device_remove_file(dev, &dev_attr_allow_all);
785 device_remove_file(dev, &dev_attr_tpc_fs_mask); 787 device_remove_file(dev, &dev_attr_tpc_fs_mask);
786 788
787 if (g->host1x_dev && (dev->parent != &g->host1x_dev->dev)) 789 if (g->host1x_dev && (dev->parent != &g->host1x_dev->dev)) {
788 sysfs_remove_link(&g->host1x_dev->dev.kobj, dev_name(dev)); 790 sysfs_remove_link(&g->host1x_dev->dev.kobj, dev_name(dev));
791 if (strcmp(dev_name(dev), "gpu.0")) {
792 struct kobject *kobj = &dev->kobj;
793 struct device *parent = container_of((kobj->parent),
794 struct device, kobj);
795 sysfs_remove_link(&parent->kobj, "gpu.0");
796 }
797 }
789} 798}
790 799
791void gk20a_create_sysfs(struct platform_device *dev) 800void gk20a_create_sysfs(struct platform_device *dev)
@@ -817,10 +826,19 @@ void gk20a_create_sysfs(struct platform_device *dev)
817 error |= device_create_file(&dev->dev, &dev_attr_allow_all); 826 error |= device_create_file(&dev->dev, &dev_attr_allow_all);
818 error |= device_create_file(&dev->dev, &dev_attr_tpc_fs_mask); 827 error |= device_create_file(&dev->dev, &dev_attr_tpc_fs_mask);
819 828
820 if (g->host1x_dev && (dev->dev.parent != &g->host1x_dev->dev)) 829 if (g->host1x_dev && (dev->dev.parent != &g->host1x_dev->dev)) {
821 error |= sysfs_create_link(&g->host1x_dev->dev.kobj, 830 error |= sysfs_create_link(&g->host1x_dev->dev.kobj,
822 &dev->dev.kobj, 831 &dev->dev.kobj,
823 dev_name(&dev->dev)); 832 dev_name(&dev->dev));
833 if (strcmp(dev_name(&dev->dev), "gpu.0")) {
834 struct kobject *kobj = &dev->dev.kobj;
835 struct device *parent = container_of((kobj->parent),
836 struct device, kobj);
837 error |= sysfs_create_link(&parent->kobj,
838 &dev->dev.kobj, "gpu.0");
839 }
840
841 }
824 842
825 if (error) 843 if (error)
826 dev_err(&dev->dev, "Failed to create sysfs attributes!\n"); 844 dev_err(&dev->dev, "Failed to create sysfs attributes!\n");