summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
index aabe572b..ca8b8bea 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
@@ -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)
@@ -787,8 +786,15 @@ void gk20a_remove_sysfs(struct device *dev)
787 device_remove_file(dev, &dev_attr_allow_all); 786 device_remove_file(dev, &dev_attr_allow_all);
788 device_remove_file(dev, &dev_attr_tpc_fs_mask); 787 device_remove_file(dev, &dev_attr_tpc_fs_mask);
789 788
790 if (g->host1x_dev && (dev->parent != &g->host1x_dev->dev)) 789 if (g->host1x_dev && (dev->parent != &g->host1x_dev->dev)) {
791 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 }
792} 798}
793 799
794void gk20a_create_sysfs(struct platform_device *dev) 800void gk20a_create_sysfs(struct platform_device *dev)
@@ -820,10 +826,19 @@ void gk20a_create_sysfs(struct platform_device *dev)
820 error |= device_create_file(&dev->dev, &dev_attr_allow_all); 826 error |= device_create_file(&dev->dev, &dev_attr_allow_all);
821 error |= device_create_file(&dev->dev, &dev_attr_tpc_fs_mask); 827 error |= device_create_file(&dev->dev, &dev_attr_tpc_fs_mask);
822 828
823 if (g->host1x_dev && (dev->dev.parent != &g->host1x_dev->dev)) 829 if (g->host1x_dev && (dev->dev.parent != &g->host1x_dev->dev)) {
824 error |= sysfs_create_link(&g->host1x_dev->dev.kobj, 830 error |= sysfs_create_link(&g->host1x_dev->dev.kobj,
825 &dev->dev.kobj, 831 &dev->dev.kobj,
826 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 }
827 842
828 if (error) 843 if (error)
829 dev_err(&dev->dev, "Failed to create sysfs attributes!\n"); 844 dev_err(&dev->dev, "Failed to create sysfs attributes!\n");