diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index 7148e6689..72e0e954e 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -22,6 +22,7 @@ ccflags-y += -Wframe-larger-than=2048 ccflags-y += -Wno-multichar ccflags-y += -Werror ccflags-y += -Wno-error=cpp +ccflags-y += -Wmissing-prototypes ifeq ($(VERSION),4) ccflags-y += -Wextra -Wno-unused-parameter -Wno-missing-field-initializers endif diff --git a/drivers/gpu/nvgpu/hal/gr/ctxsw_prog/ctxsw_prog_ga10b.c b/drivers/gpu/nvgpu/hal/gr/ctxsw_prog/ctxsw_prog_ga10b.c index c65194eb6..f184d9121 100644 --- a/drivers/gpu/nvgpu/hal/gr/ctxsw_prog/ctxsw_prog_ga10b.c +++ b/drivers/gpu/nvgpu/hal/gr/ctxsw_prog/ctxsw_prog_ga10b.c @@ -1,24 +1,5 @@ -/* - * Copyright (c) 2020, 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"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include @@ -26,6 +7,8 @@ #include +#include "ctxsw_prog_ga10b.h" + #ifdef CONFIG_DEBUG_FS void ga10b_ctxsw_prog_dump_ctxsw_stats(struct gk20a *g, struct nvgpu_mem *ctx_mem) diff --git a/drivers/gpu/nvgpu/os/linux/clk_ga10b.c b/drivers/gpu/nvgpu/os/linux/clk_ga10b.c index d110785eb..9d793e55e 100644 --- a/drivers/gpu/nvgpu/os/linux/clk_ga10b.c +++ b/drivers/gpu/nvgpu/os/linux/clk_ga10b.c @@ -1,24 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2017-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + /* * Linux clock support for ga10b - * - * Copyright (c) 2017-2021, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . */ #include #include "clk.h" +#include "clk_ga10b.h" #include "os_linux.h" #include "platform_gk20a.h" diff --git a/drivers/gpu/nvgpu/os/linux/debug_clk_gm20b.c b/drivers/gpu/nvgpu/os/linux/debug_clk_gm20b.c index 817b7f309..3aba4f059 100644 --- a/drivers/gpu/nvgpu/os/linux/debug_clk_gm20b.c +++ b/drivers/gpu/nvgpu/os/linux/debug_clk_gm20b.c @@ -1,18 +1,5 @@ -/* - * Copyright (c) 2017-2022, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2017-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include @@ -22,6 +9,7 @@ #include #include +#include "debug_clk_gm20b.h" #include "hal/clk/clk_gm20b.h" #include "os_linux.h" #include "platform_gk20a.h" diff --git a/drivers/gpu/nvgpu/os/linux/debug_clk_tu104.c b/drivers/gpu/nvgpu/os/linux/debug_clk_tu104.c index 4643f50bb..2f69943c0 100644 --- a/drivers/gpu/nvgpu/os/linux/debug_clk_tu104.c +++ b/drivers/gpu/nvgpu/os/linux/debug_clk_tu104.c @@ -1,23 +1,11 @@ -/* - * 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include #include "os_linux.h" +#include "debug_clk_tu104.h" #include #include diff --git a/drivers/gpu/nvgpu/os/linux/debug_fecs_trace.c b/drivers/gpu/nvgpu/os/linux/debug_fecs_trace.c index 7179d39e9..65729ed9b 100644 --- a/drivers/gpu/nvgpu/os/linux/debug_fecs_trace.c +++ b/drivers/gpu/nvgpu/os/linux/debug_fecs_trace.c @@ -1,24 +1,12 @@ -/* - * Copyright (c) 2018-2022, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include #include +#include "debug_fecs_trace.h" #include "os_linux.h" /* diff --git a/drivers/gpu/nvgpu/os/linux/debug_pmgr.c b/drivers/gpu/nvgpu/os/linux/debug_pmgr.c index 88af14049..6d0457e82 100644 --- a/drivers/gpu/nvgpu/os/linux/debug_pmgr.c +++ b/drivers/gpu/nvgpu/os/linux/debug_pmgr.c @@ -1,23 +1,11 @@ -/* - * Copyright (c) 2018, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include +#include "debug_pmgr.h" #include "os_linux.h" static int pmgr_pwr_devices_get_power_u64(void *data, u64 *p) diff --git a/drivers/gpu/nvgpu/os/linux/debug_pmgr.h b/drivers/gpu/nvgpu/os/linux/debug_pmgr.h index bd6c55677..514d539be 100644 --- a/drivers/gpu/nvgpu/os/linux/debug_pmgr.h +++ b/drivers/gpu/nvgpu/os/linux/debug_pmgr.h @@ -1,26 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2018, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ #ifndef __LINUX_DEBUG_PMGR_H #define __LINUX_DEBUG_PMGR_H +#include "os_linux.h" + #ifdef CONFIG_DEBUG_FS int nvgpu_pmgr_init_debugfs_linux(struct nvgpu_os_linux *l); #else -int nvgpu_pmgr_init_debugfs_linux(struct nvgpu_os_linux *l) +static inline int nvgpu_pmgr_init_debugfs_linux(struct nvgpu_os_linux *l) { return 0; } diff --git a/drivers/gpu/nvgpu/os/linux/debug_s_param.c b/drivers/gpu/nvgpu/os/linux/debug_s_param.c index 6b3a579a9..47e331fd9 100644 --- a/drivers/gpu/nvgpu/os/linux/debug_s_param.c +++ b/drivers/gpu/nvgpu/os/linux/debug_s_param.c @@ -1,22 +1,10 @@ -/* - * Copyright (c) 2019-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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include "os_linux.h" #include "include/nvgpu/bios.h" +#include "debug_s_param.h" #include #include diff --git a/drivers/gpu/nvgpu/os/linux/debug_therm_tu104.c b/drivers/gpu/nvgpu/os/linux/debug_therm_tu104.c index eba6e25da..13191a388 100644 --- a/drivers/gpu/nvgpu/os/linux/debug_therm_tu104.c +++ b/drivers/gpu/nvgpu/os/linux/debug_therm_tu104.c @@ -1,23 +1,11 @@ -/* - * Copyright (c) 2019-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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include #include "os_linux.h" +#include "debug_therm_tu104.h" static int therm_get_internal_sensor_curr_temp(void *data, u64 *val) { diff --git a/drivers/gpu/nvgpu/os/linux/debug_volt.c b/drivers/gpu/nvgpu/os/linux/debug_volt.c index 6b4a1dc8c..1161ebceb 100644 --- a/drivers/gpu/nvgpu/os/linux/debug_volt.c +++ b/drivers/gpu/nvgpu/os/linux/debug_volt.c @@ -1,21 +1,9 @@ -/* - * Copyright (c) 2019-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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include "os_linux.h" +#include "debug_volt.h" #include diff --git a/drivers/gpu/nvgpu/os/linux/io_usermode.c b/drivers/gpu/nvgpu/os/linux/io_usermode.c index b851f176b..502247709 100644 --- a/drivers/gpu/nvgpu/os/linux/io_usermode.c +++ b/drivers/gpu/nvgpu/os/linux/io_usermode.c @@ -1,17 +1,8 @@ -/* - * Copyright (c) 2017-2021, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2017-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include +#include #include #include diff --git a/drivers/gpu/nvgpu/os/linux/ioctl.c b/drivers/gpu/nvgpu/os/linux/ioctl.c index cbc11ec0f..9c25a55a0 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl.c @@ -1,19 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2011-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + /* * NVGPU IOCTLs - * - * Copyright (c) 2011-2023, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . */ #if defined(CONFIG_NVIDIA_CONFTEST) @@ -373,7 +362,7 @@ out: return err; } -void gk20a_remove_devices_and_classes(struct gk20a *g, bool power_node) +static void gk20a_remove_devices_and_classes(struct gk20a *g, bool power_node) { struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); struct nvgpu_cdev *cdev, *n; diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_nvs.c b/drivers/gpu/nvgpu/os/linux/ioctl_nvs.c index bbfb7646f..a0e87f0b2 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_nvs.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_nvs.c @@ -1,15 +1,5 @@ -/* - * Copyright (c) 2021-2023, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include @@ -33,6 +23,7 @@ #endif #include "ioctl.h" +#include "ioctl_nvs.h" #include "dmabuf_nvs.h" /* diff --git a/drivers/gpu/nvgpu/os/linux/linux-channel.c b/drivers/gpu/nvgpu/os/linux/linux-channel.c index 4dc31037e..22e01dec6 100644 --- a/drivers/gpu/nvgpu/os/linux/linux-channel.c +++ b/drivers/gpu/nvgpu/os/linux/linux-channel.c @@ -1,18 +1,5 @@ -/* - * Copyright (c) 2017-2023, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2017-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include @@ -438,7 +425,7 @@ static int nvgpu_channel_copy_user_gpfifo(struct nvgpu_gpfifo_entry *dest, return n == 0 ? 0 : -EFAULT; } -int nvgpu_usermode_buf_from_dmabuf(struct gk20a *g, int dmabuf_fd, +static int nvgpu_usermode_buf_from_dmabuf(struct gk20a *g, int dmabuf_fd, struct nvgpu_mem *mem, struct nvgpu_usermode_buf_linux *buf) { struct device *dev = dev_from_gk20a(g); @@ -488,7 +475,7 @@ put_dmabuf: return err; } -void nvgpu_os_channel_free_usermode_buffers(struct nvgpu_channel *c) +static void nvgpu_os_channel_free_usermode_buffers(struct nvgpu_channel *c) { struct nvgpu_channel_linux *priv = c->os_priv; struct gk20a *g = c->g; diff --git a/drivers/gpu/nvgpu/os/linux/linux-dma.c b/drivers/gpu/nvgpu/os/linux/linux-dma.c index aca9dede9..28fb3890d 100644 --- a/drivers/gpu/nvgpu/os/linux/linux-dma.c +++ b/drivers/gpu/nvgpu/os/linux/linux-dma.c @@ -1,18 +1,5 @@ -/* - * Copyright (c) 2017-2023, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2017-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include @@ -46,7 +33,7 @@ * This function can't fail. It will always at minimum memset() the buf which * is assumed to be able to hold at least %NVGPU_DMA_STR_SIZE bytes. */ -void nvgpu_dma_flags_to_str(struct gk20a *g, unsigned long flags, char *buf) +static void nvgpu_dma_flags_to_str(struct gk20a *g, unsigned long flags, char *buf) { int bytes_available = NVGPU_DMA_STR_SIZE - 1; diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index de555ecda..c4057ce74 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c @@ -1,19 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2011-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + /* * GK20A Graphics - * - * Copyright (c) 2011-2023, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . */ #include @@ -757,7 +746,7 @@ MODULE_DEVICE_TABLE(of, tegra_gk20a_of_match); * b) Down-Write Busy lock * c) Acquire platform->railgate lock. */ -int gk20a_block_new_jobs_and_idle(struct gk20a *g) +static int gk20a_block_new_jobs_and_idle(struct gk20a *g) { struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); struct device *dev = dev_from_gk20a(g); @@ -840,7 +829,7 @@ int gk20a_block_new_jobs_and_idle(struct gk20a *g) return 0; } -int gk20a_block_new_jobs_and_poweroff(struct gk20a *g) +static int gk20a_block_new_jobs_and_poweroff(struct gk20a *g) { struct device *dev = dev_from_gk20a(g); struct gk20a_platform *platform = dev_get_drvdata(dev); diff --git a/drivers/gpu/nvgpu/os/linux/module_usermode.c b/drivers/gpu/nvgpu/os/linux/module_usermode.c index 073518991..9c0296976 100644 --- a/drivers/gpu/nvgpu/os/linux/module_usermode.c +++ b/drivers/gpu/nvgpu/os/linux/module_usermode.c @@ -1,22 +1,10 @@ -/* - * Copyright (c) 2017-2021, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2017-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include "os_linux.h" +#include "module_usermode.h" /* * Locks out the driver from accessing GPU registers. This prevents access to diff --git a/drivers/gpu/nvgpu/os/linux/nvlink.c b/drivers/gpu/nvgpu/os/linux/nvlink.c index a49c62618..67354a020 100644 --- a/drivers/gpu/nvgpu/os/linux/nvlink.c +++ b/drivers/gpu/nvgpu/os/linux/nvlink.c @@ -7,6 +7,8 @@ #include #endif +#include "nvlink.h" + #include #include #include diff --git a/drivers/gpu/nvgpu/os/linux/os_fence_syncpt.c b/drivers/gpu/nvgpu/os/linux/os_fence_syncpt.c index 143ca2a1b..e1aaa137c 100644 --- a/drivers/gpu/nvgpu/os/linux/os_fence_syncpt.c +++ b/drivers/gpu/nvgpu/os/linux/os_fence_syncpt.c @@ -1,18 +1,5 @@ -/* - * 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #if !defined(CONFIG_TEGRA_GK20A_NVHOST_HOST1X) #include @@ -29,6 +16,7 @@ #include #include #include +#include #include "os_fence_priv.h" #include "nvhost_priv.h" diff --git a/drivers/gpu/nvgpu/os/linux/os_ops.c b/drivers/gpu/nvgpu/os/linux/os_ops.c index 1396bbfc1..cd6da6c6f 100644 --- a/drivers/gpu/nvgpu/os/linux/os_ops.c +++ b/drivers/gpu/nvgpu/os/linux/os_ops.c @@ -1,21 +1,9 @@ -/* - * 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include "os_linux.h" +#include "os_ops.h" #include "os_ops_gm20b.h" #include "os_ops_gp10b.h" #include "os_ops_gv11b.h" diff --git a/drivers/gpu/nvgpu/os/linux/os_ops_gm20b.c b/drivers/gpu/nvgpu/os/linux/os_ops_gm20b.c index 3eacc9b12..097e268e3 100644 --- a/drivers/gpu/nvgpu/os/linux/os_ops_gm20b.c +++ b/drivers/gpu/nvgpu/os/linux/os_ops_gm20b.c @@ -1,20 +1,8 @@ -/* - * Copyright (c) 2018-2019, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include "os_linux.h" +#include "os_ops_gm20b.h" #include "cde_gm20b.h" #include "debug_clk_gm20b.h" diff --git a/drivers/gpu/nvgpu/os/linux/os_ops_gp10b.c b/drivers/gpu/nvgpu/os/linux/os_ops_gp10b.c index e2891f735..c11ed01f0 100644 --- a/drivers/gpu/nvgpu/os/linux/os_ops_gp10b.c +++ b/drivers/gpu/nvgpu/os/linux/os_ops_gp10b.c @@ -1,20 +1,8 @@ -/* - * Copyright (c) 2018, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include "os_linux.h" +#include "os_ops_gp10b.h" #include "cde_gp10b.h" #include "debug_fecs_trace.h" diff --git a/drivers/gpu/nvgpu/os/linux/os_ops_gv100.c b/drivers/gpu/nvgpu/os/linux/os_ops_gv100.c index 9e8b6215c..bef6903e1 100644 --- a/drivers/gpu/nvgpu/os/linux/os_ops_gv100.c +++ b/drivers/gpu/nvgpu/os/linux/os_ops_gv100.c @@ -1,20 +1,8 @@ -/* - * Copyright (c) 2018, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include "os_linux.h" +#include "os_ops_gv100.h" #include "debug_clk_tu104.h" #include "debug_therm_tu104.h" diff --git a/drivers/gpu/nvgpu/os/linux/os_ops_gv11b.c b/drivers/gpu/nvgpu/os/linux/os_ops_gv11b.c index a82ad0ab2..5b1cf2270 100644 --- a/drivers/gpu/nvgpu/os/linux/os_ops_gv11b.c +++ b/drivers/gpu/nvgpu/os/linux/os_ops_gv11b.c @@ -1,21 +1,9 @@ -/* - * Copyright (c) 2018, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include "os_linux.h" +#include "os_ops_gv11b.h" #include "debug_fecs_trace.h" static struct nvgpu_os_linux_ops gv11b_os_linux_ops = { diff --git a/drivers/gpu/nvgpu/os/linux/os_ops_tu104.c b/drivers/gpu/nvgpu/os/linux/os_ops_tu104.c index 70129058f..0ec92ae32 100644 --- a/drivers/gpu/nvgpu/os/linux/os_ops_tu104.c +++ b/drivers/gpu/nvgpu/os/linux/os_ops_tu104.c @@ -1,20 +1,8 @@ -/* - * Copyright (c) 2018-2019, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include "os/linux/os_linux.h" +#include "os/linux/os_ops_tu104.h" #include "os/linux/debug_therm_tu104.h" #include "os/linux/debug_clk_tu104.h" diff --git a/drivers/gpu/nvgpu/os/linux/pci.c b/drivers/gpu/nvgpu/os/linux/pci.c index 6fed5b28c..aee2293e0 100644 --- a/drivers/gpu/nvgpu/os/linux/pci.c +++ b/drivers/gpu/nvgpu/os/linux/pci.c @@ -1,18 +1,5 @@ -/* - * Copyright (c) 2016-2023, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2016-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include @@ -885,7 +872,7 @@ static void nvgpu_pci_remove(struct pci_dev *pdev) nvgpu_put(g); } -void nvgpu_pci_shutdown(struct pci_dev *pdev) +static void nvgpu_pci_shutdown(struct pci_dev *pdev) { struct gk20a *g = get_gk20a(&pdev->dev); struct device *dev = dev_from_gk20a(g); diff --git a/drivers/gpu/nvgpu/os/linux/platform_ga10b_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_ga10b_tegra.c index cb0c75d56..8f1d2358a 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_ga10b_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_ga10b_tegra.c @@ -1,19 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2016-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + /* * GA10B Tegra Platform Interface - * - * Copyright (c) 2016-2023, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . */ #include @@ -234,7 +223,7 @@ static int ga10b_tegra_get_clocks(struct device *dev) ARRAY_SIZE(tegra_ga10b_clocks)); } -void ga10b_tegra_scale_init(struct device *dev) +static void ga10b_tegra_scale_init(struct device *dev) { #if defined(CONFIG_INTERCONNECT) struct gk20a_platform *platform = gk20a_get_platform(dev); @@ -355,7 +344,7 @@ static int ga10b_tegra_remove(struct device *dev) } #if defined(CONFIG_TEGRA_BPMP) && defined(CONFIG_NVGPU_STATIC_POWERGATE) -int ga10b_tegra_static_pg_control(struct device *dev, struct tegra_bpmp *bpmp, +static int ga10b_tegra_static_pg_control(struct device *dev, struct tegra_bpmp *bpmp, struct mrq_strap_request *req) { struct tegra_bpmp_message msg; @@ -590,7 +579,7 @@ static int ga10b_tegra_set_fbp_pg_mask(struct device *dev, u32 dt_fbp_pg_mask) return -EINVAL; } -void ga10b_tegra_postscale(struct device *pdev, +static void ga10b_tegra_postscale(struct device *pdev, unsigned long freq) { #if defined(CONFIG_INTERCONNECT) diff --git a/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c index de6ac5b78..3ad53e4ff 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c @@ -1,16 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2014-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + /* * GK20A Tegra Platform Interface - * - * Copyright (c) 2014-2022, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. */ #include @@ -73,6 +65,7 @@ #include "scale.h" #include "platform_gk20a.h" +#include "platform_gk20a_tegra.h" #include "clk.h" #include "os_linux.h" diff --git a/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c index 94f5fab56..eacd5e02a 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c @@ -1,19 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2016-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + /* * GV11B Tegra Platform Interface - * - * Copyright (c) 2016-2022, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . */ #include @@ -44,7 +33,7 @@ #define EMC3D_GV11B_RATIO 500 -void gv11b_tegra_scale_init(struct device *dev) +static void gv11b_tegra_scale_init(struct device *dev) { #ifdef CONFIG_TEGRA_BWMGR struct gk20a_platform *platform = gk20a_get_platform(dev); diff --git a/drivers/gpu/nvgpu/os/linux/swprofile_debugfs.c b/drivers/gpu/nvgpu/os/linux/swprofile_debugfs.c index 48df33c19..ceae77e3f 100644 --- a/drivers/gpu/nvgpu/os/linux/swprofile_debugfs.c +++ b/drivers/gpu/nvgpu/os/linux/swprofile_debugfs.c @@ -1,22 +1,11 @@ -/* - * Copyright (c) 2020-2021, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include +#include "swprofile_debugfs.h" + #include #include diff --git a/drivers/gpu/nvgpu/os/linux/sync_sema_dma.c b/drivers/gpu/nvgpu/os/linux/sync_sema_dma.c index c93d0557d..efcc05020 100644 --- a/drivers/gpu/nvgpu/os/linux/sync_sema_dma.c +++ b/drivers/gpu/nvgpu/os/linux/sync_sema_dma.c @@ -1,25 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + /* * Semaphore Sync Framework Integration - * - * Copyright (c) 2020-2022, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . */ #include #include #include "channel.h" +#include "sync_sema_dma.h" #include #include diff --git a/drivers/gpu/nvgpu/os/linux/thread.c b/drivers/gpu/nvgpu/os/linux/thread.c index 3e9af90cc..fde062c1f 100644 --- a/drivers/gpu/nvgpu/os/linux/thread.c +++ b/drivers/gpu/nvgpu/os/linux/thread.c @@ -1,18 +1,5 @@ -/* - * Copyright (c) 2017-2022, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2017-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include @@ -22,7 +9,7 @@ #include #include -int nvgpu_thread_proxy(void *threaddata) +static int nvgpu_thread_proxy(void *threaddata) { struct nvgpu_thread *thread = threaddata; bool was_running; diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.c b/drivers/gpu/nvgpu/os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.c index f6afb3c99..ec9d7077f 100644 --- a/drivers/gpu/nvgpu/os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.c @@ -1,18 +1,5 @@ -/* - * Copyright (c) 2017-2021, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2017-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include @@ -26,6 +13,7 @@ #include "os/linux/os_linux.h" #include "os/linux/vgpu/vgpu_linux.h" #include "os/linux/vgpu/platform_vgpu_tegra.h" +#include "os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.h" int gv11b_vgpu_probe(struct device *dev) { diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c b/drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c index 8dc46f498..ee7b51743 100644 --- a/drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c @@ -1,19 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2014-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + /* * Tegra Virtualized GPU Platform Interface - * - * Copyright (c) 2014-2021, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . */ #include @@ -21,6 +10,7 @@ #include "os/linux/platform_gk20a.h" #include "common/vgpu/clk_vgpu.h" #include "vgpu_linux.h" +#include "platform_vgpu_tegra.h" long vgpu_plat_clk_round_rate(struct device *dev, unsigned long rate) { diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/sysfs_vgpu.c b/drivers/gpu/nvgpu/os/linux/vgpu/sysfs_vgpu.c index 0cb2025a5..d70776674 100644 --- a/drivers/gpu/nvgpu/os/linux/vgpu/sysfs_vgpu.c +++ b/drivers/gpu/nvgpu/os/linux/vgpu/sysfs_vgpu.c @@ -1,18 +1,5 @@ -/* - * Copyright (c) 2017-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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2017-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include @@ -21,6 +8,7 @@ #include "os/linux/os_linux.h" #include "common/vgpu/ecc_vgpu.h" #include "common/vgpu/ivc/comm_vgpu.h" +#include "vgpu_linux.h" static ssize_t vgpu_load_show(struct device *dev, struct device_attribute *attr, diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/vf_linux.c b/drivers/gpu/nvgpu/os/linux/vgpu/vf_linux.c index 21844da1b..d373b1b2e 100644 --- a/drivers/gpu/nvgpu/os/linux/vgpu/vf_linux.c +++ b/drivers/gpu/nvgpu/os/linux/vgpu/vf_linux.c @@ -1,18 +1,5 @@ -/* - * Copyright (c) 2023, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include @@ -23,6 +10,7 @@ #include "os/linux/os_linux.h" #include "os/linux/platform_gk20a.h" #include "os/linux/vgpu/vgpu_common.h" +#include "vf_linux.h" static irqreturn_t vf_isr(int irq, void *dev_id) { @@ -160,4 +148,4 @@ int vf_probe(struct pci_dev *pdev, struct gk20a_platform *platform) g->probe_done = true; return 0; -} \ No newline at end of file +} diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_ivc.c b/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_ivc.c index 1457dbadc..4589dac6f 100644 --- a/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_ivc.c +++ b/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_ivc.c @@ -1,20 +1,8 @@ -/* - * Copyright (c) 2018-2023, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include +#include #include #include "os/linux/os_linux.h" diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c b/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c index 61023cdb0..4139089a2 100644 --- a/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c +++ b/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c @@ -1,19 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + /* * Virtualized GPU for Linux - * - * Copyright (c) 2018-2023, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . */ #include @@ -24,6 +13,7 @@ #include #include +#include #include "vgpu_linux.h" #include "common/vgpu/ivc/comm_vgpu.h"