diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-03-31 16:33:02 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-04-13 16:12:41 -0400 |
commit | 9b5427da37161c350d28a821652f2bb84bca360f (patch) | |
tree | 989e7b649b7b5e54d1d316b245b61c1881a15de6 /drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |
parent | 2adf9164d9d68cc3ab700af84724034682f44ab8 (diff) |
gpu: nvgpu: Support GPUs with no physical mode
Support GPUs which cannot choose between SMMU and physical
addressing.
Change-Id: If3256fa1bc795a84d039ad3aa63ebdccf5cc0afb
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1120469
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/fifo_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 4422bca4..44329a53 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |||
@@ -654,17 +654,21 @@ int gk20a_init_fifo_support(struct gk20a *g) | |||
654 | static struct channel_gk20a * | 654 | static struct channel_gk20a * |
655 | channel_from_inst_ptr(struct fifo_gk20a *f, u64 inst_ptr) | 655 | channel_from_inst_ptr(struct fifo_gk20a *f, u64 inst_ptr) |
656 | { | 656 | { |
657 | struct gk20a *g = f->g; | ||
657 | int ci; | 658 | int ci; |
658 | if (unlikely(!f->channel)) | 659 | if (unlikely(!f->channel)) |
659 | return NULL; | 660 | return NULL; |
660 | for (ci = 0; ci < f->num_channels; ci++) { | 661 | for (ci = 0; ci < f->num_channels; ci++) { |
661 | struct channel_gk20a *ch = gk20a_channel_get(&f->channel[ci]); | 662 | struct channel_gk20a *ch; |
663 | u64 ch_inst_ptr; | ||
664 | |||
665 | ch = gk20a_channel_get(&f->channel[ci]); | ||
662 | /* only alive channels are searched */ | 666 | /* only alive channels are searched */ |
663 | if (!ch) | 667 | if (!ch) |
664 | continue; | 668 | continue; |
665 | 669 | ||
666 | if (ch->inst_block.cpu_va && | 670 | ch_inst_ptr = gk20a_mm_inst_block_addr(g, &ch->inst_block); |
667 | (inst_ptr == gk20a_mem_phys(&ch->inst_block))) | 671 | if (ch->inst_block.cpu_va && inst_ptr == ch_inst_ptr) |
668 | return ch; | 672 | return ch; |
669 | 673 | ||
670 | gk20a_channel_put(ch); | 674 | gk20a_channel_put(ch); |
@@ -1087,10 +1091,10 @@ static bool gk20a_fifo_handle_mmu_fault( | |||
1087 | ch->hw_chid); | 1091 | ch->hw_chid); |
1088 | } | 1092 | } |
1089 | } else if (f.inst_ptr == | 1093 | } else if (f.inst_ptr == |
1090 | gk20a_mem_phys(&g->mm.bar1.inst_block)) { | 1094 | gk20a_mm_inst_block_addr(g, &g->mm.bar1.inst_block)) { |
1091 | gk20a_err(dev_from_gk20a(g), "mmu fault from bar1"); | 1095 | gk20a_err(dev_from_gk20a(g), "mmu fault from bar1"); |
1092 | } else if (f.inst_ptr == | 1096 | } else if (f.inst_ptr == |
1093 | gk20a_mem_phys(&g->mm.pmu.inst_block)) { | 1097 | gk20a_mm_inst_block_addr(g, &g->mm.pmu.inst_block)) { |
1094 | gk20a_err(dev_from_gk20a(g), "mmu fault from pmu"); | 1098 | gk20a_err(dev_from_gk20a(g), "mmu fault from pmu"); |
1095 | } else | 1099 | } else |
1096 | gk20a_err(dev_from_gk20a(g), "couldn't locate channel for mmu fault"); | 1100 | gk20a_err(dev_from_gk20a(g), "couldn't locate channel for mmu fault"); |