soc/tegra: bpmp: Fix build for Linux v6.9

In Linux v6.9-rc1, the typedef genpd_xlate_t was updated to make
'of_phandle_args' argument const. Add a test to the conftest script to
test if this argument is const and update the BPMP powergate driver
accordingly.

Bug 4471899

Change-Id: I85ddb3689ccf5dc769cd208575db69a2cf7b0a11
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3103819
(cherry picked from commit 9c180ac0c8)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3104378
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2024-03-22 22:17:38 +00:00
committed by mobile promotions
parent 6969153c7c
commit 1a5be9188a
3 changed files with 28 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*/
// SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#include <nvidia/conftest.h>
#include <linux/of.h>
#include <linux/platform_device.h>
@@ -305,7 +305,11 @@ static void tegra_bpmp_remove_powergates(struct tegra_bpmp *bpmp)
}
static struct generic_pm_domain *
#if defined(NV_GENDPD_XLATE_T_HAS_CONST_OF_PHANDLE_ARGS)
tegra_powergate_xlate(const struct of_phandle_args *spec, void *data)
#else
tegra_powergate_xlate(struct of_phandle_args *spec, void *data)
#endif
{
struct generic_pm_domain *domain = ERR_PTR(-ENOENT);
struct genpd_onecell_data *genpd = data;

View File

@@ -118,6 +118,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_scdc_get_set_has_struct_drm_connector_
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ethtool_ops_get_set_coalesce_has_coal_and_extack_args
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ethtool_ops_get_set_ringparam_has_ringparam_and_extack_args
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ethtool_ops_get_set_rxfh_has_rxfh_param_args
NV_CONFTEST_FUNCTION_COMPILE_TESTS += genpd_xlate_t_has_const_of_phandle_args
NV_CONFTEST_FUNCTION_COMPILE_TESTS += get_file_rcu_has_double_ptr_file_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += get_user_pages
NV_CONFTEST_FUNCTION_COMPILE_TESTS += i2c_driver_struct_probe_without_i2c_device_id_arg

View File

@@ -7042,6 +7042,26 @@ compile_test() {
"NV_ETHTOOL_OPS_GET_SET_RXFH_HAS_RXFH_PARAM_ARGS" "" "types"
;;
genpd_xlate_t_has_const_of_phandle_args)
#
# Determine if genpd_xlate_t function pointer has a
# 'const struct of_phandle_args' argument.
#
# Commit 4d0824608a63 ("pmdomain: core: constify of_phandle_args in xlate")
# updated the typedef of genpd_xlate_t to make of_phandle_args argument const.
#
CODE="
#include <linux/pm_domain.h>
void conftest_genpd_xlate_t_has_const_of_phandle_args(struct genpd_onecell_data *gpd,
const struct of_phandle_args *args,
void *data)
{
gpd->xlate(args, data);
}"
compile_check_conftest "$CODE" "NV_GENDPD_XLATE_T_HAS_CONST_OF_PHANDLE_ARGS" "" "types"
;;
netif_set_tso_max_size)
#
# Determine if netif_set_tso_max_size() function is present