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 <jonathanh@nvidia.com>
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 <svcacv@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2024-10-01 15:20:08 +01:00
committed by mobile promotions
parent aef3f30099
commit 8a10ebd740
11 changed files with 52 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0-only
// Copyright (c) 2017-2023 NVIDIA Corporation. All rights reserved. // SPDX-FileCopyrightText: Copyright (c) 2017-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
/** /**
* @file drivers/media/platform/tegra/camera/fusa-capture/capture-isp-channel.c * @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 = { static const struct file_operations isp_channel_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
#if defined(NV_NO_LLSEEK_PRESENT)
.llseek = no_llseek, .llseek = no_llseek,
#endif
.unlocked_ioctl = isp_channel_ioctl, .unlocked_ioctl = isp_channel_ioctl,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = isp_channel_ioctl, .compat_ioctl = isp_channel_ioctl,

View File

@@ -616,7 +616,9 @@ static long vi_channel_ioctl(
static const struct file_operations vi_channel_fops = { static const struct file_operations vi_channel_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
#if defined(NV_NO_LLSEEK_PRESENT)
.llseek = no_llseek, .llseek = no_llseek,
#endif
.unlocked_ioctl = vi_channel_ioctl, .unlocked_ioctl = vi_channel_ioctl,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = vi_channel_ioctl, .compat_ioctl = vi_channel_ioctl,

View File

@@ -685,7 +685,9 @@ static const struct file_operations nvsciipc_fops = {
.open = nvsciipc_dev_open, .open = nvsciipc_dev_open,
.release = nvsciipc_dev_release, .release = nvsciipc_dev_release,
.unlocked_ioctl = nvsciipc_dev_ioctl, .unlocked_ioctl = nvsciipc_dev_ioctl,
#if defined(NV_NO_LLSEEK_PRESENT)
.llseek = no_llseek, .llseek = no_llseek,
#endif
.read = nvsciipc_dbg_read, .read = nvsciipc_dbg_read,
}; };

View File

@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0-only
// Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#include <nvidia/conftest.h> #include <nvidia/conftest.h>
@@ -226,7 +226,9 @@ static const struct file_operations tegra_camchar_fops = {
.release = tegra_camchar_release, .release = tegra_camchar_release,
.unlocked_ioctl = tegra_camchar_ioctl, .unlocked_ioctl = tegra_camchar_ioctl,
.compat_ioctl = tegra_camchar_ioctl, .compat_ioctl = tegra_camchar_ioctl,
#if defined(NV_NO_LLSEEK_PRESENT)
.llseek = no_llseek, .llseek = no_llseek,
#endif
}; };
static int __init tegra_camchar_init(struct tegra_ivc_driver *drv) static int __init tegra_camchar_init(struct tegra_ivc_driver *drv)

View File

@@ -110,7 +110,9 @@ static int t194_nvcsi_release(struct inode *inode, struct file *file)
const struct file_operations tegra194_nvcsi_ctrl_ops = { const struct file_operations tegra194_nvcsi_ctrl_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
#if defined(NV_NO_LLSEEK_PRESENT)
.llseek = no_llseek, .llseek = no_llseek,
#endif
.unlocked_ioctl = t194_nvcsi_ioctl, .unlocked_ioctl = t194_nvcsi_ioctl,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = t194_nvcsi_ioctl, .compat_ioctl = t194_nvcsi_ioctl,

View File

@@ -1,8 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only // 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 * NVCSI driver
*/ */
#include <nvidia/conftest.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/module.h> #include <linux/module.h>
@@ -129,7 +132,9 @@ static int nvcsi_release(struct inode *inode, struct file *file)
const struct file_operations tegra_nvcsi_ctrl_ops = { const struct file_operations tegra_nvcsi_ctrl_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
#if defined(NV_NO_LLSEEK_PRESENT)
.llseek = no_llseek, .llseek = no_llseek,
#endif
.unlocked_ioctl = nvcsi_ioctl, .unlocked_ioctl = nvcsi_ioctl,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = nvcsi_ioctl, .compat_ioctl = nvcsi_ioctl,

View File

@@ -1,10 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only // 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 * NVDLA IOCTL for T194
*/ */
#include <nvidia/conftest.h>
#include <linux/arm64-barrier.h> #include <linux/arm64-barrier.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
@@ -1329,7 +1330,9 @@ static int nvdla_release(struct inode *inode, struct file *file)
const struct file_operations tegra_nvdla_ctrl_ops = { const struct file_operations tegra_nvdla_ctrl_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
#if defined(NV_NO_LLSEEK_PRESENT)
.llseek = no_llseek, .llseek = no_llseek,
#endif
.unlocked_ioctl = nvdla_ioctl, .unlocked_ioctl = nvdla_ioctl,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = nvdla_ioctl, .compat_ioctl = nvdla_ioctl,

View File

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
/* // SPDX-FileCopyrightText: Copyright (c) 2016-2024, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2016-2023, NVIDIA CORPORATION. All rights reserved.
*/ #include <nvidia/conftest.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
@@ -1134,7 +1134,9 @@ static ssize_t pva_read_vpu_print_buffer(struct file *file,
const struct file_operations tegra_pva_ctrl_ops = { const struct file_operations tegra_pva_ctrl_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
#if defined(NV_NO_LLSEEK_PRESENT)
.llseek = no_llseek, .llseek = no_llseek,
#endif
.unlocked_ioctl = pva_ioctl, .unlocked_ioctl = pva_ioctl,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = pva_ioctl, .compat_ioctl = pva_ioctl,

View File

@@ -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 = { static const struct file_operations tegra_hv_pm_ctl_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
#if defined(NV_NO_LLSEEK_PRESENT)
.llseek = no_llseek, .llseek = no_llseek,
#endif
.read = tegra_hv_pm_ctl_read, .read = tegra_hv_pm_ctl_read,
.write = tegra_hv_pm_ctl_write, .write = tegra_hv_pm_ctl_write,
.poll = tegra_hv_pm_ctl_poll, .poll = tegra_hv_pm_ctl_poll,

View File

@@ -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 += mii_bus_struct_has_write_c45
NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_set_tso_max_size NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_set_tso_max_size
NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_napi_add_weight 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 += of_get_named_gpio_flags
NV_CONFTEST_FUNCTION_COMPILE_TESTS += gpio_chip_struct_has_of_node_present NV_CONFTEST_FUNCTION_COMPILE_TESTS += gpio_chip_struct_has_of_node_present
NV_CONFTEST_FUNCTION_COMPILE_TESTS += gpio_device_find NV_CONFTEST_FUNCTION_COMPILE_TESTS += gpio_device_find

View File

@@ -7462,6 +7462,25 @@ compile_test() {
compile_check_conftest "$CODE" "NV_MII_BUS_STRUCT_HAS_WRITE_C45" "" "types" 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 <linux/fs.h>
void conftest_no_llseek(void) {
no_llseek();
}"
compile_check_conftest "$CODE" "NV_NO_LLSEEK_PRESENT" "" "functions"
;;
of_property_for_each_u32_removed_internal_args) of_property_for_each_u32_removed_internal_args)
# #
# Determine if the internal arguments for the macro # Determine if the internal arguments for the macro