From bcab5c148607867eea29e2a2ac82c6b967995525 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Fri, 16 Mar 2018 15:56:44 -0700 Subject: gpu: nvgpu: add gops.fifo.check_tsg_ctxsw_timeout/check_ch_ctxsw_timeout RM Server acts differently for ctxsw timeout check. It won't check GP_GET or accumulated timeouts, but notify guest and go to recovery. Jira VQRM-3058 Change-Id: I428aea34dc517311eb7e73feb556145e916309fb Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/1679706 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 4 ++-- drivers/gpu/nvgpu/gk20a/gk20a.h | 4 ++++ drivers/gpu/nvgpu/gm20b/hal_gm20b.c | 2 ++ drivers/gpu/nvgpu/gp106/hal_gp106.c | 2 ++ drivers/gpu/nvgpu/gp10b/hal_gp10b.c | 2 ++ drivers/gpu/nvgpu/gv100/hal_gv100.c | 2 ++ drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 2 ++ drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c | 2 ++ drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c | 2 ++ 9 files changed, 20 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index f069b193..79aec7a2 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -2216,10 +2216,10 @@ bool gk20a_fifo_handle_sched_error(struct gk20a *g) bool verbose = false; if (is_tsg) { - ret = gk20a_fifo_check_tsg_ctxsw_timeout( + ret = g->ops.fifo.check_tsg_ctxsw_timeout( &f->tsg[id], &verbose, &ms); } else { - ret = gk20a_fifo_check_ch_ctxsw_timeout( + ret = g->ops.fifo.check_ch_ctxsw_timeout( &f->channel[id], &verbose, &ms); } diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 43284ba5..76413600 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -629,6 +629,10 @@ struct gpu_ops { u32 (*get_preempt_timeout)(struct gk20a *g); void (*post_event_id)(struct tsg_gk20a *tsg, int event_id); void (*ch_abort_clean_up)(struct channel_gk20a *ch); + bool (*check_tsg_ctxsw_timeout)(struct tsg_gk20a *tsg, + bool *verbose, u32 *ms); + bool (*check_ch_ctxsw_timeout)(struct channel_gk20a *ch, + bool *verbose, u32 *ms); #ifdef CONFIG_TEGRA_GK20A_NVHOST int (*alloc_syncpt_buf)(struct channel_gk20a *c, u32 syncpt_id, struct nvgpu_mem *syncpt_buf); diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c index f2ae97cf..fa493192 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c @@ -439,6 +439,8 @@ static const struct gpu_ops gm20b_ops = { .tsg_unbind_channel = gk20a_fifo_tsg_unbind_channel, .post_event_id = gk20a_tsg_event_id_post_event, .ch_abort_clean_up = gk20a_channel_abort_clean_up, + .check_tsg_ctxsw_timeout = gk20a_fifo_check_tsg_ctxsw_timeout, + .check_ch_ctxsw_timeout = gk20a_fifo_check_ch_ctxsw_timeout, #ifdef CONFIG_TEGRA_GK20A_NVHOST .alloc_syncpt_buf = gk20a_fifo_alloc_syncpt_buf, .free_syncpt_buf = gk20a_fifo_free_syncpt_buf, diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index d87af8d3..892e71f7 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c @@ -500,6 +500,8 @@ static const struct gpu_ops gp106_ops = { .tsg_unbind_channel = gk20a_fifo_tsg_unbind_channel, .post_event_id = gk20a_tsg_event_id_post_event, .ch_abort_clean_up = gk20a_channel_abort_clean_up, + .check_tsg_ctxsw_timeout = gk20a_fifo_check_tsg_ctxsw_timeout, + .check_ch_ctxsw_timeout = gk20a_fifo_check_ch_ctxsw_timeout, #ifdef CONFIG_TEGRA_GK20A_NVHOST .alloc_syncpt_buf = gk20a_fifo_alloc_syncpt_buf, .free_syncpt_buf = gk20a_fifo_free_syncpt_buf, diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index 3461e184..4db7e557 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c @@ -471,6 +471,8 @@ static const struct gpu_ops gp10b_ops = { .tsg_unbind_channel = gk20a_fifo_tsg_unbind_channel, .post_event_id = gk20a_tsg_event_id_post_event, .ch_abort_clean_up = gk20a_channel_abort_clean_up, + .check_tsg_ctxsw_timeout = gk20a_fifo_check_tsg_ctxsw_timeout, + .check_ch_ctxsw_timeout = gk20a_fifo_check_ch_ctxsw_timeout, #ifdef CONFIG_TEGRA_GK20A_NVHOST .alloc_syncpt_buf = gk20a_fifo_alloc_syncpt_buf, .free_syncpt_buf = gk20a_fifo_free_syncpt_buf, diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c index 8ddc538a..f3e25ddd 100644 --- a/drivers/gpu/nvgpu/gv100/hal_gv100.c +++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c @@ -512,6 +512,8 @@ static const struct gpu_ops gv100_ops = { .tsg_unbind_channel = gk20a_fifo_tsg_unbind_channel, .post_event_id = gk20a_tsg_event_id_post_event, .ch_abort_clean_up = gk20a_channel_abort_clean_up, + .check_tsg_ctxsw_timeout = gk20a_fifo_check_tsg_ctxsw_timeout, + .check_ch_ctxsw_timeout = gk20a_fifo_check_ch_ctxsw_timeout, #ifdef CONFIG_TEGRA_GK20A_NVHOST .alloc_syncpt_buf = gv11b_fifo_alloc_syncpt_buf, .free_syncpt_buf = gv11b_fifo_free_syncpt_buf, diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index 9af5e96b..fbf8ad61 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -529,6 +529,8 @@ static const struct gpu_ops gv11b_ops = { .tsg_unbind_channel = gk20a_fifo_tsg_unbind_channel, .post_event_id = gk20a_tsg_event_id_post_event, .ch_abort_clean_up = gk20a_channel_abort_clean_up, + .check_tsg_ctxsw_timeout = gk20a_fifo_check_tsg_ctxsw_timeout, + .check_ch_ctxsw_timeout = gk20a_fifo_check_ch_ctxsw_timeout, #ifdef CONFIG_TEGRA_GK20A_NVHOST .alloc_syncpt_buf = gv11b_fifo_alloc_syncpt_buf, .free_syncpt_buf = gv11b_fifo_free_syncpt_buf, diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c index 819ca852..8b8c630d 100644 --- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c +++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c @@ -345,6 +345,8 @@ static const struct gpu_ops vgpu_gp10b_ops = { .tsg_unbind_channel = vgpu_tsg_unbind_channel, .post_event_id = gk20a_tsg_event_id_post_event, .ch_abort_clean_up = gk20a_channel_abort_clean_up, + .check_tsg_ctxsw_timeout = gk20a_fifo_check_tsg_ctxsw_timeout, + .check_ch_ctxsw_timeout = gk20a_fifo_check_ch_ctxsw_timeout, #ifdef CONFIG_TEGRA_GK20A_NVHOST .alloc_syncpt_buf = gk20a_fifo_alloc_syncpt_buf, .free_syncpt_buf = gk20a_fifo_free_syncpt_buf, diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c index 92d401e9..5dbf6779 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c @@ -388,6 +388,8 @@ static const struct gpu_ops vgpu_gv11b_ops = { .tsg_unbind_channel = vgpu_tsg_unbind_channel, .post_event_id = gk20a_tsg_event_id_post_event, .ch_abort_clean_up = gk20a_channel_abort_clean_up, + .check_tsg_ctxsw_timeout = gk20a_fifo_check_tsg_ctxsw_timeout, + .check_ch_ctxsw_timeout = gk20a_fifo_check_ch_ctxsw_timeout, #ifdef CONFIG_TEGRA_GK20A_NVHOST .alloc_syncpt_buf = vgpu_gv11b_fifo_alloc_syncpt_buf, .free_syncpt_buf = gv11b_fifo_free_syncpt_buf, -- cgit v1.2.2