]> git.baikalelectronics.ru Git - kernel.git/commitdiff
amd-xgbe: Yellow carp devices do not need rrc
authorRaju Rangoju <Raju.Rangoju@amd.com>
Thu, 20 Oct 2022 06:42:11 +0000 (12:12 +0530)
committerJakub Kicinski <kuba@kernel.org>
Sat, 22 Oct 2022 05:40:21 +0000 (22:40 -0700)
Link stability issues are noticed on Yellow carp platforms when Receiver
Reset Cycle is issued. Since the CDR workaround is disabled on these
platforms, the Receiver Reset Cycle is not needed.

So, avoid issuing rrc on Yellow carp platforms.

Fixes: a8aa3f24e13e ("net: amd-xgbe: Add Support for Yellow Carp Ethernet device")
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/amd/xgbe/xgbe-pci.c
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
drivers/net/ethernet/amd/xgbe/xgbe.h

index 2af3da4b2d05355717e42ee89b21dff9047f04e8..f409d7bd1f1eed496101083ee9ff64e9347422ec 100644 (file)
@@ -285,6 +285,9 @@ static int xgbe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
                /* Yellow Carp devices do not need cdr workaround */
                pdata->vdata->an_cdr_workaround = 0;
+
+               /* Yellow Carp devices do not need rrc */
+               pdata->vdata->enable_rrc = 0;
        } else {
                pdata->xpcs_window_def_reg = PCS_V2_WINDOW_DEF;
                pdata->xpcs_window_sel_reg = PCS_V2_WINDOW_SELECT;
@@ -483,6 +486,7 @@ static struct xgbe_version_data xgbe_v2a = {
        .tx_desc_prefetch               = 5,
        .rx_desc_prefetch               = 5,
        .an_cdr_workaround              = 1,
+       .enable_rrc                     = 1,
 };
 
 static struct xgbe_version_data xgbe_v2b = {
@@ -498,6 +502,7 @@ static struct xgbe_version_data xgbe_v2b = {
        .tx_desc_prefetch               = 5,
        .rx_desc_prefetch               = 5,
        .an_cdr_workaround              = 1,
+       .enable_rrc                     = 1,
 };
 
 static const struct pci_device_id xgbe_pci_table[] = {
index 2156600641b6c60abbc876746b0cb114f9e14fb2..19b943eba560ea6341a98e9f02773d1ffb7ff33b 100644 (file)
@@ -2640,7 +2640,7 @@ static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart)
        }
 
        /* No link, attempt a receiver reset cycle */
-       if (phy_data->rrc_count++ > XGBE_RRC_FREQUENCY) {
+       if (pdata->vdata->enable_rrc && phy_data->rrc_count++ > XGBE_RRC_FREQUENCY) {
                phy_data->rrc_count = 0;
                xgbe_phy_rrc(pdata);
        }
index b875c430222e5811f1e0ba74a143d356cb523f48..49d23abce73d2273d642437208dd81bc21fb206f 100644 (file)
@@ -1013,6 +1013,7 @@ struct xgbe_version_data {
        unsigned int tx_desc_prefetch;
        unsigned int rx_desc_prefetch;
        unsigned int an_cdr_workaround;
+       unsigned int enable_rrc;
 };
 
 struct xgbe_prv_data {