From 851d4e3fa917664d6345a8b420a8a3bc4d78d1a1 Mon Sep 17 00:00:00 2001 From: Seshendra Gadagottu Date: Wed, 24 Oct 2018 18:12:10 -0700 Subject: [PATCH] gpu: nvgpu: gv11b: force scg slow drain tpc enable For Pascal SCG, force slow drain tpc enable to avoid hang in graphics pipeline. Bug 2398751 Change-Id: I72276d2391f4e9d0c0d0b746f99585443453c044 Signed-off-by: Seshendra Gadagottu Reviewed-on: https://git-master.nvidia.com/r/1934995 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/gr_gv11b.c | 6 ++++++ .../nvgpu/include/nvgpu/hw/gv11b/hw_gr_gv11b.h | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c index 1c09c731a..fff34aaa6 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c @@ -3088,6 +3088,12 @@ int gr_gv11b_init_fs_state(struct gk20a *g) g->gr.fecs_feature_override_ecc_val); } + data = gk20a_readl(g, gr_debug_0_r()); + data = set_field(data, + gr_debug_0_scg_force_slow_drain_tpc_m(), + gr_debug_0_scg_force_slow_drain_tpc_enabled_f()); + gk20a_writel(g, gr_debug_0_r(), data); + err = gr_gk20a_init_fs_state(g); if (err != 0) { return err; diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_gr_gv11b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_gr_gv11b.h index d482096e8..404c7e54c 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_gr_gv11b.h +++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_gr_gv11b.h @@ -5672,6 +5672,22 @@ static inline u32 gr_fecs_falcon_ecc_uncorrected_err_count_unique_total_v(u32 r) { return (r >> 16U) & 0xffffU; } +static inline u32 gr_debug_0_r(void) +{ + return 0x00400080U; +} +static inline u32 gr_debug_0_scg_force_slow_drain_tpc_m(void) +{ + return 0x1U << 11U; +} +static inline u32 gr_debug_0_scg_force_slow_drain_tpc_enabled_f(void) +{ + return 0x800U; +} +static inline u32 gr_debug_0_scg_force_slow_drain_tpc_disabled_f(void) +{ + return 0x0U; +} static inline u32 gr_debug_2_r(void) { return 0x00400088U;