diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2014-05-06 02:45:31 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:09:20 -0400 |
commit | 3cebc5758ade2a99ac31ba06276c3f3eb6f96cf7 (patch) | |
tree | 1bef1c4d0bccebb12bb78b8e7d0cf42e3344870f | |
parent | c8a5d3f908977b55f48e94f31e35e0534c4087cd (diff) |
gpu: nvgpu: Fix sched error and recovery race
Fix race between channel recovery and sched error.
Bug 1499214
Change-Id: If95526c7e374703e8941f1b24d3916384261058e
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/405662
(cherry picked from commit f8092e158294260dd9d041dc7f4d2c1872e02474)
Reviewed-on: http://git-master/r/407571
Reviewed-by: Automatic_Commit_Validation_User
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 12 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/hw_fifo_gk20a.h | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index f1987ed5..2d2dad2c 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |||
@@ -1101,6 +1101,15 @@ static void gk20a_fifo_trigger_mmu_fault(struct gk20a *g, | |||
1101 | unsigned long engine_id; | 1101 | unsigned long engine_id; |
1102 | int ret; | 1102 | int ret; |
1103 | 1103 | ||
1104 | /* | ||
1105 | * sched error prevents recovery, and ctxsw error will retrigger | ||
1106 | * every 100ms. Disable the sched error to allow recovery. | ||
1107 | */ | ||
1108 | gk20a_writel(g, fifo_intr_en_0_r(), | ||
1109 | 0x7FFFFFFF & ~fifo_intr_en_0_sched_error_m()); | ||
1110 | gk20a_writel(g, fifo_intr_0_r(), | ||
1111 | fifo_intr_0_sched_error_reset_f()); | ||
1112 | |||
1104 | /* trigger faults for all bad engines */ | 1113 | /* trigger faults for all bad engines */ |
1105 | for_each_set_bit(engine_id, &engine_ids, 32) { | 1114 | for_each_set_bit(engine_id, &engine_ids, 32) { |
1106 | if (engine_id > g->fifo.max_engines) { | 1115 | if (engine_id > g->fifo.max_engines) { |
@@ -1134,6 +1143,9 @@ static void gk20a_fifo_trigger_mmu_fault(struct gk20a *g, | |||
1134 | /* release mmu fault trigger */ | 1143 | /* release mmu fault trigger */ |
1135 | for_each_set_bit(engine_id, &engine_ids, 32) | 1144 | for_each_set_bit(engine_id, &engine_ids, 32) |
1136 | gk20a_writel(g, fifo_trigger_mmu_fault_r(engine_id), 0); | 1145 | gk20a_writel(g, fifo_trigger_mmu_fault_r(engine_id), 0); |
1146 | |||
1147 | /* Re-enable sched error */ | ||
1148 | gk20a_writel(g, fifo_intr_en_0_r(), 0x7FFFFFFF); | ||
1137 | } | 1149 | } |
1138 | 1150 | ||
1139 | void gk20a_fifo_recover(struct gk20a *g, u32 __engine_ids, | 1151 | void gk20a_fifo_recover(struct gk20a *g, u32 __engine_ids, |
diff --git a/drivers/gpu/nvgpu/gk20a/hw_fifo_gk20a.h b/drivers/gpu/nvgpu/gk20a/hw_fifo_gk20a.h index a39d3c51..5ebb8365 100644 --- a/drivers/gpu/nvgpu/gk20a/hw_fifo_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/hw_fifo_gk20a.h | |||
@@ -230,6 +230,10 @@ static inline u32 fifo_intr_en_0_r(void) | |||
230 | { | 230 | { |
231 | return 0x00002140; | 231 | return 0x00002140; |
232 | } | 232 | } |
233 | static inline u32 fifo_intr_en_0_sched_error_m(void) | ||
234 | { | ||
235 | return 0x1 << 8; | ||
236 | } | ||
233 | static inline u32 fifo_intr_en_1_r(void) | 237 | static inline u32 fifo_intr_en_1_r(void) |
234 | { | 238 | { |
235 | return 0x00002528; | 239 | return 0x00002528; |