From 6d8d5eb17796bcd70d172f196adbca3bd1b964c4 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 3 Jul 2018 12:54:53 -0700 Subject: gpu: nvgpu: Remove Pascal replayable fault support We do not utilize or test replayable page faults in Pascal. Remove the code related to that. JIRA NVGPU-714 Change-Id: I2415bde347f8b018ebf99c3f9038d47c649d9464 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1769697 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/Makefile | 1 - drivers/gpu/nvgpu/Makefile.sources | 1 - drivers/gpu/nvgpu/gp10b/mm_gp10b.c | 3 - drivers/gpu/nvgpu/gp10b/rpfb_gp10b.c | 158 ----------------------------------- drivers/gpu/nvgpu/gp10b/rpfb_gp10b.h | 39 --------- 5 files changed, 202 deletions(-) delete mode 100644 drivers/gpu/nvgpu/gp10b/rpfb_gp10b.c delete mode 100644 drivers/gpu/nvgpu/gp10b/rpfb_gp10b.h (limited to 'drivers/gpu/nvgpu') diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index b21d3279..9ca762a3 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -257,7 +257,6 @@ nvgpu-y += \ gp10b/fb_gp10b.o \ gp10b/pmu_gp10b.o \ gp10b/hal_gp10b.o \ - gp10b/rpfb_gp10b.o \ gp10b/regops_gp10b.o \ gp10b/therm_gp10b.o \ gp10b/fecs_trace_gp10b.o \ diff --git a/drivers/gpu/nvgpu/Makefile.sources b/drivers/gpu/nvgpu/Makefile.sources index 942fddea..6fa815ab 100644 --- a/drivers/gpu/nvgpu/Makefile.sources +++ b/drivers/gpu/nvgpu/Makefile.sources @@ -156,7 +156,6 @@ srcs := common/mm/nvgpu_allocator.c \ gp10b/fb_gp10b.c \ gp10b/pmu_gp10b.c \ gp10b/hal_gp10b.c \ - gp10b/rpfb_gp10b.c \ gp10b/regops_gp10b.c \ gp10b/therm_gp10b.c \ gp10b/fecs_trace_gp10b.c \ diff --git a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c index e313b928..a0e08437 100644 --- a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c @@ -30,9 +30,7 @@ #include "gk20a/gk20a.h" #include "gm20b/mm_gm20b.h" #include "mm_gp10b.h" -#include "rpfb_gp10b.h" -#include #include #include @@ -392,7 +390,6 @@ void gp10b_remove_bar2_vm(struct gk20a *g) { struct mm_gk20a *mm = &g->mm; - gp10b_replayable_pagefault_buffer_deinit(g); nvgpu_free_inst_block(g, &mm->bar2.inst_block); nvgpu_vm_put(mm->bar2.vm); } diff --git a/drivers/gpu/nvgpu/gp10b/rpfb_gp10b.c b/drivers/gpu/nvgpu/gp10b/rpfb_gp10b.c deleted file mode 100644 index 7a714441..00000000 --- a/drivers/gpu/nvgpu/gp10b/rpfb_gp10b.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - * GP10B RPFB - * - * Copyright (c) 2015-2018, NVIDIA CORPORATION. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#include - -#include "gk20a/gk20a.h" - -#include "rpfb_gp10b.h" - -#include -#include -#include - -int gp10b_replayable_pagefault_buffer_init(struct gk20a *g) -{ - u32 addr_lo; - u32 addr_hi; - struct vm_gk20a *vm = g->mm.bar2.vm; - int err; - size_t rbfb_size = NV_UVM_FAULT_BUF_SIZE * - fifo_replay_fault_buffer_size_hw_entries_v(); - - nvgpu_log_fn(g, " "); - - if (!g->mm.bar2_desc.gpu_va) { - err = nvgpu_dma_alloc_map_sys(vm, rbfb_size, - &g->mm.bar2_desc); - if (err) { - nvgpu_err(g, "Error in replayable fault buffer"); - return err; - } - } - addr_lo = u64_lo32(g->mm.bar2_desc.gpu_va >> 12); - addr_hi = u64_hi32(g->mm.bar2_desc.gpu_va); - gk20a_writel(g, fifo_replay_fault_buffer_hi_r(), - fifo_replay_fault_buffer_hi_base_f(addr_hi)); - - gk20a_writel(g, fifo_replay_fault_buffer_lo_r(), - fifo_replay_fault_buffer_lo_base_f(addr_lo) | - fifo_replay_fault_buffer_lo_enable_true_v()); - nvgpu_log_fn(g, "done"); - return 0; -} - -void gp10b_replayable_pagefault_buffer_deinit(struct gk20a *g) -{ - struct vm_gk20a *vm = g->mm.bar2.vm; - - nvgpu_dma_unmap_free(vm, &g->mm.bar2_desc); -} - -u32 gp10b_replayable_pagefault_buffer_get_index(struct gk20a *g) -{ - u32 get_idx = 0; - - nvgpu_log_fn(g, " "); - - get_idx = gk20a_readl(g, fifo_replay_fault_buffer_get_r()); - - if (get_idx >= fifo_replay_fault_buffer_size_hw_entries_v()) - nvgpu_err(g, "Error in replayable fault buffer"); - - nvgpu_log_fn(g, "done"); - return get_idx; -} - -u32 gp10b_replayable_pagefault_buffer_put_index(struct gk20a *g) -{ - u32 put_idx = 0; - - nvgpu_log_fn(g, " "); - put_idx = gk20a_readl(g, fifo_replay_fault_buffer_put_r()); - - if (put_idx >= fifo_replay_fault_buffer_size_hw_entries_v()) - nvgpu_err(g, "Error in UVM"); - - nvgpu_log_fn(g, "done"); - return put_idx; -} - -bool gp10b_replayable_pagefault_buffer_is_empty(struct gk20a *g) -{ - u32 get_idx = gk20a_readl(g, fifo_replay_fault_buffer_get_r()); - u32 put_idx = gk20a_readl(g, fifo_replay_fault_buffer_put_r()); - - return (get_idx == put_idx ? true : false); -} - -bool gp10b_replayable_pagefault_buffer_is_full(struct gk20a *g) -{ - u32 get_idx = gk20a_readl(g, fifo_replay_fault_buffer_get_r()); - u32 put_idx = gk20a_readl(g, fifo_replay_fault_buffer_put_r()); - u32 hw_entries = gk20a_readl(g, fifo_replay_fault_buffer_size_r()); - - return (get_idx == ((put_idx + 1) % hw_entries) ? true : false); -} - -bool gp10b_replayable_pagefault_buffer_is_overflow(struct gk20a *g) -{ - u32 info = gk20a_readl(g, fifo_replay_fault_buffer_info_r()); - - return fifo_replay_fault_buffer_info_overflow_f(info); -} - -void gp10b_replayable_pagefault_buffer_clear_overflow(struct gk20a *g) -{ - u32 info = gk20a_readl(g, fifo_replay_fault_buffer_info_r()); - - info |= fifo_replay_fault_buffer_info_overflow_clear_v(); - gk20a_writel(g, fifo_replay_fault_buffer_info_r(), info); - -} - -/* - * Debug function. - */ -void gp10b_replayable_pagefault_buffer_info(struct gk20a *g) -{ - nvgpu_info(g, "rpfb low: 0x%x\n", - gk20a_readl(g, fifo_replay_fault_buffer_lo_r()) >> 12); - nvgpu_info(g, "rpfb hi: 0x%x\n", - gk20a_readl(g, fifo_replay_fault_buffer_hi_r())); - nvgpu_info(g, "rpfb enabled: 0x%x\n", - gk20a_readl(g, fifo_replay_fault_buffer_lo_r()) & 0x1); - nvgpu_info(g, "rpfb size: %d\n", - gk20a_readl(g, fifo_replay_fault_buffer_size_r())); - nvgpu_info(g, "rpfb get index: %d\n", - gp10b_replayable_pagefault_buffer_get_index(g)); - nvgpu_info(g, "rpfb put index: %d\n", - gp10b_replayable_pagefault_buffer_put_index(g)); - nvgpu_info(g, "rpfb empty: %d\n", - gp10b_replayable_pagefault_buffer_is_empty(g)); - nvgpu_info(g, "rpfb full %d\n", - gp10b_replayable_pagefault_buffer_is_full(g)); - nvgpu_info(g, "rpfb overflow %d\n", - gp10b_replayable_pagefault_buffer_is_overflow(g)); -} diff --git a/drivers/gpu/nvgpu/gp10b/rpfb_gp10b.h b/drivers/gpu/nvgpu/gp10b/rpfb_gp10b.h deleted file mode 100644 index ee210a5f..00000000 --- a/drivers/gpu/nvgpu/gp10b/rpfb_gp10b.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#ifndef RPFB_GP20B_H -#define RPFB_GP20B_H -struct gk20a; - -#define NV_UVM_FAULT_BUF_SIZE 32 - -int gp10b_replayable_pagefault_buffer_init(struct gk20a *g); -u32 gp10b_replayable_pagefault_buffer_get_index(struct gk20a *g); -u32 gp10b_replayable_pagefault_buffer_put_index(struct gk20a *g); -bool gp10b_replayable_pagefault_buffer_is_empty(struct gk20a *g); -bool gp10b_replayable_pagefault_buffer_is_full(struct gk20a *g); -bool gp10b_replayable_pagefault_buffer_is_overflow(struct gk20a *g); -void gp10b_replayable_pagefault_buffer_clear_overflow(struct gk20a *g); -void gp10b_replayable_pagefault_buffer_info(struct gk20a *g); -void gp10b_replayable_pagefault_buffer_deinit(struct gk20a *g); - -#endif -- cgit v1.2.2