diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/sysfs.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/sysfs.c b/drivers/gpu/nvgpu/os/linux/sysfs.c index 5eef8bfa..9e48e45d 100644 --- a/drivers/gpu/nvgpu/os/linux/sysfs.c +++ b/drivers/gpu/nvgpu/os/linux/sysfs.c | |||
@@ -301,6 +301,17 @@ static DEVICE_ATTR(ptimer_src_freq, | |||
301 | NULL); | 301 | NULL); |
302 | 302 | ||
303 | 303 | ||
304 | static ssize_t gpu_powered_on_show(struct device *dev, | ||
305 | struct device_attribute *attr, | ||
306 | char *buf) | ||
307 | { | ||
308 | struct gk20a *g = get_gk20a(dev); | ||
309 | |||
310 | return snprintf(buf, PAGE_SIZE, "%u\n", g->power_on); | ||
311 | } | ||
312 | |||
313 | static DEVICE_ATTR(gpu_powered_on, S_IRUGO, gpu_powered_on_show, NULL); | ||
314 | |||
304 | #if defined(CONFIG_PM) | 315 | #if defined(CONFIG_PM) |
305 | static ssize_t railgate_enable_store(struct device *dev, | 316 | static ssize_t railgate_enable_store(struct device *dev, |
306 | struct device_attribute *attr, const char *buf, size_t count) | 317 | struct device_attribute *attr, const char *buf, size_t count) |
@@ -1234,6 +1245,7 @@ void nvgpu_remove_sysfs(struct device *dev) | |||
1234 | device_remove_file(dev, &dev_attr_pd_max_batches); | 1245 | device_remove_file(dev, &dev_attr_pd_max_batches); |
1235 | device_remove_file(dev, &dev_attr_gfxp_wfi_timeout_count); | 1246 | device_remove_file(dev, &dev_attr_gfxp_wfi_timeout_count); |
1236 | device_remove_file(dev, &dev_attr_gfxp_wfi_timeout_unit); | 1247 | device_remove_file(dev, &dev_attr_gfxp_wfi_timeout_unit); |
1248 | device_remove_file(dev, &dev_attr_gpu_powered_on); | ||
1237 | 1249 | ||
1238 | device_remove_file(dev, &dev_attr_comptag_mem_deduct); | 1250 | device_remove_file(dev, &dev_attr_comptag_mem_deduct); |
1239 | 1251 | ||
@@ -1288,6 +1300,7 @@ int nvgpu_create_sysfs(struct device *dev) | |||
1288 | error |= device_create_file(dev, &dev_attr_pd_max_batches); | 1300 | error |= device_create_file(dev, &dev_attr_pd_max_batches); |
1289 | error |= device_create_file(dev, &dev_attr_gfxp_wfi_timeout_count); | 1301 | error |= device_create_file(dev, &dev_attr_gfxp_wfi_timeout_count); |
1290 | error |= device_create_file(dev, &dev_attr_gfxp_wfi_timeout_unit); | 1302 | error |= device_create_file(dev, &dev_attr_gfxp_wfi_timeout_unit); |
1303 | error |= device_create_file(dev, &dev_attr_gpu_powered_on); | ||
1291 | 1304 | ||
1292 | error |= device_create_file(dev, &dev_attr_comptag_mem_deduct); | 1305 | error |= device_create_file(dev, &dev_attr_comptag_mem_deduct); |
1293 | 1306 | ||