summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.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/gk20a/gk20a.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/gk20a/gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index ed48253f..c8b094cf 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -93,6 +93,17 @@ int gk20a_detect_chip(struct gk20a *g)
93 return gpu_init_hal(g); 93 return gpu_init_hal(g);
94} 94}
95 95
96static void gk20a_mask_interrupts(struct gk20a *g)
97{
98 if (g->ops.mc.intr_mask != NULL) {
99 g->ops.mc.intr_mask(g);
100 }
101
102 if (g->ops.mc.log_pending_intrs != NULL) {
103 g->ops.mc.log_pending_intrs(g);
104 }
105}
106
96int gk20a_prepare_poweroff(struct gk20a *g) 107int gk20a_prepare_poweroff(struct gk20a *g)
97{ 108{
98 int ret = 0; 109 int ret = 0;
@@ -122,6 +133,8 @@ int gk20a_prepare_poweroff(struct gk20a *g)
122 if (nvgpu_is_enabled(g, NVGPU_PMU_PSTATE)) 133 if (nvgpu_is_enabled(g, NVGPU_PMU_PSTATE))
123 gk20a_deinit_pstate_support(g); 134 gk20a_deinit_pstate_support(g);
124 135
136 gk20a_mask_interrupts(g);
137
125 g->power_on = false; 138 g->power_on = false;
126 139
127 return ret; 140 return ret;