From ea9cb56cf617f7fb4aa79a520f4ff5db2723152d Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Wed, 17 Jan 2018 14:47:02 -0800 Subject: gpu: nvgpu: railgate platform only if it is not railgated Avoid railgating platform, if it is already in railgated state. This is right thing to do and it also avoids ref counting issues related to fuse clock disable. Bug 200381275 Change-Id: Id745f9b878be129bf9b0cc972fadcfc102c8ddc2 Signed-off-by: seshendra Gadagottu Reviewed-on: https://git-master.nvidia.com/r/1640548 Reviewed-by: Seema Khowala GVS: Gerrit_Virtual_Submit Reviewed-by: Sachin Nikam Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/module.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/common/linux/module.c') diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index b95bac0b..2e288ce2 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c @@ -1,7 +1,7 @@ /* * GK20A Graphics * - * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-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, @@ -736,6 +736,11 @@ static int gk20a_pm_railgate(struct device *dev) struct gk20a_platform *platform = dev_get_drvdata(dev); int ret = 0; struct gk20a *g = get_gk20a(dev); + + /* if platform is already railgated, then just return */ + if (platform->is_railgated && platform->is_railgated(dev)) + return ret; + #ifdef CONFIG_DEBUG_FS g->pstats.last_rail_gate_start = jiffies; -- cgit v1.2.2