public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Raju Rangoju <Raju.Rangoju@amd•com>
To: <thomas.lendacky@amd•com>, <Shyam-sundar.S-k@amd•com>,
	<davem@davemloft•net>, <kuba@kernel•org>
Cc: <netdev@vger•kernel.org>, <rrangoju@amd•com>,
	Raju Rangoju <Raju.Rangoju@amd•com>
Subject: [PATCH net 1/3] amd-xgbe: Yellow carp devices do not need rrc
Date: Thu, 6 Oct 2022 19:24:38 +0530	[thread overview]
Message-ID: <20221006135440.3680563-2-Raju.Rangoju@amd.com> (raw)
In-Reply-To: <20221006135440.3680563-1-Raju.Rangoju@amd.com>

Yellow carp devices disables the CDR workaround path,
receiver reset cycle is not needed in such cases.
Hence, avoid issuing rrc on Yellow carp platforms.

Fixes: 47f164deab22 ("amd-xgbe: Add PCI device support")
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd•com>
---
 drivers/net/ethernet/amd/xgbe/xgbe-pci.c    | 5 +++++
 drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 2 +-
 drivers/net/ethernet/amd/xgbe/xgbe.h        | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-pci.c b/drivers/net/ethernet/amd/xgbe/xgbe-pci.c
index 2af3da4b2d05..f409d7bd1f1e 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-pci.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-pci.c
@@ -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[] = {
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
index 2156600641b6..19b943eba560 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
@@ -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);
 	}
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h
index b875c430222e..49d23abce73d 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe.h
+++ b/drivers/net/ethernet/amd/xgbe/xgbe.h
@@ -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 {
-- 
2.25.1


  reply	other threads:[~2022-10-06 13:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06 13:54 [PATCH net 0/3] amd-xgbe: Miscellaneous fixes Raju Rangoju
2022-10-06 13:54 ` Raju Rangoju [this message]
2022-10-06 14:32   ` [PATCH net 1/3] amd-xgbe: Yellow carp devices do not need rrc Tom Lendacky
2022-10-07  0:26     ` Jakub Kicinski
2022-10-08 18:27       ` Raju Rangoju
2022-10-06 13:54 ` [PATCH net 2/3] amd-xgbe: enable PLL_CTL for fixed PHY modes only Raju Rangoju
2022-10-06 14:47   ` Tom Lendacky
2022-10-06 17:23     ` Raju Rangoju
2022-10-06 13:54 ` [PATCH net 3/3] amd-xgbe: fix the SFP compliance codes check for DAC cables Raju Rangoju
2022-10-06 15:00   ` Tom Lendacky
     [not found]     ` <9a8552c2-0a23-ea1d-9d1c-56b7a6c75487@amd.com>
2022-10-06 19:04       ` Tom Lendacky
     [not found]         ` <77d8ea25-3557-cd6f-f732-20a046b29661@amd.com>
2022-10-07 14:27           ` Tom Lendacky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221006135440.3680563-2-Raju.Rangoju@amd.com \
    --to=raju.rangoju@amd$(echo .)com \
    --cc=Shyam-sundar.S-k@amd$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=kuba@kernel$(echo .)org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=rrangoju@amd$(echo .)com \
    --cc=thomas.lendacky@amd$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox