summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/mc_gp10b.c
diff options
context:
space:
mode:
authorNitin Kumbhar <nkumbhar@nvidia.com>2018-07-04 13:26:58 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-07-31 06:22:16 -0400
commit13cc7ea93dabdbc57dcf4c6e567e7fbdb12e8d2b (patch)
tree76f013e8b860c81ccee5b294ad9cbe241fd6e08f /drivers/gpu/nvgpu/gp10b/mc_gp10b.c
parent2d454db04fcc0c03e05b4665831e5780240d79b8 (diff)
gpu: nvgpu: mask intr before gpu power off
once gpu is powered off i.e. power_on set to false, nvgpu isr does not handle stall/nonstall irq. Depending upon state of gpu, this can result in either of following errors: 1) irq 458: nobody cared (try booting with the "irqpoll" option) 2) "HSM ERROR 42, GPU" from SCE if it detects that an interrupt is not in time. Fix these by masking all interrupts just before gpu power off as nvgpu won't be handling any irq anymore. While masking interrupts, if there are any pending interrupts, then report those with a log message. Bug 1987855 Bug 200424832 Change-Id: I95b087f5c24d439e5da26c6e4fff74d8a525f291 Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1770802 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/mc_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/mc_gp10b.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/mc_gp10b.c b/drivers/gpu/nvgpu/gp10b/mc_gp10b.c
index 56db6750..063bda7c 100644
--- a/drivers/gpu/nvgpu/gp10b/mc_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/mc_gp10b.c
@@ -32,6 +32,17 @@
32 32
33#include <nvgpu/hw/gp10b/hw_mc_gp10b.h> 33#include <nvgpu/hw/gp10b/hw_mc_gp10b.h>
34 34
35#define MAX_MC_INTR_REGS 2U
36
37void mc_gp10b_intr_mask(struct gk20a *g)
38{
39 nvgpu_writel(g, mc_intr_en_clear_r(NVGPU_MC_INTR_STALLING),
40 0xffffffffU);
41
42 nvgpu_writel(g, mc_intr_en_clear_r(NVGPU_MC_INTR_NONSTALLING),
43 0xffffffffU);
44}
45
35void mc_gp10b_intr_enable(struct gk20a *g) 46void mc_gp10b_intr_enable(struct gk20a *g)
36{ 47{
37 u32 eng_intr_mask = gk20a_fifo_engine_interrupt_mask(g); 48 u32 eng_intr_mask = gk20a_fifo_engine_interrupt_mask(g);
@@ -195,3 +206,17 @@ bool mc_gp10b_is_intr1_pending(struct gk20a *g,
195 206
196 return is_pending; 207 return is_pending;
197} 208}
209
210void mc_gp10b_log_pending_intrs(struct gk20a *g)
211{
212 u32 i, intr;
213
214 for (i = 0; i < MAX_MC_INTR_REGS; i++) {
215 intr = nvgpu_readl(g, mc_intr_r(i));
216 if (intr == 0U) {
217 continue;
218 }
219 nvgpu_info(g, "Pending intr%d=0x%08x", i, intr);
220 }
221
222}