summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeema Khowala <seemaj@nvidia.com>2018-04-03 21:52:56 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-04-23 13:03:34 -0400
commit24cf5916b7e503abce4d9a61c647636800acdacd (patch)
tree2956ddb1ee38b80395adae5041fcd9ab196a14b0
parent31024f85ebda64b0fed0e487f4730cfdccf9ee8e (diff)
gpu: nvgpu: err if powergate is enabled before hwpm ctxsw mode write
If the power gating mode is not disabled before hwpm context switch mode register write, return error. Bug 200379815 Bug 2053656 Bug 2092996 Change-Id: I656f5c38616a4250830779d2bca5e207ff28f3a9 Signed-off-by: Seema Khowala <seemaj@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1688219 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_dbg.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c b/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c
index d288280e..a53d1cfb 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c
@@ -1020,8 +1020,7 @@ static int nvgpu_dbg_gpu_ioctl_hwpm_ctxsw_mode(struct dbg_session_gk20a *dbg_s,
1020 struct gk20a *g = dbg_s->g; 1020 struct gk20a *g = dbg_s->g;
1021 struct channel_gk20a *ch_gk20a; 1021 struct channel_gk20a *ch_gk20a;
1022 1022
1023 gk20a_dbg_fn("%s pm ctxsw mode = %d", 1023 nvgpu_log_fn(g, "%s pm ctxsw mode = %d", g->name, args->mode);
1024 g->name, args->mode);
1025 1024
1026 /* Must have a valid reservation to enable/disable hwpm cxtsw. 1025 /* Must have a valid reservation to enable/disable hwpm cxtsw.
1027 * Just print an error message for now, but eventually this should 1026 * Just print an error message for now, but eventually this should
@@ -1049,13 +1048,16 @@ static int nvgpu_dbg_gpu_ioctl_hwpm_ctxsw_mode(struct dbg_session_gk20a *dbg_s,
1049 err = -EINVAL; 1048 err = -EINVAL;
1050 goto clean_up; 1049 goto clean_up;
1051 } 1050 }
1052 1051 if (!dbg_s->is_pg_disabled) {
1052 nvgpu_err(g, "powergate is not disabled");
1053 err = -ENOSYS;
1054 goto clean_up;
1055 }
1053 err = g->ops.gr.update_hwpm_ctxsw_mode(g, ch_gk20a, 0, 1056 err = g->ops.gr.update_hwpm_ctxsw_mode(g, ch_gk20a, 0,
1054 args->mode == NVGPU_DBG_GPU_HWPM_CTXSW_MODE_CTXSW); 1057 args->mode == NVGPU_DBG_GPU_HWPM_CTXSW_MODE_CTXSW);
1055 if (err) 1058 if (err)
1056 nvgpu_err(g, 1059 nvgpu_err(g,
1057 "error (%d) during pm ctxsw mode update", err); 1060 "error (%d) during pm ctxsw mode update", err);
1058
1059 /* gk20a would require a WAR to set the core PM_ENABLE bit, not 1061 /* gk20a would require a WAR to set the core PM_ENABLE bit, not
1060 * added here with gk20a being deprecated 1062 * added here with gk20a being deprecated
1061 */ 1063 */