From 0e53ae618c21a0ac21f2648346301f9e29d4d463 Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Mon, 6 Mar 2017 13:11:38 -0800 Subject: gpu: nvgpu: add ops and var for t19x mmu fault Add new ops and fields required for t19x mmu fault JIRA GPUT19X-7 JIRA GPUT19X-12 Change-Id: I29694c15ff9a4150bb1737adac6b58ccba76bea4 Signed-off-by: Seema Khowala Reviewed-on: https://git-master/r/1492640 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 1 + drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 3 +++ drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 11 ++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 90d3338a..fa1b39fd 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -729,6 +729,7 @@ struct gpu_ops { int (*secure_alloc)(struct gk20a *g, struct gr_ctx_buffer_desc *desc, size_t size); + void (*fault_info_mem_destroy)(struct gk20a *g); } mm; struct { u32 (*enter)(struct gk20a *g, struct nvgpu_mem *mem, diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index d984d1f9..fab80e69 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c @@ -464,6 +464,9 @@ static void gk20a_remove_mm_support(struct mm_gk20a *mm) { struct gk20a *g = gk20a_from_mm(mm); + if (g->ops.mm.fault_info_mem_destroy) + g->ops.mm.fault_info_mem_destroy(g); + if (g->ops.mm.remove_bar2_vm) g->ops.mm.remove_bar2_vm(g); diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index cadcffa4..2f35df71 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h @@ -147,6 +147,8 @@ void gk20a_mm_l2_flush(struct gk20a *g, bool invalidate); void gk20a_mm_cbc_clean(struct gk20a *g); void gk20a_mm_l2_invalidate(struct gk20a *g); +#define FAULT_TYPE_NUM 2 /* replay and nonreplay faults */ + struct mmu_fault_info { u64 inst_ptr; u32 inst_aperture; @@ -224,8 +226,15 @@ struct mm_gk20a { struct nvgpu_mutex l2_op_lock; struct nvgpu_mutex tlb_lock; struct nvgpu_mutex priv_lock; -#ifdef CONFIG_ARCH_TEGRA_18x_SOC + struct nvgpu_mem bar2_desc; + +#ifdef CONFIG_TEGRA_19x_GPU + struct nvgpu_mem hw_fault_buf[FAULT_TYPE_NUM]; + unsigned int hw_fault_buf_status[FAULT_TYPE_NUM]; + struct mmu_fault_info *fault_info[FAULT_TYPE_NUM]; + struct nvgpu_mutex hub_isr_mutex; + u32 hub_intr_types; #endif /* * Separate function to cleanup the CE since it requires a channel to -- cgit v1.2.2