From 40cefb666f3767059383052346d4c0faa9195a48 Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Tue, 20 Mar 2018 12:28:04 -0700 Subject: gpu: nvgpu: gpu railgate handling with runtime pm Earlier implementation of railgate disable config is disabling runtime pm during pm_init. This is causing multiple issues: 1. gpu rail will be on as soon as nvgpu driver probe is called. Actual gpu hw init may happen at much later point of time. 2. This is breaking railgate_enable sysfs node functionality. railgate_enable is not working if runtime pm is disabled. To avoid all these issues for railgate disable, enable runtime pm during pm_init and set auto-suspend delay to negative (-1), which will disable runtime pm suspend calls. Also fixed following issues along with this: 1. Updated railgate_enable debugfs implementation to use auto-suspend delay. To disable railgating: Set auto-suspend delay with negative value(-1) which will disable runtime pm suspend. To enable railgating: Set auto-suspend delay with railgate_delay value. Also removed redundant user_railgate_disabled gk20a device data and replaced with can_railgate, where ever it is applicable. 2. Initialized default railgate_delay to 500msec to avoid railgate on/off transitions with railigate enable from disabled state. 3. Created railgate_residency debug fs node irrespective of can_railgate initial state. This is helping with the case, where initial state of railgate state off and then railgate enable is done through sysfs node. Bug 2073029 Change-Id: I531da6d93ba8907e806f65a1de2a447c1ec2665c Signed-off-by: seshendra Gadagottu Reviewed-on: https://git-master.nvidia.com/r/1694944 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/debug.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/gpu/nvgpu/common/linux/debug.c') diff --git a/drivers/gpu/nvgpu/common/linux/debug.c b/drivers/gpu/nvgpu/common/linux/debug.c index ee93a901..8738f3e7 100644 --- a/drivers/gpu/nvgpu/common/linux/debug.c +++ b/drivers/gpu/nvgpu/common/linux/debug.c @@ -267,9 +267,6 @@ static int gk20a_railgating_debugfs_init(struct gk20a *g) struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); struct dentry *d; - if (!g->can_railgate) - return 0; - d = debugfs_create_file( "railgate_residency", S_IRUGO|S_IWUSR, l->debugfs, g, &railgate_residency_fops); -- cgit v1.2.2