From df4d5f3c57847f53ec7843d39328e01eb47278c3 Mon Sep 17 00:00:00 2001 From: Sagar Kamble Date: Thu, 17 Sep 2020 11:48:48 +0530 Subject: [PATCH] gpu: nvgpu: replace CONFIG_NVGPU_SUPPORT_TURING usage with CONFIG_NVGPU_DGPU Also update the config check in pci_power.c for definitions of stubs for pcie_attach|detach_controller callbacks. Bug 200658918 Bug 200609273 Change-Id: Ie3f3b4de4cbcd520e54a3eb0590699c1a433e82d Signed-off-by: Sagar Kamble Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2414959 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/gpu/nvgpu/Makefile.linux.configs | 8 -------- drivers/gpu/nvgpu/Makefile.shared.configs | 1 - drivers/gpu/nvgpu/doxygen/Doxyfile.safety | 1 - drivers/gpu/nvgpu/hal/init/hal_init.c | 2 -- drivers/gpu/nvgpu/os/linux/pci_power.c | 7 +++++-- libs/Makefile.common.tmk | 1 - 6 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/nvgpu/Makefile.linux.configs b/drivers/gpu/nvgpu/Makefile.linux.configs index 733df5934..7fdd7b6a6 100644 --- a/drivers/gpu/nvgpu/Makefile.linux.configs +++ b/drivers/gpu/nvgpu/Makefile.linux.configs @@ -91,11 +91,6 @@ ifeq ($(CONFIG_NV_TEGRA_MC),y) CONFIG_NVGPU_USE_TEGRA_ALLOC_FD := y endif -# Support for NVIDIA Turing family of GPU -ifeq ($(CONFIG_ARCH_TEGRA_19x_SOC),y) -CONFIG_NVGPU_SUPPORT_TURING := y -endif - # Support Nvlink ifeq ($(CONFIG_TEGRA_NVLINK),y) CONFIG_NVGPU_NVLINK := y @@ -204,9 +199,6 @@ endif ifeq ($(CONFIG_NVGPU_USE_TEGRA_ALLOC_FD),y) ccflags-y += -DCONFIG_NVGPU_USE_TEGRA_ALLOC_FD endif -ifeq ($(CONFIG_NVGPU_SUPPORT_TURING),y) -ccflags-y += -DCONFIG_NVGPU_SUPPORT_TURING -endif ifeq ($(CONFIG_NVGPU_NVLINK),y) ccflags-y += -DCONFIG_NVGPU_NVLINK endif diff --git a/drivers/gpu/nvgpu/Makefile.shared.configs b/drivers/gpu/nvgpu/Makefile.shared.configs index c98fdaa8a..36aaea040 100644 --- a/drivers/gpu/nvgpu/Makefile.shared.configs +++ b/drivers/gpu/nvgpu/Makefile.shared.configs @@ -53,7 +53,6 @@ NVGPU_COMMON_CFLAGS := # NVGPU_COMMON_CFLAGS += \ - -DCONFIG_NVGPU_SUPPORT_TURING \ -DCONFIG_TEGRA_GK20A_PMU=1 \ -DCONFIG_TEGRA_ACR=1 \ -DCONFIG_NVGPU_GR_VIRTUALIZATION \ diff --git a/drivers/gpu/nvgpu/doxygen/Doxyfile.safety b/drivers/gpu/nvgpu/doxygen/Doxyfile.safety index dc9db8851..e23368c53 100644 --- a/drivers/gpu/nvgpu/doxygen/Doxyfile.safety +++ b/drivers/gpu/nvgpu/doxygen/Doxyfile.safety @@ -2045,7 +2045,6 @@ PREDEFINED += NV_IS_COVERITY # Enable safety-related flags PREDEFINED += CONFIG_TEGRA_GK20A_NVHOST -PREDEFINED += CONFIG_NVGPU_SUPPORT_TURING PREDEFINED += CONFIG_TEGRA_GK20A_PMU PREDEFINED += CONFIG_TEGRA_ACR PREDEFINED += CONFIG_NVGPU_GR_VIRTUALIZATION diff --git a/drivers/gpu/nvgpu/hal/init/hal_init.c b/drivers/gpu/nvgpu/hal/init/hal_init.c index b5c8a7014..6531e9e49 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_init.c +++ b/drivers/gpu/nvgpu/hal/init/hal_init.c @@ -82,13 +82,11 @@ int nvgpu_init_hal(struct gk20a *g) break; #if defined(CONFIG_NVGPU_DGPU) && defined(CONFIG_NVGPU_HAL_NON_FUSA) -#if defined(CONFIG_NVGPU_SUPPORT_TURING) case NVGPU_GPUID_TU104: if (tu104_init_hal(g) != 0) { return -ENODEV; } break; -#endif #if defined(CONFIG_NVGPU_NEXT) && defined(CONFIG_NVGPU_DGPU) case NVGPU_NEXT_DGPU_GPUID: if (NVGPU_NEXT_DGPU_INIT_HAL(g) != 0) { diff --git a/drivers/gpu/nvgpu/os/linux/pci_power.c b/drivers/gpu/nvgpu/os/linux/pci_power.c index ba48cfade..759190fb9 100644 --- a/drivers/gpu/nvgpu/os/linux/pci_power.c +++ b/drivers/gpu/nvgpu/os/linux/pci_power.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -382,7 +382,10 @@ static const struct file_operations debug_power_stats_fops = { }; #if (!IS_ENABLED(CONFIG_PCIE_TEGRA_DW) && !IS_ENABLED(CONFIG_PCIE_TEGRA)) || \ - !IS_ENABLED(CONFIG_ARCH_TEGRA_19x_SOC) || \ + ((LINUX_VERSION_CODE <= KERNEL_VERSION(4, 14, 0)) && \ + !IS_ENABLED(CONFIG_ARCH_TEGRA_19x_SOC)) || \ + ((LINUX_VERSION_CODE > KERNEL_VERSION(4, 14, 0)) && \ + !IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC)) || \ LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) void *tegra_pcie_detach_controller(struct pci_dev *pdev) { diff --git a/libs/Makefile.common.tmk b/libs/Makefile.common.tmk index f15d73baf..159e0bafe 100644 --- a/libs/Makefile.common.tmk +++ b/libs/Makefile.common.tmk @@ -54,7 +54,6 @@ NVGPU_FORCE_DEBUG_PROFILE := 1 endif NV_COMPONENT_CFLAGS += \ -D__NVGPU_POSIX__ \ - -DCONFIG_NVGPU_SUPPORT_TURING \ -D__NVGPU_UNIT_TEST__ -include $(NVGPU_SOURCE)/Makefile.shared.configs