From 43980bfe06effc723b7a0199957d7b7dd664c0d0 Mon Sep 17 00:00:00 2001 From: Vedashree Vidwans Date: Thu, 8 Jul 2021 23:14:27 -0700 Subject: [PATCH] gpu: nvgpu: remove nvgpu_is_bpmp_running usage BPMP driver doesn't support any API to check whether bpmp is running. Remove use of nvgpu_is_bpmp_running. Bug 200720732 Change-Id: Id266e65d4af598dd056cbdbaa219d0d53b7b3fb3 Signed-off-by: Vedashree Vidwans Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2556448 Reviewed-by: svcacv Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert Reviewed-by: svc_kernel_abi Reviewed-by: Seshendra Gadagottu Reviewed-by: Deepak Nibade Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/init/nvgpu_init.c | 2 -- drivers/gpu/nvgpu/hal/fb/fb_gv11b_fusa.c | 2 +- drivers/gpu/nvgpu/hal/mc/mc_ga10b_fusa.c | 4 ++-- drivers/gpu/nvgpu/include/nvgpu/soc.h | 16 +--------------- .../nvgpu/os/linux/nvlink/hal/ga10b_mssnvlink.c | 6 +++--- .../gpu/nvgpu/os/linux/platform_gp10b_tegra.c | 5 ----- drivers/gpu/nvgpu/os/linux/soc.c | 6 ------ drivers/gpu/nvgpu/os/posix/soc.c | 7 +------ 8 files changed, 8 insertions(+), 40 deletions(-) diff --git a/drivers/gpu/nvgpu/common/init/nvgpu_init.c b/drivers/gpu/nvgpu/common/init/nvgpu_init.c index d597f9ea0..e769ca026 100644 --- a/drivers/gpu/nvgpu/common/init/nvgpu_init.c +++ b/drivers/gpu/nvgpu/common/init/nvgpu_init.c @@ -720,8 +720,6 @@ int nvgpu_early_poweron(struct gk20a *g) * XBAR, L2 and HUB are enabled during * g->ops.fifo.reset_enable_hw(). This introduces a * dependency to get the MIG map conf information. - * (if nvgpu_is_bpmp_running() == false treated as - * simulation/emulation/GPU standalone platform). * fb - MIG config programming. * ltc - MIG config programming. * bios, bus, ecc and clk - dependent module of priv_ring/fb/ltc. diff --git a/drivers/gpu/nvgpu/hal/fb/fb_gv11b_fusa.c b/drivers/gpu/nvgpu/hal/fb/fb_gv11b_fusa.c index f48def684..f8a6c7136 100644 --- a/drivers/gpu/nvgpu/hal/fb/fb_gv11b_fusa.c +++ b/drivers/gpu/nvgpu/hal/fb/fb_gv11b_fusa.c @@ -49,7 +49,7 @@ static void gv11b_init_nvlink_soc_credits(struct gk20a *g) { #ifndef __NVGPU_POSIX__ - if (nvgpu_is_bpmp_running(g) && (!nvgpu_platform_is_simulation(g))) { + if (nvgpu_platform_is_silicon(g)) { nvgpu_log(g, gpu_dbg_info, "nvlink soc credits init done by bpmp"); } else { #ifdef CONFIG_NVGPU_NVLINK diff --git a/drivers/gpu/nvgpu/hal/mc/mc_ga10b_fusa.c b/drivers/gpu/nvgpu/hal/mc/mc_ga10b_fusa.c index fb403894b..a2735b61c 100644 --- a/drivers/gpu/nvgpu/hal/mc/mc_ga10b_fusa.c +++ b/drivers/gpu/nvgpu/hal/mc/mc_ga10b_fusa.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2020-2021, 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"), @@ -270,7 +270,7 @@ void ga10b_mc_elpg_enable(struct gk20a *g) * these three out of reset, software should enable * all of these. */ - if (!nvgpu_is_bpmp_running(g)) { + if (!nvgpu_platform_is_silicon(g)) { nvgpu_writel(g, mc_elpg_enable_r(), mc_elpg_enable_xbar_enabled_f() | mc_elpg_enable_l2_enabled_f() | diff --git a/drivers/gpu/nvgpu/include/nvgpu/soc.h b/drivers/gpu/nvgpu/include/nvgpu/soc.h index 7f1980b26..1a5534258 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/soc.h +++ b/drivers/gpu/nvgpu/include/nvgpu/soc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2021, 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"), @@ -82,15 +82,6 @@ bool nvgpu_platform_is_fpga(struct gk20a *g); */ bool nvgpu_is_hypervisor_mode(struct gk20a *g); -/** - * @brief Check whether bpmp server is runing. - * - * @param g [in] GPU super structure. - * - * @return Returns true if bpmp server is running else returns false. - */ -bool nvgpu_is_bpmp_running(struct gk20a *g); - /** * @brief Check whether soc is t194 and revision a01. * @@ -140,11 +131,6 @@ static inline bool nvgpu_is_hypervisor_mode(struct gk20a *g) return false; } -static inline bool nvgpu_is_bpmp_running(struct gk20a *g) -{ - return false; -} - static inline bool nvgpu_is_soc_t194_a01(struct gk20a *g) { return false; diff --git a/drivers/gpu/nvgpu/os/linux/nvlink/hal/ga10b_mssnvlink.c b/drivers/gpu/nvgpu/os/linux/nvlink/hal/ga10b_mssnvlink.c index c3018718f..d2cfca0f6 100644 --- a/drivers/gpu/nvgpu/os/linux/nvlink/hal/ga10b_mssnvlink.c +++ b/drivers/gpu/nvgpu/os/linux/nvlink/hal/ga10b_mssnvlink.c @@ -58,9 +58,9 @@ void ga10b_init_nvlink_soc_credits(struct gk20a *g) return; } - if (nvgpu_is_bpmp_running(g) ) { - nvgpu_log(g, gpu_dbg_info, "bpmp running: " - "nvlink soc credits init done by bpmp"); + if (nvgpu_platform_is_silicon(g)) { + nvgpu_log(g, gpu_dbg_info, + "nvlink soc credits init done by bpmp on silicon"); return; } /* init nvlink soc credits and force snoop */ diff --git a/drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c index ccfaf0391..9c07c5159 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c @@ -99,11 +99,6 @@ int gp10b_tegra_acquire_platform_clocks(struct device *dev, return 0; } -#ifdef TEGRA186_POWER_DOMAIN_GPU - if (!tegra_bpmp_running()) { - return 0; - } -#endif num_clks_dt = of_clk_get_parent_count(np); if (num_clks_dt > num_clk_entries) { nvgpu_err(g, "maximum number of clocks supported is %d", diff --git a/drivers/gpu/nvgpu/os/linux/soc.c b/drivers/gpu/nvgpu/os/linux/soc.c index 5718f2fba..af1b9393f 100644 --- a/drivers/gpu/nvgpu/os/linux/soc.c +++ b/drivers/gpu/nvgpu/os/linux/soc.c @@ -16,7 +16,6 @@ #include #endif #include -#include #ifdef CONFIG_TEGRA_HV_MANAGER #include #endif @@ -45,11 +44,6 @@ bool nvgpu_is_hypervisor_mode(struct gk20a *g) return is_tegra_hypervisor_mode(); } -bool nvgpu_is_bpmp_running(struct gk20a *g) -{ - return tegra_bpmp_running(); -} - bool nvgpu_is_soc_t194_a01(struct gk20a *g) { struct device *dev = dev_from_gk20a(g); diff --git a/drivers/gpu/nvgpu/os/posix/soc.c b/drivers/gpu/nvgpu/os/posix/soc.c index 7d3cd1aa4..62962aafb 100644 --- a/drivers/gpu/nvgpu/os/posix/soc.c +++ b/drivers/gpu/nvgpu/os/posix/soc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-2021, 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"), @@ -50,11 +50,6 @@ bool nvgpu_is_hypervisor_mode(struct gk20a *g) return false; } -bool nvgpu_is_bpmp_running(struct gk20a *g) -{ - return false; -} - bool nvgpu_is_soc_t194_a01(struct gk20a *g) { struct nvgpu_os_posix *p = nvgpu_os_posix_from_gk20a(g);