mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
net: nvethernet: Fix build for Linux v6.15
In Linux v6,15, a 'speed' argument was added to the phy_loopback() function. Add a conftest test to detect this change and update the nvethernet driver accordingly. Note that if 'speed' is set to 0 when calling phy_loopback(), then phy_loopback() behaves the same way as it did before this argument was added. So by default set speed to 0 for the nvethernet driver. JIRA LINQPJ14-47 Change-Id: I55f775e672bfa1a00c9ccbd825c82be1868b0b52 Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330685 (cherry picked from commit 5ba2674826bc9e39b320fd79afd7d52709a39eca) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499758 Tested-by: Brad Griffis <bgriffis@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
13ad68519d
commit
8e9d8552c3
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2019-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved */
|
||||
// SPDX-FileCopyrightText: Copyright (c) 2019-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved
|
||||
|
||||
#ifndef OSI_STRIPPED_LIB
|
||||
#include "ether_linux.h"
|
||||
@@ -290,7 +290,11 @@ static int ether_test_phy_loopback(struct ether_priv_data *pdata)
|
||||
if (!pdata->phydev)
|
||||
return -ENODEV;
|
||||
|
||||
#if defined(NV_PHY_LOOPBACK_HAS_SPEED_ARG) /* Linux v6.15 */
|
||||
ret = phy_loopback(pdata->phydev, true, 0);
|
||||
#else
|
||||
ret = phy_loopback(pdata->phydev, true);
|
||||
#endif
|
||||
if (ret != 0 && ret != -EBUSY)
|
||||
return ret;
|
||||
|
||||
@@ -406,7 +410,11 @@ void ether_selftest_run(struct net_device *dev,
|
||||
case ETHER_LOOPBACK_PHY:
|
||||
ret = -EOPNOTSUPP;
|
||||
if (dev->phydev)
|
||||
#if defined(NV_PHY_LOOPBACK_HAS_SPEED_ARG) /* Linux v6.15 */
|
||||
ret = phy_loopback(dev->phydev, true, 0);
|
||||
#else
|
||||
ret = phy_loopback(dev->phydev, true);
|
||||
#endif
|
||||
if (!ret)
|
||||
break;
|
||||
/* Fallthrough */
|
||||
@@ -439,7 +447,11 @@ void ether_selftest_run(struct net_device *dev,
|
||||
case ETHER_LOOPBACK_PHY:
|
||||
ret = -EOPNOTSUPP;
|
||||
if (dev->phydev)
|
||||
#if defined(NV_PHY_LOOPBACK_HAS_SPEED_ARG) /* Linux v6.15 */
|
||||
ret = phy_loopback(dev->phydev, false, 0);
|
||||
#else
|
||||
ret = phy_loopback(dev->phydev, false);
|
||||
#endif
|
||||
if (!ret)
|
||||
break;
|
||||
/* Fallthrough */
|
||||
|
||||
@@ -173,6 +173,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epc_event_ops_struct_has_core_deinit
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epc_event_ops_struct_has_epc_deinit
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epc_event_ops_struct_has_epc_init
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epc_irq_type_enum_present
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += phy_loopback_has_speed_arg
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += platform_driver_struct_remove_returns_void
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += register_shrinker_has_fmt_arg
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += shrinker_alloc
|
||||
|
||||
@@ -7903,6 +7903,23 @@ compile_test() {
|
||||
compile_check_conftest "$CODE" "NV_PCI_EPC_EVENT_OPS_STRUCT_HAS_EPC_INIT" "" "types"
|
||||
;;
|
||||
|
||||
phy_loopback_has_speed_arg)
|
||||
#
|
||||
# Determine if phy_loopback() has 'speed' argument.
|
||||
#
|
||||
# Commit 0d60fd50328a ("net: phy: Support speed selection for PHY
|
||||
# loopback") add a 'speed' argument to phy_loopback() in Linux
|
||||
# v6.15.
|
||||
#
|
||||
CODE="
|
||||
#include <linux/phy.h>
|
||||
int conftest_phy_loopback_has_speed_arg(struct phy_device *phydev) {
|
||||
return phy_loopback(phydev, true, 0);
|
||||
}"
|
||||
|
||||
compile_check_conftest "$CODE" "NV_PHY_LOOPBACK_HAS_SPEED_ARG" "" "types"
|
||||
;;
|
||||
|
||||
platform_driver_struct_remove_returns_void)
|
||||
#
|
||||
# Determine if the 'platform_driver' structure 'remove' function
|
||||
|
||||
Reference in New Issue
Block a user