summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-08-25 18:39:14 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-01-31 13:33:48 -0500
commitdddeee54b640e4c28866354b7f2e4edd907e3344 (patch)
treec98de41b1702f66734a836bca8e6c5d9288de4d1 /drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
parent9cba01592b5b0aec595823c3062510ee08e2f8e1 (diff)
gpu: nvgpu: Fix priv ring error detection
Use hardware headers instead of hardcoded register numbers in priv ring. This required updating the priv ring headers to add all the registers and fields needed. Incidentally this also gets rid of a lot of GPC priv ring registers as they're not used in our code. Also delete duplicate prints for the same information. We were dumping GPC error also in gk20a_pbus_isr(), and we dumped master information twice. Dump status of each GPC separately instead of supporting only GPC0. Change-Id: Ic50817ecc50892618fa27947fa83b05148b2cd6a Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1295481 GVS: Gerrit_Virtual_Submit Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
index 420b65f1..a44df1e8 100644
--- a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
@@ -23,6 +23,7 @@
23#include <nvgpu/hw/gk20a/hw_mc_gk20a.h> 23#include <nvgpu/hw/gk20a/hw_mc_gk20a.h>
24#include <nvgpu/hw/gk20a/hw_pri_ringmaster_gk20a.h> 24#include <nvgpu/hw/gk20a/hw_pri_ringmaster_gk20a.h>
25#include <nvgpu/hw/gk20a/hw_pri_ringstation_sys_gk20a.h> 25#include <nvgpu/hw/gk20a/hw_pri_ringstation_sys_gk20a.h>
26#include <nvgpu/hw/gk20a/hw_pri_ringstation_gpc_gk20a.h>
26 27
27void gk20a_enable_priv_ring(struct gk20a *g) 28void gk20a_enable_priv_ring(struct gk20a *g)
28{ 29{
@@ -71,6 +72,8 @@ void gk20a_priv_ring_isr(struct gk20a *g)
71 u32 status0, status1; 72 u32 status0, status1;
72 u32 cmd; 73 u32 cmd;
73 s32 retry = 100; 74 s32 retry = 100;
75 u32 gpc;
76 u32 gpc_stride = nvgpu_get_litter_value(g, GPU_LIT_GPC_STRIDE);
74 struct gk20a_platform *platform = dev_get_drvdata(g->dev); 77 struct gk20a_platform *platform = dev_get_drvdata(g->dev);
75 78
76 if (platform->is_fmodel) 79 if (platform->is_fmodel)
@@ -82,20 +85,28 @@ void gk20a_priv_ring_isr(struct gk20a *g)
82 gk20a_dbg(gpu_dbg_intr, "ringmaster intr status0: 0x%08x," 85 gk20a_dbg(gpu_dbg_intr, "ringmaster intr status0: 0x%08x,"
83 "status1: 0x%08x", status0, status1); 86 "status1: 0x%08x", status0, status1);
84 87
85 if (status0 & (0x1 | 0x2 | 0x4)) { 88 if (pri_ringmaster_intr_status0_ring_start_conn_fault_v(status0) != 0 ||
89 pri_ringmaster_intr_status0_disconnect_fault_v(status0) != 0 ||
90 pri_ringmaster_intr_status0_overflow_fault_v(status0) != 0) {
86 gk20a_reset_priv_ring(g); 91 gk20a_reset_priv_ring(g);
87 } 92 }
88 93
89 if (status0 & 0x100) { 94 if (pri_ringmaster_intr_status0_gbl_write_error_sys_v(status0) != 0) {
90 gk20a_dbg(gpu_dbg_intr, "SYS write error. ADR %08x WRDAT %08x INFO %08x, CODE %08x", 95 gk20a_dbg(gpu_dbg_intr, "SYS write error. ADR %08x WRDAT %08x INFO %08x, CODE %08x",
91 gk20a_readl(g, 0x122120), gk20a_readl(g, 0x122124), gk20a_readl(g, 0x122128), 96 gk20a_readl(g, pri_ringstation_sys_priv_error_adr_r()),
92 gk20a_readl(g, 0x12212c)); 97 gk20a_readl(g, pri_ringstation_sys_priv_error_wrdat_r()),
98 gk20a_readl(g, pri_ringstation_sys_priv_error_info_r()),
99 gk20a_readl(g, pri_ringstation_sys_priv_error_code_r()));
93 } 100 }
94 101
95 if (status1 & 0x1) { 102 for (gpc = 0; gpc < g->gr.gpc_count; gpc++) {
96 gk20a_dbg(gpu_dbg_intr, "GPC write error. ADR %08x WRDAT %08x INFO %08x, CODE %08x", 103 if (status1 & BIT(gpc)) {
97 gk20a_readl(g, 0x128120), gk20a_readl(g, 0x128124), gk20a_readl(g, 0x128128), 104 gk20a_dbg(gpu_dbg_intr, "GPC%u write error. ADR %08x WRDAT %08x INFO %08x, CODE %08x", gpc,
98 gk20a_readl(g, 0x12812c)); 105 gk20a_readl(g, pri_ringstation_gpc_gpc0_priv_error_adr_r() + gpc * gpc_stride),
106 gk20a_readl(g, pri_ringstation_gpc_gpc0_priv_error_wrdat_r() + gpc * gpc_stride),
107 gk20a_readl(g, pri_ringstation_gpc_gpc0_priv_error_info_r() + gpc * gpc_stride),
108 gk20a_readl(g, pri_ringstation_gpc_gpc0_priv_error_code_r() + gpc * gpc_stride));
109 }
99 } 110 }
100 111
101 cmd = gk20a_readl(g, pri_ringmaster_command_r()); 112 cmd = gk20a_readl(g, pri_ringmaster_command_r());
@@ -112,10 +123,4 @@ void gk20a_priv_ring_isr(struct gk20a *g)
112 if (retry <= 0) 123 if (retry <= 0)
113 gk20a_warn(dev_from_gk20a(g), 124 gk20a_warn(dev_from_gk20a(g),
114 "priv ringmaster cmd ack too many retries"); 125 "priv ringmaster cmd ack too many retries");
115
116 status0 = gk20a_readl(g, pri_ringmaster_intr_status0_r());
117 status1 = gk20a_readl(g, pri_ringmaster_intr_status1_r());
118
119 gk20a_dbg_info("ringmaster intr status0: 0x%08x,"
120 " status1: 0x%08x", status0, status1);
121} 126}