From 69297c0932f858bcbdc4a304823f22a4c8cf3292 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 10 Apr 2017 14:01:15 -0700 Subject: gpu: nvgpu: gp106: Use new delay APIs Use platform agnostic delay functions instead of Linux kernel APIs. This allows removing dependency to Linux header linux/delay.h. At the same time remove #include lines for other unused Linux headers. JIRA NVGPU-16 Change-Id: I54db15d9abf578ec334b100635baec214fe22af5 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1460116 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman --- drivers/gpu/nvgpu/gp106/acr_gp106.c | 6 +----- drivers/gpu/nvgpu/gp106/clk_gp106.c | 7 ++----- drivers/gpu/nvgpu/gp106/fb_gp106.c | 4 +--- drivers/gpu/nvgpu/gp106/hal_gp106.c | 2 -- drivers/gpu/nvgpu/gp106/pmu_gp106.c | 10 ++++------ drivers/gpu/nvgpu/gp106/regops_gp106.c | 3 --- drivers/gpu/nvgpu/gp106/sec2_gp106.c | 6 ++---- drivers/gpu/nvgpu/gp106/xve_gp106.c | 5 ++--- 8 files changed, 12 insertions(+), 31 deletions(-) diff --git a/drivers/gpu/nvgpu/gp106/acr_gp106.c b/drivers/gpu/nvgpu/gp106/acr_gp106.c index 26c8ab53..da281077 100644 --- a/drivers/gpu/nvgpu/gp106/acr_gp106.c +++ b/drivers/gpu/nvgpu/gp106/acr_gp106.c @@ -11,12 +11,8 @@ * more details. */ -#include /* for mdelay */ #include -#include #include -#include -#include #include #include @@ -1163,7 +1159,7 @@ static int gp106_bootstrap_hs_flcn(struct gk20a *g) /* sec2 reset - to keep it idle */ gk20a_writel(g, psec_falcon_engine_r(), pwr_falcon_engine_reset_true_f()); - udelay(10); + nvgpu_udelay(10); gk20a_writel(g, psec_falcon_engine_r(), pwr_falcon_engine_reset_false_f()); diff --git a/drivers/gpu/nvgpu/gp106/clk_gp106.c b/drivers/gpu/nvgpu/gp106/clk_gp106.c index 262fd63c..fb9406e5 100644 --- a/drivers/gpu/nvgpu/gp106/clk_gp106.c +++ b/drivers/gpu/nvgpu/gp106/clk_gp106.c @@ -16,11 +16,8 @@ * along with this program. If not, see . */ -#include /* for mdelay */ -#include #include #include -#include #include @@ -188,7 +185,7 @@ static u32 gp106_get_rate_cntr(struct gk20a *g, struct namemap_cfg *c) { /* Wait for reset to happen */ retries = CLK_DEFAULT_CNTRL_SETTLE_RETRIES; do { - udelay(CLK_DEFAULT_CNTRL_SETTLE_USECS); + nvgpu_udelay(CLK_DEFAULT_CNTRL_SETTLE_USECS); } while ((--retries) && (cntr = gk20a_readl(g, c->cntr.reg_cntr_addr))); if (!retries) { @@ -206,7 +203,7 @@ static u32 gp106_get_rate_cntr(struct gk20a *g, struct namemap_cfg *c) { c->cntr.reg_ctrl_idx); gk20a_readl(g, c->cntr.reg_ctrl_addr); - udelay(XTAL_CNTR_DELAY); + nvgpu_udelay(XTAL_CNTR_DELAY); cntr = XTAL_SCALE_TO_KHZ * gk20a_readl(g, c->cntr.reg_cntr_addr); diff --git a/drivers/gpu/nvgpu/gp106/fb_gp106.c b/drivers/gpu/nvgpu/gp106/fb_gp106.c index b2e264cd..53f9af56 100644 --- a/drivers/gpu/nvgpu/gp106/fb_gp106.c +++ b/drivers/gpu/nvgpu/gp106/fb_gp106.c @@ -11,8 +11,6 @@ * more details. */ -#include - #include "gk20a/gk20a.h" #include "gp10b/fb_gp10b.h" @@ -31,7 +29,7 @@ static void gp106_fb_reset(struct gk20a *g) gk20a_dbg_fn("done"); break; } - udelay(HW_SCRUB_TIMEOUT_DEFAULT); + nvgpu_udelay(HW_SCRUB_TIMEOUT_DEFAULT); } while (--retries); } diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index cdd1aade..7459c57f 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c @@ -13,8 +13,6 @@ * more details. */ -#include - #include "gk20a/gk20a.h" #include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/css_gr_gk20a.h" diff --git a/drivers/gpu/nvgpu/gp106/pmu_gp106.c b/drivers/gpu/nvgpu/gp106/pmu_gp106.c index 308bcf04..e0114979 100644 --- a/drivers/gpu/nvgpu/gp106/pmu_gp106.c +++ b/drivers/gpu/nvgpu/gp106/pmu_gp106.c @@ -11,8 +11,6 @@ * more details. */ -#include /* for udelay */ - #include "gk20a/gk20a.h" #include "gk20a/pmu_gk20a.h" @@ -70,7 +68,7 @@ static int gp106_pmu_enable_hw(struct pmu_gk20a *pmu, bool enable) gk20a_dbg_fn("done"); return 0; } - udelay(PMU_MEM_SCRUBBING_TIMEOUT_DEFAULT); + nvgpu_udelay(PMU_MEM_SCRUBBING_TIMEOUT_DEFAULT); } while (--retries); /* If scrubbing timeout, keep PMU in reset state */ @@ -103,7 +101,7 @@ static int pmu_enable(struct pmu_gk20a *pmu, bool enable) pmu_enable_irq(pmu, false); gp106_pmu_enable_hw(pmu, false); - udelay(10); + nvgpu_udelay(10); } } else { gp106_pmu_enable_hw(pmu, true); @@ -113,7 +111,7 @@ static int pmu_enable(struct pmu_gk20a *pmu, bool enable) err = pmu_idle(pmu); if (err) return err; - udelay(5); + nvgpu_udelay(5); pmu_enable_irq(pmu, true); } @@ -155,7 +153,7 @@ static int gp106_sec2_reset(struct gk20a *g) //sec2 reset gk20a_writel(g, psec_falcon_engine_r(), pwr_falcon_engine_reset_true_f()); - udelay(10); + nvgpu_udelay(10); gk20a_writel(g, psec_falcon_engine_r(), pwr_falcon_engine_reset_false_f()); diff --git a/drivers/gpu/nvgpu/gp106/regops_gp106.c b/drivers/gpu/nvgpu/gp106/regops_gp106.c index 0d90977d..a165c426 100644 --- a/drivers/gpu/nvgpu/gp106/regops_gp106.c +++ b/drivers/gpu/nvgpu/gp106/regops_gp106.c @@ -16,9 +16,6 @@ * along with this program. If not, see . */ -#include -#include - #include "gk20a/gk20a.h" #include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/regops_gk20a.h" diff --git a/drivers/gpu/nvgpu/gp106/sec2_gp106.c b/drivers/gpu/nvgpu/gp106/sec2_gp106.c index cc1e91f6..078a1436 100644 --- a/drivers/gpu/nvgpu/gp106/sec2_gp106.c +++ b/drivers/gpu/nvgpu/gp106/sec2_gp106.c @@ -11,8 +11,6 @@ * more details. */ -#include /* for udelay */ - #include "gk20a/gk20a.h" #include "gk20a/pmu_gk20a.h" @@ -46,7 +44,7 @@ int sec2_clear_halt_interrupt_status(struct gk20a *g, unsigned int timeout) psec_falcon_irqstat_halt_true_f()) /*halt irq is clear*/ break; - udelay(1); + nvgpu_udelay(1); } while (!nvgpu_timeout_expired(&to)); if (nvgpu_timeout_peek_expired(&to)) @@ -68,7 +66,7 @@ int sec2_wait_for_halt(struct gk20a *g, unsigned int timeout) completion = 0; break; } - udelay(1); + nvgpu_udelay(1); } while (!nvgpu_timeout_expired(&to)); if (completion) { diff --git a/drivers/gpu/nvgpu/gp106/xve_gp106.c b/drivers/gpu/nvgpu/gp106/xve_gp106.c index e4582e15..a5834174 100644 --- a/drivers/gpu/nvgpu/gp106/xve_gp106.c +++ b/drivers/gpu/nvgpu/gp106/xve_gp106.c @@ -14,7 +14,6 @@ * along with this program. If not, see . */ -#include #include #include @@ -92,7 +91,7 @@ static void xve_reset_gpu_gp106(struct gk20a *g) /* * Don't access GPU until _after_ it's back out of reset! */ - msleep(100); + nvgpu_msleep(100); g->ops.xve.xve_writel(g, xve_reset_r(), 0); } @@ -530,7 +529,7 @@ static ssize_t xve_link_speed_write(struct file *filp, return -EINVAL; /* Brief pause... To help rate limit this. */ - msleep(250); + nvgpu_msleep(250); /* * And actually set the speed. Yay. -- cgit v1.2.2