From 8a10ebd74082c484fca588d3c7fae77be257b923 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Tue, 1 Oct 2024 15:20:08 +0100 Subject: [PATCH] drivers: Fix build for Linux v6.12 In Linux v6.12 the definition 'no_llseek' was finally removed. Since Linux v6.0 it had been redefined as NULL. Add a test to conftest to determine if 'no_llseek' is present and if not then it is no longer necessary to populate this and we can leave as NULL. Bug 4876974 Change-Id: I051fdb285b32260b5913dad89cabe0be04253f67 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3222106 (cherry picked from commit 7bf81a5b445b01a2adc8b947a29e9ca7db325c6f) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3270383 Reviewed-by: svcacv Reviewed-by: Brad Griffis GVS: buildbot_gerritrpt --- .../camera/fusa-capture/capture-isp-channel.c | 6 ++++-- .../camera/fusa-capture/capture-vi-channel.c | 2 ++ drivers/misc/nvsciipc/nvsciipc.c | 2 ++ drivers/platform/tegra/rtcpu/camchar.c | 6 ++++-- drivers/video/tegra/host/nvcsi/nvcsi-t194.c | 2 ++ drivers/video/tegra/host/nvcsi/nvcsi.c | 7 ++++++- drivers/video/tegra/host/nvdla/nvdla_ioctl.c | 7 +++++-- drivers/video/tegra/host/pva/pva_ioctl.c | 8 +++++--- drivers/virt/tegra/tegra_hv_pm_ctl.c | 2 ++ scripts/conftest/Makefile | 1 + scripts/conftest/conftest.sh | 19 +++++++++++++++++++ 11 files changed, 52 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/tegra/camera/fusa-capture/capture-isp-channel.c b/drivers/media/platform/tegra/camera/fusa-capture/capture-isp-channel.c index b6ef7b53..88828485 100644 --- a/drivers/media/platform/tegra/camera/fusa-capture/capture-isp-channel.c +++ b/drivers/media/platform/tegra/camera/fusa-capture/capture-isp-channel.c @@ -1,5 +1,5 @@ -// SPDX-License-Identifier: GPL-2.0 -// Copyright (c) 2017-2023 NVIDIA Corporation. All rights reserved. +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2017-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. /** * @file drivers/media/platform/tegra/camera/fusa-capture/capture-isp-channel.c @@ -523,7 +523,9 @@ static long isp_channel_ioctl( static const struct file_operations isp_channel_fops = { .owner = THIS_MODULE, +#if defined(NV_NO_LLSEEK_PRESENT) .llseek = no_llseek, +#endif .unlocked_ioctl = isp_channel_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = isp_channel_ioctl, diff --git a/drivers/media/platform/tegra/camera/fusa-capture/capture-vi-channel.c b/drivers/media/platform/tegra/camera/fusa-capture/capture-vi-channel.c index 0ab7be1d..afae3172 100644 --- a/drivers/media/platform/tegra/camera/fusa-capture/capture-vi-channel.c +++ b/drivers/media/platform/tegra/camera/fusa-capture/capture-vi-channel.c @@ -616,7 +616,9 @@ static long vi_channel_ioctl( static const struct file_operations vi_channel_fops = { .owner = THIS_MODULE, +#if defined(NV_NO_LLSEEK_PRESENT) .llseek = no_llseek, +#endif .unlocked_ioctl = vi_channel_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = vi_channel_ioctl, diff --git a/drivers/misc/nvsciipc/nvsciipc.c b/drivers/misc/nvsciipc/nvsciipc.c index 7ad5de41..0d491376 100644 --- a/drivers/misc/nvsciipc/nvsciipc.c +++ b/drivers/misc/nvsciipc/nvsciipc.c @@ -685,7 +685,9 @@ static const struct file_operations nvsciipc_fops = { .open = nvsciipc_dev_open, .release = nvsciipc_dev_release, .unlocked_ioctl = nvsciipc_dev_ioctl, +#if defined(NV_NO_LLSEEK_PRESENT) .llseek = no_llseek, +#endif .read = nvsciipc_dbg_read, }; diff --git a/drivers/platform/tegra/rtcpu/camchar.c b/drivers/platform/tegra/rtcpu/camchar.c index c271f19d..67fd36e7 100644 --- a/drivers/platform/tegra/rtcpu/camchar.c +++ b/drivers/platform/tegra/rtcpu/camchar.c @@ -1,5 +1,5 @@ -// SPDX-License-Identifier: GPL-2.0 -// Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include @@ -226,7 +226,9 @@ static const struct file_operations tegra_camchar_fops = { .release = tegra_camchar_release, .unlocked_ioctl = tegra_camchar_ioctl, .compat_ioctl = tegra_camchar_ioctl, +#if defined(NV_NO_LLSEEK_PRESENT) .llseek = no_llseek, +#endif }; static int __init tegra_camchar_init(struct tegra_ivc_driver *drv) diff --git a/drivers/video/tegra/host/nvcsi/nvcsi-t194.c b/drivers/video/tegra/host/nvcsi/nvcsi-t194.c index 75f6dc05..77af2ba0 100644 --- a/drivers/video/tegra/host/nvcsi/nvcsi-t194.c +++ b/drivers/video/tegra/host/nvcsi/nvcsi-t194.c @@ -110,7 +110,9 @@ static int t194_nvcsi_release(struct inode *inode, struct file *file) const struct file_operations tegra194_nvcsi_ctrl_ops = { .owner = THIS_MODULE, +#if defined(NV_NO_LLSEEK_PRESENT) .llseek = no_llseek, +#endif .unlocked_ioctl = t194_nvcsi_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = t194_nvcsi_ioctl, diff --git a/drivers/video/tegra/host/nvcsi/nvcsi.c b/drivers/video/tegra/host/nvcsi/nvcsi.c index 2cc96809..4a2e326d 100644 --- a/drivers/video/tegra/host/nvcsi/nvcsi.c +++ b/drivers/video/tegra/host/nvcsi/nvcsi.c @@ -1,8 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-only -// SPDX-FileCopyrightText: Copyright (c) 2014-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-FileCopyrightText: Copyright (c) 2014-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. /* * NVCSI driver */ + +#include + #include #include #include @@ -129,7 +132,9 @@ static int nvcsi_release(struct inode *inode, struct file *file) const struct file_operations tegra_nvcsi_ctrl_ops = { .owner = THIS_MODULE, +#if defined(NV_NO_LLSEEK_PRESENT) .llseek = no_llseek, +#endif .unlocked_ioctl = nvcsi_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = nvcsi_ioctl, diff --git a/drivers/video/tegra/host/nvdla/nvdla_ioctl.c b/drivers/video/tegra/host/nvdla/nvdla_ioctl.c index 1ab08669..1459e4e2 100644 --- a/drivers/video/tegra/host/nvdla/nvdla_ioctl.c +++ b/drivers/video/tegra/host/nvdla/nvdla_ioctl.c @@ -1,10 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2016-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. /* - * Copyright (c) 2016-2023, NVIDIA Corporation. All rights reserved. - * * NVDLA IOCTL for T194 */ +#include + #include #include #include @@ -1329,7 +1330,9 @@ static int nvdla_release(struct inode *inode, struct file *file) const struct file_operations tegra_nvdla_ctrl_ops = { .owner = THIS_MODULE, +#if defined(NV_NO_LLSEEK_PRESENT) .llseek = no_llseek, +#endif .unlocked_ioctl = nvdla_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = nvdla_ioctl, diff --git a/drivers/video/tegra/host/pva/pva_ioctl.c b/drivers/video/tegra/host/pva/pva_ioctl.c index 62f1f75c..4b3cc396 100644 --- a/drivers/video/tegra/host/pva/pva_ioctl.c +++ b/drivers/video/tegra/host/pva/pva_ioctl.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (c) 2016-2023, NVIDIA CORPORATION. All rights reserved. - */ +// SPDX-FileCopyrightText: Copyright (c) 2016-2024, NVIDIA CORPORATION. All rights reserved. + +#include #include #include @@ -1134,7 +1134,9 @@ static ssize_t pva_read_vpu_print_buffer(struct file *file, const struct file_operations tegra_pva_ctrl_ops = { .owner = THIS_MODULE, +#if defined(NV_NO_LLSEEK_PRESENT) .llseek = no_llseek, +#endif .unlocked_ioctl = pva_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = pva_ioctl, diff --git a/drivers/virt/tegra/tegra_hv_pm_ctl.c b/drivers/virt/tegra/tegra_hv_pm_ctl.c index 6e493c12..92deb603 100644 --- a/drivers/virt/tegra/tegra_hv_pm_ctl.c +++ b/drivers/virt/tegra/tegra_hv_pm_ctl.c @@ -389,7 +389,9 @@ static int tegra_hv_pm_ctl_release(struct inode *inode, struct file *filp) static const struct file_operations tegra_hv_pm_ctl_fops = { .owner = THIS_MODULE, +#if defined(NV_NO_LLSEEK_PRESENT) .llseek = no_llseek, +#endif .read = tegra_hv_pm_ctl_read, .write = tegra_hv_pm_ctl_write, .poll = tegra_hv_pm_ctl_poll, diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 1a0c2195..0ce8355c 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -142,6 +142,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += mii_bus_struct_has_read_c45 NV_CONFTEST_FUNCTION_COMPILE_TESTS += mii_bus_struct_has_write_c45 NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_set_tso_max_size NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_napi_add_weight +NV_CONFTEST_FUNCTION_COMPILE_TESTS += no_llseek NV_CONFTEST_FUNCTION_COMPILE_TESTS += of_get_named_gpio_flags NV_CONFTEST_FUNCTION_COMPILE_TESTS += gpio_chip_struct_has_of_node_present NV_CONFTEST_FUNCTION_COMPILE_TESTS += gpio_device_find diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index 707f3906..2631119c 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -7462,6 +7462,25 @@ compile_test() { compile_check_conftest "$CODE" "NV_MII_BUS_STRUCT_HAS_WRITE_C45" "" "types" ;; + no_llseek) + # + # Determine if the function no_llseek() is present. + # + # Commit cb787f4ac0c2 ("[tree-wide] finally take no_llseek out") + # removed the definition for no_llseek() in Linux v6.12-rc1. Note + # that commit 868941b14441 ("fs: remove no_llseek") in Linux v6.0 + # had previously redefined no_llseek as NULL in preparation for + # its removal. + # + CODE=" + #include + void conftest_no_llseek(void) { + no_llseek(); + }" + + compile_check_conftest "$CODE" "NV_NO_LLSEEK_PRESENT" "" "functions" + ;; + of_property_for_each_u32_removed_internal_args) # # Determine if the internal arguments for the macro