From 9831027796e157904306abbdc827a0440e29fa02 Mon Sep 17 00:00:00 2001 From: Revanth Kumar Uppala Date: Thu, 16 Oct 2025 11:00:33 +0000 Subject: [PATCH] nvethernet: Support both DT flags to maintain backward compatibility In the previous release for T264 platforms,the restart lane bringup logic was controlled through the device tree flag 'nvidia,pcs-rx-eq-sw-ovrd'. In incremental releases, the flag has been renamed 'nvidia,force-restart-lane-bringup'. To maintain backward compatibility with older device trees, the driver now checks for both flags.If either flag is present, restart lane bringup is executed. The legacy flag 'nvidia,pcs-rx-eq-sw-ovrd' is deprecated. Bug 5017313 Change-Id: I24040f508ef776e29a0bb0c1f07d4a74fa4cc8cc Signed-off-by: Revanth Kumar Uppala Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3471233 Reviewed-by: Srinivas Ramachandran GVS: buildbot_gerritrpt --- .../ethernet/nvidia/nvethernet/ether_linux.c | 17 ++++++++++++----- .../ethernet/nvidia/nvethernet/ether_linux.h | 2 ++ drivers/net/ethernet/nvidia/nvethernet/osd.c | 8 ++++---- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c index c64c9f60..d3bf0eff 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c +++ b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c @@ -7193,12 +7193,19 @@ static int ether_parse_dt(struct ether_priv_data *pdata) osi_core->mdc_cr = def_mdc_cr[osi_core->mac]; } - ret_val = of_property_read_u32(np, "nvidia,pcs-rx-eq-sw-ovrd", &osi_core->pcs_rx_eq_sw_ovrd_en); - if (ret_val < 0 || osi_core->pcs_rx_eq_sw_ovrd_en != OSI_RX_EQ_SW_OVRD) { - dev_info(dev, "failed to read or invalid RX EQ SW override - default to 0\n"); - osi_core->pcs_rx_eq_sw_ovrd_en = 0; + ret_val = of_property_read_u32(np, "nvidia,pcs-rx-eq-sw-ovrd", + &pdata->force_restart_lane_bringup); + if ((ret_val == 0) && (pdata->force_restart_lane_bringup == OSI_ENABLE)) { + pdata->force_restart_lane_bringup = 1; } else { - osi_core->pcs_rx_eq_sw_ovrd_en = 1; + ret_val = of_property_read_u32(np, "nvidia,force-restart-lane-bringup", + &pdata->force_restart_lane_bringup); + if ((ret_val == 0) && (pdata->force_restart_lane_bringup == OSI_ENABLE)) { + pdata->force_restart_lane_bringup = 1; + } else { + dev_info(dev, "failed to read or invalid force-restart-lane-bringup - default to 0\n"); + pdata->force_restart_lane_bringup = 0; + } } exit: diff --git a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h index 41b6b584..92e94aa2 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h +++ b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h @@ -759,6 +759,8 @@ struct ether_priv_data { u32 coe_enable; /** OSI instance of COE */ struct osi_mgbe_coe mgbe_coe; + /** Flag to retry restart_lane_bringup logic */ + u32 force_restart_lane_bringup; }; /** diff --git a/drivers/net/ethernet/nvidia/nvethernet/osd.c b/drivers/net/ethernet/nvidia/nvethernet/osd.c index 7ecc872b..11fbdf19 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/osd.c +++ b/drivers/net/ethernet/nvidia/nvethernet/osd.c @@ -875,15 +875,15 @@ static void osd_core_printf(struct osi_core_priv_data *osi_core, void ether_restart_lane_bringup_task(struct tasklet_struct *t) { struct ether_priv_data *pdata = from_tasklet(pdata, t, lane_restart_task); - struct osi_core_priv_data *osi_core = pdata->osi_core; if (pdata->osi_core->mac == OSI_MAC_HW_MGBE_T26X) { /** - * Don't skip restart_lane_bringup_task for Jedha platform - * as this has fixed link and lane bringup has to be executed every time + * Force restart_lane_bringup_task for the platforms + * that has force-restart-lane-bringup flag in their DT. + * And lane bringup will gets executed every time * on link change at link partner side. */ - if (!osi_core->pcs_rx_eq_sw_ovrd_en) { + if (pdata->force_restart_lane_bringup == OSI_DISABLE) { netdev_info(pdata->ndev, "Ignoring restart_lane_bringup_task!!!\n"); return; }