diff options
author | Seema Khowala <seemaj@nvidia.com> | 2018-12-04 13:41:19 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-12-29 02:51:39 -0500 |
commit | 89d5f40116d0d84c2f6d8427560dd24f64f2dcaa (patch) | |
tree | c700dfb0d77b474933cc95f37590f30b0458204f | |
parent | 8e2d0c7b3d98149fd753792f183e6a1ae9ebc456 (diff) |
gpu: nvgpu: handle timestamp buffer full ctxsw_intr0
If enabled, fecs trace updating happens from ucode
side even when there is no fecs trace dumper application
to consume it. Due to this, trace buffer will get
eventually full and ucode will trigger ctxsw_intr0.
Reset fecs_trace buffer to handle timestamp buffer full
ctxsw_intr0.
Bug 2361571
Bug 200472922
Change-Id: Ia26a17635fc6bd6e8663b8af983acc91839ecfcd
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1965370
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
(cherry picked from commit 790ba095543b33f4cc3a145559ad31a1e9f99d98)
Reviewed-on: https://git-master.nvidia.com/r/1979746
GVS: Gerrit_Virtual_Submit
Reviewed-by: Debarshi Dutta <ddutta@nvidia.com>
Tested-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 15 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 2 |
4 files changed, 24 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c index b30d1743..cac3ce27 100644 --- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c | |||
@@ -634,4 +634,12 @@ bool gk20a_fecs_trace_is_enabled(struct gk20a *g) | |||
634 | 634 | ||
635 | return (trace && nvgpu_thread_is_running(&trace->poll_task)); | 635 | return (trace && nvgpu_thread_is_running(&trace->poll_task)); |
636 | } | 636 | } |
637 | |||
638 | void gk20a_fecs_trace_reset_buffer(struct gk20a *g) | ||
639 | { | ||
640 | nvgpu_log(g, gpu_dbg_fn|gpu_dbg_ctxsw, " "); | ||
641 | |||
642 | gk20a_fecs_trace_set_read_index(g, | ||
643 | gk20a_fecs_trace_get_write_index(g)); | ||
644 | } | ||
637 | #endif /* CONFIG_GK20A_CTXSW_TRACE */ | 645 | #endif /* CONFIG_GK20A_CTXSW_TRACE */ |
diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.h b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.h index cbde2fe7..d33e619b 100644 --- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.h | |||
@@ -40,5 +40,6 @@ int gk20a_fecs_trace_enable(struct gk20a *g); | |||
40 | int gk20a_fecs_trace_disable(struct gk20a *g); | 40 | int gk20a_fecs_trace_disable(struct gk20a *g); |
41 | bool gk20a_fecs_trace_is_enabled(struct gk20a *g); | 41 | bool gk20a_fecs_trace_is_enabled(struct gk20a *g); |
42 | size_t gk20a_fecs_trace_buffer_size(struct gk20a *g); | 42 | size_t gk20a_fecs_trace_buffer_size(struct gk20a *g); |
43 | void gk20a_fecs_trace_reset_buffer(struct gk20a *g); | ||
43 | 44 | ||
44 | #endif /* NVGPU_GK20A_FECS_TRACE_GK20A_H */ | 45 | #endif /* NVGPU_GK20A_FECS_TRACE_GK20A_H */ |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 8d65f90a..4541134f 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -5308,9 +5308,20 @@ int gk20a_gr_handle_fecs_error(struct gk20a *g, struct channel_gk20a *ch, | |||
5308 | gr_fecs_host_int_status_ctxsw_intr_f(CTXSW_INTR0)) != 0U) { | 5308 | gr_fecs_host_int_status_ctxsw_intr_f(CTXSW_INTR0)) != 0U) { |
5309 | u32 mailbox_value = gk20a_readl(g, gr_fecs_ctxsw_mailbox_r(6)); | 5309 | u32 mailbox_value = gk20a_readl(g, gr_fecs_ctxsw_mailbox_r(6)); |
5310 | 5310 | ||
5311 | nvgpu_err(g, "ctxsw intr0 set by ucode, error_code: 0x%08x", | 5311 | if (mailbox_value == MAILBOX_VALUE_TIMESTAMP_BUFFER_FULL) { |
5312 | nvgpu_info(g, "ctxsw intr0 set by ucode, " | ||
5313 | "timestamp buffer full"); | ||
5314 | #ifdef CONFIG_GK20A_CTXSW_TRACE | ||
5315 | gk20a_fecs_trace_reset_buffer(g); | ||
5316 | #else | ||
5317 | ret = -1; | ||
5318 | #endif | ||
5319 | } else { | ||
5320 | nvgpu_err(g, | ||
5321 | "ctxsw intr0 set by ucode, error_code: 0x%08x", | ||
5312 | mailbox_value); | 5322 | mailbox_value); |
5313 | ret = -1; | 5323 | ret = -1; |
5324 | } | ||
5314 | } else { | 5325 | } else { |
5315 | nvgpu_err(g, | 5326 | nvgpu_err(g, |
5316 | "unhandled fecs error interrupt 0x%08x for channel %u", | 5327 | "unhandled fecs error interrupt 0x%08x for channel %u", |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index 25850104..9ccd555a 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h | |||
@@ -69,6 +69,8 @@ | |||
69 | #define CTXSW_INTR0 BIT32(0) | 69 | #define CTXSW_INTR0 BIT32(0) |
70 | #define CTXSW_INTR1 BIT32(1) | 70 | #define CTXSW_INTR1 BIT32(1) |
71 | 71 | ||
72 | #define MAILBOX_VALUE_TIMESTAMP_BUFFER_FULL 0x26 | ||
73 | |||
72 | struct tsg_gk20a; | 74 | struct tsg_gk20a; |
73 | struct channel_gk20a; | 75 | struct channel_gk20a; |
74 | struct nvgpu_warpstate; | 76 | struct nvgpu_warpstate; |