summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2019-02-15 05:44:19 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2019-09-06 01:39:42 -0400
commit0e32642508811c02c64477ca03948dc0cbdd8bfc (patch)
treefa01c83f3324598d6a5b0f4d655d7a7233781787
parent0214511e2e085b8233600467ab2b044f9f826bc8 (diff)
gpu: nvgpu: fix trace ring read after invalid entry
gk20a_fecs_trace_poll() right now calls gk20a_fecs_trace_ring_read() to read the trace ring buffer written by FECS gk20a_fecs_trace_ring_read() returns number of trace entries written to local buffer if successful, otherwise returns error In case there is really an invalid entry, gk20a_fecs_trace_poll() will just stop reading more entries, write current read pointer to h/w and return When gk20a_fecs_trace_poll() is called next time, we again read that invalid entry, and again skip it, and again return This keeps happening, and we never move on to read new entries Fix this by always continuing to read next entry irrespective of current entry is valid or not gk20a_fecs_trace_poll() now just prints a debug message instead of breaking the loop Bug 200491708 Bug 200542611 Reviewed-on: https://git-master.nvidia.com/r/2020167 (cherry picked from commit decbbf35041e7e551b3f354e582daaa5c8c3cc0a) Change-Id: If8b3c8af63ce662a41ada93a6986fa149e34f664 Signed-off-by: seshendra <sgadagottu@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2190151 GVS: Gerrit_Virtual_Submit Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Winnie Hsu <whsu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
index ba85e3a3..5c1c5e0e 100644
--- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
@@ -371,8 +371,10 @@ int gk20a_fecs_trace_poll(struct gk20a *g)
371 371
372 while (read != write) { 372 while (read != write) {
373 cnt = gk20a_fecs_trace_ring_read(g, read); 373 cnt = gk20a_fecs_trace_ring_read(g, read);
374 if (cnt <= 0) 374 if (cnt > 0) {
375 break; 375 nvgpu_log(g, gpu_dbg_ctxsw,
376 "number of trace entries added: %d", cnt);
377 }
376 378
377 /* Get to next record. */ 379 /* Get to next record. */
378 read = (read + 1) & (GK20A_FECS_TRACE_NUM_RECORDS - 1); 380 read = (read + 1) & (GK20A_FECS_TRACE_NUM_RECORDS - 1);