summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2018-04-19 10:14:28 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-04-22 10:33:43 -0400
commitae04f394cf9a82a762a7152747a6bba5be6f5f53 (patch)
tree001f8839b8b6b7fdef1ac3c5907b84c72488ddbe
parentf85f21d1a5eeb10e764b820bba4452ee03f9c52a (diff)
gpu: nvgpu: add HAL to set ppriv timeouts
Add new HAL gops.bus.set_ppriv_timeout_settings() to set platform specific ppriv timeouts Set this HAL for all supported GPUs for now Jira NVGPUT-35 Change-Id: I88b438a7bf381d0216e0947a16cd267461d0e8d7 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1699314 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Richard Zhao <rizhao@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@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/bus_gk20a.c14
-rw-r--r--drivers/gpu/nvgpu/gk20a/bus_gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c11
-rw-r--r--drivers/gpu/nvgpu/gm20b/hal_gm20b.c2
-rw-r--r--drivers/gpu/nvgpu/gp106/hal_gp106.c2
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.c2
-rw-r--r--drivers/gpu/nvgpu/gv100/hal_gv100.c2
-rw-r--r--drivers/gpu/nvgpu/gv11b/hal_gv11b.c2
-rw-r--r--drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c2
-rw-r--r--drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c2
11 files changed, 32 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/bus_gk20a.c b/drivers/gpu/nvgpu/gk20a/bus_gk20a.c
index 81a5facc..ab75e8d7 100644
--- a/drivers/gpu/nvgpu/gk20a/bus_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/bus_gk20a.c
@@ -34,6 +34,9 @@
34#include <nvgpu/hw/gk20a/hw_mc_gk20a.h> 34#include <nvgpu/hw/gk20a/hw_mc_gk20a.h>
35#include <nvgpu/hw/gk20a/hw_gr_gk20a.h> 35#include <nvgpu/hw/gk20a/hw_gr_gk20a.h>
36#include <nvgpu/hw/gk20a/hw_timer_gk20a.h> 36#include <nvgpu/hw/gk20a/hw_timer_gk20a.h>
37#include <nvgpu/hw/gk20a/hw_pri_ringstation_sys_gk20a.h>
38#include <nvgpu/hw/gk20a/hw_pri_ringstation_gpc_gk20a.h>
39#include <nvgpu/hw/gk20a/hw_pri_ringstation_fbp_gk20a.h>
37 40
38void gk20a_bus_init_hw(struct gk20a *g) 41void gk20a_bus_init_hw(struct gk20a *g)
39{ 42{
@@ -172,3 +175,14 @@ int gk20a_bus_bar1_bind(struct gk20a *g, struct nvgpu_mem *bar1_inst)
172 175
173 return 0; 176 return 0;
174} 177}
178
179void gk20a_bus_set_ppriv_timeout_settings(struct gk20a *g)
180{
181 /*
182 * Bug 1340570: increase the clock timeout to avoid potential
183 * operation failure at high gpcclk rate. Default values are 0x400.
184 */
185 nvgpu_writel(g, pri_ringstation_sys_master_config_r(0x15), 0x800);
186 nvgpu_writel(g, pri_ringstation_gpc_master_config_r(0xa), 0x800);
187 nvgpu_writel(g, pri_ringstation_fbp_master_config_r(0x8), 0x800);
188}
diff --git a/drivers/gpu/nvgpu/gk20a/bus_gk20a.h b/drivers/gpu/nvgpu/gk20a/bus_gk20a.h
index 1f81a4b0..8c07d1fe 100644
--- a/drivers/gpu/nvgpu/gk20a/bus_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/bus_gk20a.h
@@ -32,5 +32,6 @@ void gk20a_bus_isr(struct gk20a *g);
32int gk20a_read_ptimer(struct gk20a *g, u64 *value); 32int gk20a_read_ptimer(struct gk20a *g, u64 *value);
33void gk20a_bus_init_hw(struct gk20a *g); 33void gk20a_bus_init_hw(struct gk20a *g);
34int gk20a_bus_bar1_bind(struct gk20a *g, struct nvgpu_mem *bar1_inst); 34int gk20a_bus_bar1_bind(struct gk20a *g, struct nvgpu_mem *bar1_inst);
35void gk20a_bus_set_ppriv_timeout_settings(struct gk20a *g);
35 36
36#endif /* GK20A_H */ 37#endif /* GK20A_H */
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 2e7bd4a5..bb0b572f 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -1094,6 +1094,7 @@ struct gpu_ops {
1094 u32 source_id, u32 count, 1094 u32 source_id, u32 count,
1095 struct nvgpu_cpu_time_correlation_sample *); 1095 struct nvgpu_cpu_time_correlation_sample *);
1096 int (*bar1_bind)(struct gk20a *g, struct nvgpu_mem *bar1_inst); 1096 int (*bar1_bind)(struct gk20a *g, struct nvgpu_mem *bar1_inst);
1097 void (*set_ppriv_timeout_settings)(struct gk20a *g);
1097 } bus; 1098 } bus;
1098 1099
1099 struct { 1100 struct {
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index ed1f9af9..51bb2551 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -53,9 +53,6 @@
53#include <nvgpu/hw/gk20a/hw_mc_gk20a.h> 53#include <nvgpu/hw/gk20a/hw_mc_gk20a.h>
54#include <nvgpu/hw/gk20a/hw_ram_gk20a.h> 54#include <nvgpu/hw/gk20a/hw_ram_gk20a.h>
55#include <nvgpu/hw/gk20a/hw_pri_ringmaster_gk20a.h> 55#include <nvgpu/hw/gk20a/hw_pri_ringmaster_gk20a.h>
56#include <nvgpu/hw/gk20a/hw_pri_ringstation_sys_gk20a.h>
57#include <nvgpu/hw/gk20a/hw_pri_ringstation_gpc_gk20a.h>
58#include <nvgpu/hw/gk20a/hw_pri_ringstation_fbp_gk20a.h>
59#include <nvgpu/hw/gk20a/hw_top_gk20a.h> 56#include <nvgpu/hw/gk20a/hw_top_gk20a.h>
60#include <nvgpu/hw/gk20a/hw_ltc_gk20a.h> 57#include <nvgpu/hw/gk20a/hw_ltc_gk20a.h>
61#include <nvgpu/hw/gk20a/hw_fb_gk20a.h> 58#include <nvgpu/hw/gk20a/hw_fb_gk20a.h>
@@ -4489,12 +4486,8 @@ static int gk20a_init_gr_setup_hw(struct gk20a *g)
4489 4486
4490 gr_gk20a_zcull_init_hw(g, gr); 4487 gr_gk20a_zcull_init_hw(g, gr);
4491 4488
4492 /* Bug 1340570: increase the clock timeout to avoid potential 4489 if (g->ops.bus.set_ppriv_timeout_settings)
4493 * operation failure at high gpcclk rate. Default values are 0x400. 4490 g->ops.bus.set_ppriv_timeout_settings(g);
4494 */
4495 gk20a_writel(g, pri_ringstation_sys_master_config_r(0x15), 0x800);
4496 gk20a_writel(g, pri_ringstation_gpc_master_config_r(0xa), 0x800);
4497 gk20a_writel(g, pri_ringstation_fbp_master_config_r(0x8), 0x800);
4498 4491
4499 /* enable fifo access */ 4492 /* enable fifo access */
4500 gk20a_writel(g, gr_gpfifo_ctl_r(), 4493 gk20a_writel(g, gr_gpfifo_ctl_r(),
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
index 0e236d43..0a58445f 100644
--- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
@@ -597,6 +597,8 @@ static const struct gpu_ops gm20b_ops = {
597 .read_ptimer = gk20a_read_ptimer, 597 .read_ptimer = gk20a_read_ptimer,
598 .get_timestamps_zipper = nvgpu_get_timestamps_zipper, 598 .get_timestamps_zipper = nvgpu_get_timestamps_zipper,
599 .bar1_bind = gm20b_bus_bar1_bind, 599 .bar1_bind = gm20b_bus_bar1_bind,
600 .set_ppriv_timeout_settings =
601 gk20a_bus_set_ppriv_timeout_settings,
600 }, 602 },
601#if defined(CONFIG_GK20A_CYCLE_STATS) 603#if defined(CONFIG_GK20A_CYCLE_STATS)
602 .css = { 604 .css = {
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c
index aedd6d14..b7b20dce 100644
--- a/drivers/gpu/nvgpu/gp106/hal_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c
@@ -711,6 +711,8 @@ static const struct gpu_ops gp106_ops = {
711 .read_ptimer = gk20a_read_ptimer, 711 .read_ptimer = gk20a_read_ptimer,
712 .get_timestamps_zipper = nvgpu_get_timestamps_zipper, 712 .get_timestamps_zipper = nvgpu_get_timestamps_zipper,
713 .bar1_bind = gk20a_bus_bar1_bind, 713 .bar1_bind = gk20a_bus_bar1_bind,
714 .set_ppriv_timeout_settings =
715 gk20a_bus_set_ppriv_timeout_settings,
714 }, 716 },
715#if defined(CONFIG_GK20A_CYCLE_STATS) 717#if defined(CONFIG_GK20A_CYCLE_STATS)
716 .css = { 718 .css = {
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
index 30e04717..9a441727 100644
--- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
@@ -644,6 +644,8 @@ static const struct gpu_ops gp10b_ops = {
644 .read_ptimer = gk20a_read_ptimer, 644 .read_ptimer = gk20a_read_ptimer,
645 .get_timestamps_zipper = nvgpu_get_timestamps_zipper, 645 .get_timestamps_zipper = nvgpu_get_timestamps_zipper,
646 .bar1_bind = gk20a_bus_bar1_bind, 646 .bar1_bind = gk20a_bus_bar1_bind,
647 .set_ppriv_timeout_settings =
648 gk20a_bus_set_ppriv_timeout_settings,
647 }, 649 },
648#if defined(CONFIG_GK20A_CYCLE_STATS) 650#if defined(CONFIG_GK20A_CYCLE_STATS)
649 .css = { 651 .css = {
diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c
index bf687dbf..7609f6b0 100644
--- a/drivers/gpu/nvgpu/gv100/hal_gv100.c
+++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c
@@ -771,6 +771,8 @@ static const struct gpu_ops gv100_ops = {
771 .read_ptimer = gk20a_read_ptimer, 771 .read_ptimer = gk20a_read_ptimer,
772 .get_timestamps_zipper = nvgpu_get_timestamps_zipper, 772 .get_timestamps_zipper = nvgpu_get_timestamps_zipper,
773 .bar1_bind = NULL, 773 .bar1_bind = NULL,
774 .set_ppriv_timeout_settings =
775 gk20a_bus_set_ppriv_timeout_settings,
774 }, 776 },
775#if defined(CONFIG_GK20A_CYCLE_STATS) 777#if defined(CONFIG_GK20A_CYCLE_STATS)
776 .css = { 778 .css = {
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
index 6aef49d7..8a0d1822 100644
--- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
@@ -709,6 +709,8 @@ static const struct gpu_ops gv11b_ops = {
709 .read_ptimer = gk20a_read_ptimer, 709 .read_ptimer = gk20a_read_ptimer,
710 .get_timestamps_zipper = nvgpu_get_timestamps_zipper, 710 .get_timestamps_zipper = nvgpu_get_timestamps_zipper,
711 .bar1_bind = NULL, 711 .bar1_bind = NULL,
712 .set_ppriv_timeout_settings =
713 gk20a_bus_set_ppriv_timeout_settings,
712 }, 714 },
713#if defined(CONFIG_GK20A_CYCLE_STATS) 715#if defined(CONFIG_GK20A_CYCLE_STATS)
714 .css = { 716 .css = {
diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c
index 5a11af7e..9d575061 100644
--- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c
+++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c
@@ -519,6 +519,8 @@ static const struct gpu_ops vgpu_gp10b_ops = {
519 .read_ptimer = vgpu_read_ptimer, 519 .read_ptimer = vgpu_read_ptimer,
520 .get_timestamps_zipper = vgpu_get_timestamps_zipper, 520 .get_timestamps_zipper = vgpu_get_timestamps_zipper,
521 .bar1_bind = gk20a_bus_bar1_bind, 521 .bar1_bind = gk20a_bus_bar1_bind,
522 .set_ppriv_timeout_settings =
523 gk20a_bus_set_ppriv_timeout_settings,
522 }, 524 },
523#if defined(CONFIG_GK20A_CYCLE_STATS) 525#if defined(CONFIG_GK20A_CYCLE_STATS)
524 .css = { 526 .css = {
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c
index 975bce32..d07d0229 100644
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c
+++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c
@@ -566,6 +566,8 @@ static const struct gpu_ops vgpu_gv11b_ops = {
566 .read_ptimer = vgpu_read_ptimer, 566 .read_ptimer = vgpu_read_ptimer,
567 .get_timestamps_zipper = vgpu_get_timestamps_zipper, 567 .get_timestamps_zipper = vgpu_get_timestamps_zipper,
568 .bar1_bind = NULL, 568 .bar1_bind = NULL,
569 .set_ppriv_timeout_settings =
570 gk20a_bus_set_ppriv_timeout_settings,
569 }, 571 },
570#if defined(CONFIG_GK20A_CYCLE_STATS) 572#if defined(CONFIG_GK20A_CYCLE_STATS)
571 .css = { 573 .css = {