summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/nvhost_syncpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/tegra/host/nvhost_syncpt.c')
-rw-r--r--drivers/video/tegra/host/nvhost_syncpt.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/video/tegra/host/nvhost_syncpt.c b/drivers/video/tegra/host/nvhost_syncpt.c
index b0af8a143bd2..4d431cc14890 100644
--- a/drivers/video/tegra/host/nvhost_syncpt.c
+++ b/drivers/video/tegra/host/nvhost_syncpt.c
@@ -3,7 +3,7 @@
*
* Tegra Graphics Host Syncpoints
*
- * Copyright (c) 2010-2014, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2010-2018, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -650,13 +650,18 @@ static ssize_t syncpt_name_show(struct kobject *kobj,
{
struct nvhost_syncpt_attr *syncpt_attr =
container_of(attr, struct nvhost_syncpt_attr, attr);
+ ssize_t count = 0;
if (syncpt_attr->id < 0)
return snprintf(buf, PAGE_SIZE, "\n");
- return snprintf(buf, PAGE_SIZE, "%s\n",
+ mutex_lock(&syncpt_attr->host->syncpt.syncpt_mutex);
+ count = snprintf(buf, PAGE_SIZE, "%s\n",
nvhost_syncpt_get_name(syncpt_attr->host->dev,
syncpt_attr->id));
+ mutex_unlock(&syncpt_attr->host->syncpt.syncpt_mutex);
+
+ return count;
}
static ssize_t syncpt_min_show(struct kobject *kobj,