From 22a95f15e0567a8f17b15fdad8864e3c4242a2fd Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 21 Feb 2018 15:56:40 -0800 Subject: gpu: nvgpu: Don't ioremap() regs when using POSIX When __NVGPU_POSIX__ is defined do no use ioremap(). This operation probably doesn't make much sense. Currently we have no plans to run the driver in userspace against a real GPU, hence programming the nvlink credits registers is simply not necessary. Also fix an unused variable by returing it as an error. JIRA NVGPU-525 Change-Id: Ic94d332551f6e25c1836331bf92188e7651546cb Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1673815 Reviewed-by: svc-mobile-coverity Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/fb_gv11b.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gv11b/fb_gv11b.c') diff --git a/drivers/gpu/nvgpu/gv11b/fb_gv11b.c b/drivers/gpu/nvgpu/gv11b/fb_gv11b.c index e9093224..4ad350d1 100644 --- a/drivers/gpu/nvgpu/gv11b/fb_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/fb_gv11b.c @@ -56,6 +56,7 @@ static void gv11b_init_nvlink_soc_credits(struct gk20a *g) if (nvgpu_is_bpmp_running(g) && (!nvgpu_platform_is_simulation(g))) { nvgpu_log(g, gpu_dbg_info, "nvlink soc credits init done by bpmp"); } else { +#ifndef __NVGPU_POSIX__ /* MSS_NVLINK_1_BASE */ void __iomem *soc1 = ioremap(0x01f20010, 4096); /* MSS_NVLINK_2_BASE */ @@ -87,6 +88,7 @@ static void gv11b_init_nvlink_soc_credits(struct gk20a *g) writel_relaxed(val, soc4); val = readl_relaxed(soc4 + 4); writel_relaxed(val, soc4 + 4); +#endif } } @@ -996,7 +998,7 @@ static void gv11b_fb_handle_mmu_fault_common(struct gk20a *g, } } -static void gv11b_fb_replay_or_cancel_faults(struct gk20a *g, +static int gv11b_fb_replay_or_cancel_faults(struct gk20a *g, u32 invalidate_replay_val) { int err = 0; @@ -1017,6 +1019,8 @@ static void gv11b_fb_replay_or_cancel_faults(struct gk20a *g, err = gv11b_fb_mmu_invalidate_replay(g, fb_mmu_invalidate_replay_start_ack_all_f()); } + + return err; } static void gv11b_fb_handle_mmu_nonreplay_replay_fault(struct gk20a *g, -- cgit v1.2.2