diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/hal_gp10b.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/mc_gp10b.c | 25 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/mc_gp10b.h | 4 |
3 files changed, 30 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index d32f644d..2b0c07d8 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c | |||
@@ -623,6 +623,7 @@ static const struct gpu_ops gp10b_ops = { | |||
623 | .apply_smpc_war = gp10b_apply_smpc_war, | 623 | .apply_smpc_war = gp10b_apply_smpc_war, |
624 | }, | 624 | }, |
625 | .mc = { | 625 | .mc = { |
626 | .intr_mask = mc_gp10b_intr_mask, | ||
626 | .intr_enable = mc_gp10b_intr_enable, | 627 | .intr_enable = mc_gp10b_intr_enable, |
627 | .intr_unit_config = mc_gp10b_intr_unit_config, | 628 | .intr_unit_config = mc_gp10b_intr_unit_config, |
628 | .isr_stall = mc_gp10b_isr_stall, | 629 | .isr_stall = mc_gp10b_isr_stall, |
@@ -638,6 +639,7 @@ static const struct gpu_ops gp10b_ops = { | |||
638 | .reset = gk20a_mc_reset, | 639 | .reset = gk20a_mc_reset, |
639 | .boot_0 = gk20a_mc_boot_0, | 640 | .boot_0 = gk20a_mc_boot_0, |
640 | .is_intr1_pending = mc_gp10b_is_intr1_pending, | 641 | .is_intr1_pending = mc_gp10b_is_intr1_pending, |
642 | .log_pending_intrs = mc_gp10b_log_pending_intrs, | ||
641 | }, | 643 | }, |
642 | .debug = { | 644 | .debug = { |
643 | .show_dump = gk20a_debug_show_dump, | 645 | .show_dump = gk20a_debug_show_dump, |
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 | |||
37 | void 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 | |||
35 | void mc_gp10b_intr_enable(struct gk20a *g) | 46 | void 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 | |||
210 | void 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 | } | ||
diff --git a/drivers/gpu/nvgpu/gp10b/mc_gp10b.h b/drivers/gpu/nvgpu/gp10b/mc_gp10b.h index 4e93235c..8c22de62 100644 --- a/drivers/gpu/nvgpu/gp10b/mc_gp10b.h +++ b/drivers/gpu/nvgpu/gp10b/mc_gp10b.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | * copy of this software and associated documentation files (the "Software"), | 5 | * copy of this software and associated documentation files (the "Software"), |
@@ -27,6 +27,7 @@ struct gk20a; | |||
27 | #define NVGPU_MC_INTR_STALLING 0U | 27 | #define NVGPU_MC_INTR_STALLING 0U |
28 | #define NVGPU_MC_INTR_NONSTALLING 1U | 28 | #define NVGPU_MC_INTR_NONSTALLING 1U |
29 | 29 | ||
30 | void mc_gp10b_intr_mask(struct gk20a *g); | ||
30 | void mc_gp10b_intr_enable(struct gk20a *g); | 31 | void mc_gp10b_intr_enable(struct gk20a *g); |
31 | void mc_gp10b_intr_unit_config(struct gk20a *g, bool enable, | 32 | void mc_gp10b_intr_unit_config(struct gk20a *g, bool enable, |
32 | bool is_stalling, u32 mask); | 33 | bool is_stalling, u32 mask); |
@@ -34,6 +35,7 @@ void mc_gp10b_isr_stall(struct gk20a *g); | |||
34 | bool mc_gp10b_is_intr1_pending(struct gk20a *g, | 35 | bool mc_gp10b_is_intr1_pending(struct gk20a *g, |
35 | enum nvgpu_unit unit, u32 mc_intr_1); | 36 | enum nvgpu_unit unit, u32 mc_intr_1); |
36 | 37 | ||
38 | void mc_gp10b_log_pending_intrs(struct gk20a *g); | ||
37 | u32 mc_gp10b_intr_stall(struct gk20a *g); | 39 | u32 mc_gp10b_intr_stall(struct gk20a *g); |
38 | void mc_gp10b_intr_stall_pause(struct gk20a *g); | 40 | void mc_gp10b_intr_stall_pause(struct gk20a *g); |
39 | void mc_gp10b_intr_stall_resume(struct gk20a *g); | 41 | void mc_gp10b_intr_stall_resume(struct gk20a *g); |