diff --git a/arch/nvgpu-hal-new.yaml b/arch/nvgpu-hal-new.yaml index 5e8147845..a20b743c5 100644 --- a/arch/nvgpu-hal-new.yaml +++ b/arch/nvgpu-hal-new.yaml @@ -657,3 +657,11 @@ bios: gpu: dgpu sources: [ hal/bios/bios_tu104.c, hal/bios/bios_tu104.h ] + +xve: + safe: yes + owner: Alex W + gpu: dgpu + sources: [ include/nvgpu/xve.h, + hal/xve/xve_gp106.c, + hal/xve/xve_gp106.h ] diff --git a/arch/nvgpu-hal.yaml b/arch/nvgpu-hal.yaml index d8f44c432..50d165a41 100644 --- a/arch/nvgpu-hal.yaml +++ b/arch/nvgpu-hal.yaml @@ -8,14 +8,6 @@ init: owner: Terje B sources: [ include/nvgpu/hal_init.h ] -xve: - safe: yes - owner: Alex W - gpu: dgpu - sources: [ include/nvgpu/xve.h, - common/xve/xve_gp106.c, - common/xve/xve_gp106.h ] - nvlink: safe: yes owner: Tejal K diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index 64fae795a..22a5a31d3 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -67,7 +67,6 @@ nvgpu-y += \ common/utils/worker.o \ common/ptimer/ptimer.o \ common/perf/perfbuf.o \ - common/xve/xve_gp106.o \ common/therm/therm.o \ common/mc/mc.o \ common/sync/channel_sync.o \ @@ -320,7 +319,8 @@ nvgpu-y += \ hal/bios/bios_tu104.o \ hal/top/top_gm20b.o \ hal/top/top_gp106.o \ - hal/top/top_gv100.o + hal/top/top_gv100.o \ + hal/xve/xve_gp106.o # Linux specific parts of nvgpu. diff --git a/drivers/gpu/nvgpu/Makefile.sources b/drivers/gpu/nvgpu/Makefile.sources index 1ee359150..84e1bee2d 100644 --- a/drivers/gpu/nvgpu/Makefile.sources +++ b/drivers/gpu/nvgpu/Makefile.sources @@ -98,7 +98,6 @@ srcs += common/utils/enabled.c \ common/mm/nvgpu_sgt.c \ common/mm/mm.c \ common/mm/dma.c \ - common/xve/xve_gp106.c \ common/therm/therm.c \ common/ltc/ltc.c \ common/fbp/fbp.c \ @@ -213,7 +212,8 @@ srcs += common/utils/enabled.c \ hal/pmu/pmu_gp106.c \ hal/pmu/pmu_gv11b.c \ hal/top/top_gm20b.c \ - hal/top/top_gp106.c + hal/top/top_gp106.c \ + hal/xve/xve_gp106.c # Source files below are functionaly safe (FuSa) and must always be included. srcs += hal/mm/mm_gv11b_fusa.c \ diff --git a/drivers/gpu/nvgpu/hal/init/hal_tu104.c b/drivers/gpu/nvgpu/hal/init/hal_tu104.c index f244f57d3..962215d58 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_tu104.c +++ b/drivers/gpu/nvgpu/hal/init/hal_tu104.c @@ -159,9 +159,8 @@ #include "hal/top/top_gv11b.h" #include "hal/bios/bios_tu104.h" #include "hal/pramin/pramin_init.h" +#include "hal/xve/xve_gp106.h" - -#include "common/xve/xve_gp106.h" #include "common/nvlink/init/device_reginit_gv100.h" #include "common/nvlink/intr_and_err_handling_gv100.h" #include "hal/nvlink/minion_gv100.h" diff --git a/drivers/gpu/nvgpu/common/xve/xve_gp106.c b/drivers/gpu/nvgpu/hal/xve/xve_gp106.c similarity index 98% rename from drivers/gpu/nvgpu/common/xve/xve_gp106.c rename to drivers/gpu/nvgpu/hal/xve/xve_gp106.c index 721f91513..db1a353a6 100644 --- a/drivers/gpu/nvgpu/common/xve/xve_gp106.c +++ b/drivers/gpu/nvgpu/hal/xve/xve_gp106.c @@ -98,7 +98,7 @@ int xve_get_speed_gp106(struct gk20a *g, u32 *xve_link_speed) link_speed = xve_link_control_status_link_speed_v(status); /* - * Can't use a switch statement becuase switch statements dont work with + * Can't use a switch statement because switch statements dont work with * function calls. */ if (link_speed == xve_link_control_status_link_speed_link_speed_2p5_v()) { @@ -204,7 +204,7 @@ static int do_xve_set_speed_gp106(struct gk20a *g, u32 next_link_speed) u32 current_link_speed, new_link_speed; u32 dl_mgr, saved_dl_mgr; u32 pl_link_config; - u32 link_control_status, link_speed_setting, link_width; + u32 link_control_status, link_speed_setting = 0U, link_width; struct nvgpu_timeout timeout; int attempts = 10, err_status = 0; @@ -283,7 +283,7 @@ static int do_xve_set_speed_gp106(struct gk20a *g, u32 next_link_speed) xp_pl_link_config_max_link_rate_8000_mtps_v()); break; default: - BUG(); /* Should never be hit. */ + WARN_ON(true); /* Should never be hit. */ break; } @@ -310,7 +310,7 @@ static int do_xve_set_speed_gp106(struct gk20a *g, u32 next_link_speed) pl_link_config |= xp_pl_link_config_target_tx_width_f( xp_pl_link_config_target_tx_width_x16_v()); } else { - BUG(); + WARN_ON(true); } xv_sc_dbg(g, LINK_SETTINGS, " pl_link_config = 0x%08x", pl_link_config); @@ -385,7 +385,7 @@ static int do_xve_set_speed_gp106(struct gk20a *g, u32 next_link_speed) * The rest of the driver is probably about to * explode... */ - BUG(); + WARN_ON(true); } link_control_status = diff --git a/drivers/gpu/nvgpu/common/xve/xve_gp106.h b/drivers/gpu/nvgpu/hal/xve/xve_gp106.h similarity index 100% rename from drivers/gpu/nvgpu/common/xve/xve_gp106.h rename to drivers/gpu/nvgpu/hal/xve/xve_gp106.h