summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2014-03-17 08:51:55 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:08:54 -0400
commit4a8f0db37976036abfe4d70ff60cd0991a177a7d (patch)
tree5c633c963f3d278b8b15e478f751125c867abc93 /drivers/gpu/nvgpu
parentb5acc421ee159c932e9e95adaa6d89a0c2141b38 (diff)
gpu: nvgpu: gk20a: Fix G_ELPG flush poll
We poll completion of flush sequence by polling the broadcast register. The polling should be done for a per-slice register instead. Bug 1457723 Change-Id: I10aba939175b6d05b05f5f26eebebcbe09d9b4a7 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/382521 Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com> Tested-by: Juha Tukkinen <jtukkinen@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h3
-rw-r--r--drivers/gpu/nvgpu/gk20a/hw_ltc_gk20a.h24
-rw-r--r--drivers/gpu/nvgpu/gk20a/ltc_common.c10
-rw-r--r--drivers/gpu/nvgpu/gk20a/ltc_gk20a.c8
4 files changed, 36 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index c19b2bf8..3bc53992 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -73,6 +73,7 @@ struct gpu_ops {
73 int (*init_zbc)(struct gk20a *g, struct gr_gk20a *gr); 73 int (*init_zbc)(struct gk20a *g, struct gr_gk20a *gr);
74 void (*init_cbc)(struct gk20a *g, struct gr_gk20a *gr); 74 void (*init_cbc)(struct gk20a *g, struct gr_gk20a *gr);
75 void (*sync_debugfs)(struct gk20a *g); 75 void (*sync_debugfs)(struct gk20a *g);
76 void (*init_fs_state)(struct gk20a *g);
76 void (*elpg_flush)(struct gk20a *g); 77 void (*elpg_flush)(struct gk20a *g);
77 } ltc; 78 } ltc;
78 struct { 79 struct {
@@ -287,6 +288,8 @@ struct gk20a {
287 288
288 int irq_stall; 289 int irq_stall;
289 int irq_nonstall; 290 int irq_nonstall;
291 u32 max_ltc_count;
292 u32 ltc_count;
290 293
291 struct generic_pm_domain pd; 294 struct generic_pm_domain pd;
292 295
diff --git a/drivers/gpu/nvgpu/gk20a/hw_ltc_gk20a.h b/drivers/gpu/nvgpu/gk20a/hw_ltc_gk20a.h
index 65221b59..8ea4ef71 100644
--- a/drivers/gpu/nvgpu/gk20a/hw_ltc_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/hw_ltc_gk20a.h
@@ -198,19 +198,35 @@ static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_2_l2_bypass_mode_enabled_f(void)
198{ 198{
199 return 0x10000000; 199 return 0x10000000;
200} 200}
201static inline u32 ltc_ltss_g_elpg_r(void) 201static inline u32 ltc_ltcs_ltss_g_elpg_r(void)
202{ 202{
203 return 0x0017e828; 203 return 0x0017e828;
204} 204}
205static inline u32 ltc_ltss_g_elpg_flush_v(u32 r) 205static inline u32 ltc_ltcs_ltss_g_elpg_flush_v(u32 r)
206{ 206{
207 return (r >> 0) & 0x1; 207 return (r >> 0) & 0x1;
208} 208}
209static inline u32 ltc_ltss_g_elpg_flush_pending_v(void) 209static inline u32 ltc_ltcs_ltss_g_elpg_flush_pending_v(void)
210{ 210{
211 return 0x00000001; 211 return 0x00000001;
212} 212}
213static inline u32 ltc_ltss_g_elpg_flush_pending_f(void) 213static inline u32 ltc_ltcs_ltss_g_elpg_flush_pending_f(void)
214{
215 return 0x1;
216}
217static inline u32 ltc_ltc0_ltss_g_elpg_r(void)
218{
219 return 0x00140828;
220}
221static inline u32 ltc_ltc0_ltss_g_elpg_flush_v(u32 r)
222{
223 return (r >> 0) & 0x1;
224}
225static inline u32 ltc_ltc0_ltss_g_elpg_flush_pending_v(void)
226{
227 return 0x00000001;
228}
229static inline u32 ltc_ltc0_ltss_g_elpg_flush_pending_f(void)
214{ 230{
215 return 0x1; 231 return 0x1;
216} 232}
diff --git a/drivers/gpu/nvgpu/gk20a/ltc_common.c b/drivers/gpu/nvgpu/gk20a/ltc_common.c
index cbb27cc7..bc45ac41 100644
--- a/drivers/gpu/nvgpu/gk20a/ltc_common.c
+++ b/drivers/gpu/nvgpu/gk20a/ltc_common.c
@@ -222,13 +222,13 @@ static void gk20a_mm_g_elpg_flush_locked(struct gk20a *g)
222 /* Make sure all previous writes are committed to the L2. There's no 222 /* Make sure all previous writes are committed to the L2. There's no
223 guarantee that writes are to DRAM. This will be a sysmembar internal 223 guarantee that writes are to DRAM. This will be a sysmembar internal
224 to the L2. */ 224 to the L2. */
225 gk20a_writel(g, ltc_ltss_g_elpg_r(), 225 gk20a_writel(g, ltc_ltcs_ltss_g_elpg_r(),
226 ltc_ltss_g_elpg_flush_pending_f()); 226 ltc_ltcs_ltss_g_elpg_flush_pending_f());
227 do { 227 do {
228 data = gk20a_readl(g, ltc_ltss_g_elpg_r()); 228 data = gk20a_readl(g, ltc_ltc0_ltss_g_elpg_r());
229 229
230 if (ltc_ltss_g_elpg_flush_v(data) == 230 if (ltc_ltc0_ltss_g_elpg_flush_v(data) ==
231 ltc_ltss_g_elpg_flush_pending_v()) { 231 ltc_ltc0_ltss_g_elpg_flush_pending_v()) {
232 gk20a_dbg_info("g_elpg_flush 0x%x", data); 232 gk20a_dbg_info("g_elpg_flush 0x%x", data);
233 retry--; 233 retry--;
234 usleep_range(20, 40); 234 usleep_range(20, 40);
diff --git a/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c b/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c
index 08aedecd..6da5adb9 100644
--- a/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c
@@ -184,6 +184,13 @@ static void gk20a_ltc_sync_debugfs(struct gk20a *g)
184} 184}
185#endif 185#endif
186 186
187static void gk20a_ltc_init_fs_state(struct gk20a *g)
188{
189 gk20a_dbg_info("initialize gk20a L2");
190
191 g->max_ltc_count = g->ltc_count = 1;
192}
193
187void gk20a_init_ltc(struct gpu_ops *gops) 194void gk20a_init_ltc(struct gpu_ops *gops)
188{ 195{
189 gops->ltc.determine_L2_size_bytes = gk20a_determine_L2_size_bytes; 196 gops->ltc.determine_L2_size_bytes = gk20a_determine_L2_size_bytes;
@@ -200,4 +207,5 @@ void gk20a_init_ltc(struct gpu_ops *gops)
200 gops->ltc.sync_debugfs = gk20a_ltc_sync_debugfs; 207 gops->ltc.sync_debugfs = gk20a_ltc_sync_debugfs;
201#endif 208#endif
202 gops->ltc.elpg_flush = gk20a_mm_g_elpg_flush_locked; 209 gops->ltc.elpg_flush = gk20a_mm_g_elpg_flush_locked;
210 gops->ltc.init_fs_state = gk20a_ltc_init_fs_state;
203} 211}