From a94dd24e262a7767684f051ee91b147d840bb8a0 Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Tue, 10 Jul 2018 10:54:05 -0700 Subject: gpu: nvgpu: gv11b: set preempt timeout For pbdma/eng/runlist preempt polling use fifo_eng_timeout_us converted to ms. Bug 200426402 Change-Id: I2137bb9c5517d27c514ddd7ef0c601230a1ddb16 Signed-off-by: Seema Khowala Reviewed-on: https://git-master.nvidia.com/r/1775442 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv100/fifo_gv100.c | 2 +- drivers/gpu/nvgpu/gv11b/fifo_gv11b.c | 13 ++++++------- drivers/gpu/nvgpu/gv11b/fifo_gv11b.h | 1 - 3 files changed, 7 insertions(+), 9 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/nvgpu/gv100/fifo_gv100.c b/drivers/gpu/nvgpu/gv100/fifo_gv100.c index 0227720d..f5e43ea7 100644 --- a/drivers/gpu/nvgpu/gv100/fifo_gv100.c +++ b/drivers/gpu/nvgpu/gv100/fifo_gv100.c @@ -38,7 +38,7 @@ u32 gv100_fifo_get_num_fifos(struct gk20a *g) u32 gv100_fifo_get_preempt_timeout(struct gk20a *g) { - return DEFAULT_FIFO_PREEMPT_TIMEOUT; + return g->fifo_eng_timeout_us / 1000 ; } void gv100_apply_ctxsw_timeout_intr(struct gk20a *g) diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c index fcf05306..7e0bbf81 100644 --- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c @@ -387,13 +387,12 @@ u32 gv11b_fifo_intr_0_error_mask(struct gk20a *g) u32 gv11b_fifo_get_preempt_timeout(struct gk20a *g) { - /* if timeouts are enabled, using 3000ms timeout - * for polling pdma/eng/runlist might kick in - * timeout handler in the cases where preempt - * is stuck. Use 1000ms timeout for polling when - * timeouts are enabled */ - return nvgpu_is_timeouts_enabled(g) ? PREEMPT_TIMEOUT_1000_MS : - g->gr_idle_timeout_default; + /* using gr_idle_timeout for polling pdma/eng/runlist + * might kick in timeout handler in the cases where + * preempt is stuck. Use fifo_eng_timeout converted to ms + * for preempt polling */ + + return g->fifo_eng_timeout_us / 1000 ; } static int gv11b_fifo_poll_pbdma_chan_status(struct gk20a *g, u32 id, diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.h b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.h index aee7aef2..ec89bc5b 100644 --- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.h +++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.h @@ -51,7 +51,6 @@ #define CHANNEL_INFO_VEID0 0 #define MAX_PRE_SI_RETRIES 200000 /* 1G/500KHz * 100 */ -#define PREEMPT_TIMEOUT_1000_MS 1000 struct gpu_ops; -- cgit v1.2.2