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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
index f6b43f50..14629fbe 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
@@ -268,6 +268,7 @@ static ssize_t elpg_enable_store(struct device *device,
268 struct platform_device *ndev = to_platform_device(device); 268 struct platform_device *ndev = to_platform_device(device);
269 struct gk20a *g = get_gk20a(ndev); 269 struct gk20a *g = get_gk20a(ndev);
270 unsigned long val = 0; 270 unsigned long val = 0;
271 int err;
271 272
272 if (kstrtoul(buf, 10, &val) < 0) 273 if (kstrtoul(buf, 10, &val) < 0)
273 return -EINVAL; 274 return -EINVAL;
@@ -276,7 +277,10 @@ static ssize_t elpg_enable_store(struct device *device,
276 * Since elpg is refcounted, we should not unnecessarily call 277 * Since elpg is refcounted, we should not unnecessarily call
277 * enable/disable if it is already so. 278 * enable/disable if it is already so.
278 */ 279 */
279 gk20a_channel_busy(g->dev); 280 err = gk20a_channel_busy(g->dev);
281 if (err)
282 return -EAGAIN;
283
280 if (val && !g->elpg_enabled) { 284 if (val && !g->elpg_enabled) {
281 g->elpg_enabled = true; 285 g->elpg_enabled = true;
282 gk20a_pmu_enable_elpg(g); 286 gk20a_pmu_enable_elpg(g);