summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVijayakumar <vsubbu@nvidia.com>2015-01-29 06:13:13 -0500
committerTerje Bergstrom <tbergstrom@nvidia.com>2015-10-06 16:30:54 -0400
commitd60a45b9fdd935c5e0c29c2cc3c056e0ce8c9873 (patch)
tree7ae5d2acc30e9d2fb9dfb55674985cf16b847192 /drivers
parentf4b6d4d176e9c83b226d8564595b6b9168cef793 (diff)
gpu: nvgpu: scale ptimer based timeouts
bug 1603226 host based timeouts use ptimer for detecting timeouts. on gk20a and gm20b ptimer runs 2.6x slower. scale the fifo_eng_timeout to account for this Change-Id: Ie44718382953e36436ea47d6e89b9a225d5c2070 Signed-off-by: Vijayakumar <vsubbu@nvidia.com> Reviewed-on: http://git-master/r/799983 (cherry picked from commit d1d837fd09ff0f035feff1757c67488404c23cc6) Reviewed-on: http://git-master/r/808250 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/fifo_gk20a.c6
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h7
-rw-r--r--drivers/gpu/nvgpu/gk20a/platform_gk20a.h3
-rw-r--r--drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c2
-rw-r--r--drivers/gpu/nvgpu/gm20b/hal_gm20b.c1
5 files changed, 16 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
index f736fe8c..ae36478e 100644
--- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
@@ -344,6 +344,7 @@ int gk20a_init_fifo_reset_enable_hw(struct gk20a *g)
344 u32 mask; 344 u32 mask;
345 u32 timeout; 345 u32 timeout;
346 int i; 346 int i;
347 struct gk20a_platform *platform = platform_get_drvdata(g->dev);
347 348
348 gk20a_dbg_fn(""); 349 gk20a_dbg_fn("");
349 /* enable pmc pfifo */ 350 /* enable pmc pfifo */
@@ -408,8 +409,9 @@ int gk20a_init_fifo_reset_enable_hw(struct gk20a *g)
408 if (g->ops.fifo.apply_pb_timeout) 409 if (g->ops.fifo.apply_pb_timeout)
409 g->ops.fifo.apply_pb_timeout(g); 410 g->ops.fifo.apply_pb_timeout(g);
410 411
411 timeout = GRFIFO_TIMEOUT_CHECK_PERIOD_US | 412 timeout = GRFIFO_TIMEOUT_CHECK_PERIOD_US;
412 fifo_eng_timeout_detection_enabled_f(); 413 timeout = scale_ptimer(timeout, platform->ptimerscaling10x);
414 timeout |= fifo_eng_timeout_detection_enabled_f();
413 gk20a_writel(g, fifo_eng_timeout_r(), timeout); 415 gk20a_writel(g, fifo_eng_timeout_r(), timeout);
414 416
415 gk20a_dbg_fn("done"); 417 gk20a_dbg_fn("done");
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index f107d83d..8290e7e7 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -886,4 +886,11 @@ void gk20a_user_deinit(struct platform_device *dev);
886 886
887extern void gk20a_debug_dump_device(struct platform_device *pdev); 887extern void gk20a_debug_dump_device(struct platform_device *pdev);
888 888
889static inline u32 scale_ptimer(u32 timeout , u32 scale10x)
890{
891 if (((timeout*10) % scale10x) >= (scale10x/2))
892 return ((timeout * 10) / scale10x) + 1;
893 else
894 return (timeout * 10) / scale10x;
895}
889#endif /* GK20A_H */ 896#endif /* GK20A_H */
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
index 46f83d6d..adacdb6b 100644
--- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
@@ -94,6 +94,9 @@ struct gk20a_platform {
94 /* Default big page size 64K or 128K */ 94 /* Default big page size 64K or 128K */
95 u32 default_big_page_size; 95 u32 default_big_page_size;
96 96
97 /* scaling factor for ptimer */
98 u32 ptimerscaling10x;
99
97 /* Initialize the platform interface of the gk20a driver. 100 /* Initialize the platform interface of the gk20a driver.
98 * 101 *
99 * The platform implementation of this function must 102 * The platform implementation of this function must
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c
index f8e1e3b7..73e7303e 100644
--- a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c
+++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c
@@ -812,6 +812,7 @@ struct gk20a_platform gk20a_tegra_platform = {
812 .enable_elcg = true, 812 .enable_elcg = true,
813 .enable_elpg = true, 813 .enable_elpg = true,
814 .enable_aelpg = true, 814 .enable_aelpg = true,
815 .ptimerscaling10x = 26,
815 816
816 .force_reset_in_do_idle = false, 817 .force_reset_in_do_idle = false,
817 818
@@ -858,6 +859,7 @@ struct gk20a_platform gm20b_tegra_platform = {
858 .enable_elcg = true, 859 .enable_elcg = true,
859 .enable_elpg = true, 860 .enable_elpg = true,
860 .enable_aelpg = true, 861 .enable_aelpg = true,
862 .ptimerscaling10x = 26,
861 863
862 .force_reset_in_do_idle = false, 864 .force_reset_in_do_idle = false,
863 865
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
index e32f8943..edd70f13 100644
--- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
@@ -120,7 +120,6 @@ int gm20b_init_hal(struct gk20a *g)
120 } 120 }
121 } 121 }
122#endif 122#endif
123
124 gm20b_init_mc(gops); 123 gm20b_init_mc(gops);
125 gm20b_init_ltc(gops); 124 gm20b_init_ltc(gops);
126 gm20b_init_gr(gops); 125 gm20b_init_gr(gops);