diff options
author | Richard Zhao <rizhao@nvidia.com> | 2016-02-12 17:15:52 -0500 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-03-22 13:19:23 -0400 |
commit | 97108797a28faaf3c7249345611f68817a99f522 (patch) | |
tree | cff54bfb8fc979fc507fb9794759cc83af5262e4 /drivers/gpu/nvgpu | |
parent | a13a4124c7de56d7c38cce106e16f88c429292f8 (diff) |
gpu: nvgpu: enable semaphore acquire timeout only when timeouts_enabled is set
Bug 1727687
Change-Id: I7a7a4a2011b029474122fdbfbeb02b6302a5902b
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: http://git-master/r/1011486
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 11 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 9 |
2 files changed, 15 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 6eecebf5..654388cb 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -214,6 +214,12 @@ u32 channel_gk20a_pbdma_acquire_val(struct channel_gk20a *c) | |||
214 | u64 timeout; | 214 | u64 timeout; |
215 | int val_len; | 215 | int val_len; |
216 | 216 | ||
217 | val = pbdma_acquire_retry_man_2_f() | | ||
218 | pbdma_acquire_retry_exp_2_f(); | ||
219 | |||
220 | if (!c->g->timeouts_enabled) | ||
221 | return val; | ||
222 | |||
217 | timeout = gk20a_get_channel_watchdog_timeout(c); | 223 | timeout = gk20a_get_channel_watchdog_timeout(c); |
218 | do_div(timeout, 2); /* set acquire timeout to half of channel wdt */ | 224 | do_div(timeout, 2); /* set acquire timeout to half of channel wdt */ |
219 | timeout *= 1000000UL; /* ms -> ns */ | 225 | timeout *= 1000000UL; /* ms -> ns */ |
@@ -232,11 +238,10 @@ u32 channel_gk20a_pbdma_acquire_val(struct channel_gk20a *c) | |||
232 | man = timeout; | 238 | man = timeout; |
233 | } | 239 | } |
234 | 240 | ||
235 | val = pbdma_acquire_retry_man_2_f() | | 241 | val |= pbdma_acquire_timeout_exp_f(exp) | |
236 | pbdma_acquire_retry_exp_2_f() | | ||
237 | pbdma_acquire_timeout_exp_f(exp) | | ||
238 | pbdma_acquire_timeout_man_f(man) | | 242 | pbdma_acquire_timeout_man_f(man) | |
239 | pbdma_acquire_timeout_en_enable_f(); | 243 | pbdma_acquire_timeout_en_enable_f(); |
244 | |||
240 | return val; | 245 | return val; |
241 | } | 246 | } |
242 | 247 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 28cc3086..661c2c38 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |||
@@ -462,8 +462,7 @@ static void gk20a_init_fifo_pbdma_intr_descs(struct fifo_gk20a *f) | |||
462 | /* Can be used for sw-methods, or represents | 462 | /* Can be used for sw-methods, or represents |
463 | * a recoverable timeout. */ | 463 | * a recoverable timeout. */ |
464 | f->intr.pbdma.restartable_0 = | 464 | f->intr.pbdma.restartable_0 = |
465 | pbdma_intr_0_device_pending_f() | | 465 | pbdma_intr_0_device_pending_f(); |
466 | pbdma_intr_0_acquire_pending_f(); | ||
467 | } | 466 | } |
468 | 467 | ||
469 | static int gk20a_init_fifo_setup_sw(struct gk20a *g) | 468 | static int gk20a_init_fifo_setup_sw(struct gk20a *g) |
@@ -1653,6 +1652,12 @@ static u32 gk20a_fifo_handle_pbdma_intr(struct device *dev, | |||
1653 | u32 val = gk20a_readl(g, pbdma_acquire_r(pbdma_id)); | 1652 | u32 val = gk20a_readl(g, pbdma_acquire_r(pbdma_id)); |
1654 | val &= ~pbdma_acquire_timeout_en_enable_f(); | 1653 | val &= ~pbdma_acquire_timeout_en_enable_f(); |
1655 | gk20a_writel(g, pbdma_acquire_r(pbdma_id), val); | 1654 | gk20a_writel(g, pbdma_acquire_r(pbdma_id), val); |
1655 | if (g->timeouts_enabled) { | ||
1656 | reset = true; | ||
1657 | gk20a_err(dev_from_gk20a(g), | ||
1658 | "semaphore acquire timeout!"); | ||
1659 | } | ||
1660 | handled |= pbdma_intr_0_acquire_pending_f(); | ||
1656 | } | 1661 | } |
1657 | 1662 | ||
1658 | if (pbdma_intr_0 & pbdma_intr_0_pbentry_pending_f()) { | 1663 | if (pbdma_intr_0 & pbdma_intr_0_pbentry_pending_f()) { |