summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/os
diff options
context:
space:
mode:
authorPreetham Chandru R <pchandru@nvidia.com>2018-09-10 13:43:29 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-10 18:04:29 -0400
commit4f01d6a9b9a54cf6042db157de0d40965077f6a2 (patch)
tree6d29153164fdcd715f15554a04ae5487972b96fd /drivers/gpu/nvgpu/os
parent5366778e8e81da276dd4ceb3bf70fb2e9256a3b1 (diff)
gpu: nvgpu: deny any request less than engine timeout
Bug 2343124 JIRA NVGPU-1065 Change-Id: I43a436673117af8ac2490d075cea07532f01af0b Signed-off-by: Preetham Chandru R <pchandru@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1818164 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os')
-rw-r--r--drivers/gpu/nvgpu/os/linux/ioctl_channel.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_channel.c b/drivers/gpu/nvgpu/os/linux/ioctl_channel.c
index e9a24923..b48cfa99 100644
--- a/drivers/gpu/nvgpu/os/linux/ioctl_channel.c
+++ b/drivers/gpu/nvgpu/os/linux/ioctl_channel.c
@@ -1227,6 +1227,11 @@ long gk20a_channel_ioctl(struct file *filp,
1227 (u32)((struct nvgpu_set_timeout_args *)buf)->timeout; 1227 (u32)((struct nvgpu_set_timeout_args *)buf)->timeout;
1228 nvgpu_log(g, gpu_dbg_gpu_dbg, "setting timeout (%d ms) for chid %d", 1228 nvgpu_log(g, gpu_dbg_gpu_dbg, "setting timeout (%d ms) for chid %d",
1229 timeout, ch->chid); 1229 timeout, ch->chid);
1230 if (timeout < g->fifo_eng_timeout_us / 1000) {
1231 dump_stack();
1232 err = -EINVAL;
1233 break;
1234 }
1230 ch->timeout_ms_max = timeout; 1235 ch->timeout_ms_max = timeout;
1231 gk20a_channel_trace_sched_param( 1236 gk20a_channel_trace_sched_param(
1232 trace_gk20a_channel_set_timeout, ch); 1237 trace_gk20a_channel_set_timeout, ch);
@@ -1241,6 +1246,11 @@ long gk20a_channel_ioctl(struct file *filp,
1241 (1 << NVGPU_TIMEOUT_FLAG_DISABLE_DUMP)); 1246 (1 << NVGPU_TIMEOUT_FLAG_DISABLE_DUMP));
1242 nvgpu_log(g, gpu_dbg_gpu_dbg, "setting timeout (%d ms) for chid %d", 1247 nvgpu_log(g, gpu_dbg_gpu_dbg, "setting timeout (%d ms) for chid %d",
1243 timeout, ch->chid); 1248 timeout, ch->chid);
1249 if (timeout < g->fifo_eng_timeout_us / 1000) {
1250 dump_stack();
1251 err = -EINVAL;
1252 break;
1253 }
1244 ch->timeout_ms_max = timeout; 1254 ch->timeout_ms_max = timeout;
1245 ch->timeout_debug_dump = timeout_debug_dump; 1255 ch->timeout_debug_dump = timeout_debug_dump;
1246 gk20a_channel_trace_sched_param( 1256 gk20a_channel_trace_sched_param(