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>, <Rajesh1.Kumar@amd.com>,
Raju Rangoju <Raju.Rangoju@amd.com>
Subject: [PATCH v3 net 4/5] amd-xgbe: fix the SFP compliance codes check for DAC cables
Date: Thu, 20 Oct 2022 12:12:14 +0530 [thread overview]
Message-ID: <20221020064215.2341278-5-Raju.Rangoju@amd.com> (raw)
In-Reply-To: <20221020064215.2341278-1-Raju.Rangoju@amd.com>
The current XGBE code assumes that offset 6 of EEPROM SFP DAC (passive)
cables is NULL. However, some cables (the 5 meter and 7 meter Molex
passive cables) have non-zero data at offset 6. Fix the logic by moving
the passive cable check above the active checks, so as not to be
improperly identified as an active cable. This will fix the issue for
any passive cable that advertises 1000Base-CX in offset 6.
Fixes: abf0a1c2b26a ("amd-xgbe: Add support for SFP+ modules")
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
---
Changes since v1:
- Split the changes into two patches. The next patch contains the
Vendor specific quirk.
- Add a vendor check for Molex cables before assigning bit rate ceiling
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
index 349ba0dc1fa2..8c41ac5676d6 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
@@ -1151,7 +1151,10 @@ static void xgbe_phy_sfp_parse_eeprom(struct xgbe_prv_data *pdata)
}
/* Determine the type of SFP */
- if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_SR)
+ if (phy_data->sfp_cable == XGBE_SFP_CABLE_PASSIVE &&
+ xgbe_phy_sfp_bit_rate(sfp_eeprom, XGBE_SFP_SPEED_10000))
+ phy_data->sfp_base = XGBE_SFP_BASE_10000_CR;
+ else if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_SR)
phy_data->sfp_base = XGBE_SFP_BASE_10000_SR;
else if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_LR)
phy_data->sfp_base = XGBE_SFP_BASE_10000_LR;
@@ -1167,9 +1170,6 @@ static void xgbe_phy_sfp_parse_eeprom(struct xgbe_prv_data *pdata)
phy_data->sfp_base = XGBE_SFP_BASE_1000_CX;
else if (sfp_base[XGBE_SFP_BASE_1GBE_CC] & XGBE_SFP_BASE_1GBE_CC_T)
phy_data->sfp_base = XGBE_SFP_BASE_1000_T;
- else if ((phy_data->sfp_cable == XGBE_SFP_CABLE_PASSIVE) &&
- xgbe_phy_sfp_bit_rate(sfp_eeprom, XGBE_SFP_SPEED_10000))
- phy_data->sfp_base = XGBE_SFP_BASE_10000_CR;
switch (phy_data->sfp_base) {
case XGBE_SFP_BASE_1000_T:
--
2.25.1
next prev parent reply other threads:[~2022-10-20 6:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-20 6:42 [PATCH v3 net 0/5] amd-xgbe: Miscellaneous fixes Raju Rangoju
2022-10-20 6:42 ` [PATCH v3 net 1/5] amd-xgbe: Yellow carp devices do not need rrc Raju Rangoju
2022-10-21 4:46 ` Jakub Kicinski
2022-10-21 13:40 ` Tom Lendacky
2022-10-20 6:42 ` [PATCH v3 net 2/5] amd-xgbe: use enums for mailbox cmd and sub_cmds Raju Rangoju
2022-10-20 6:42 ` [PATCH v3 net 3/5] amd-xgbe: enable PLL_CTL for fixed PHY modes only Raju Rangoju
2022-10-20 6:42 ` Raju Rangoju [this message]
2022-10-20 6:42 ` [PATCH v3 net 5/5] amd-xgbe: add the bit rate quirk for Molex cables Raju Rangoju
2022-10-20 17:33 ` [PATCH v3 net 0/5] amd-xgbe: Miscellaneous fixes Tom Lendacky
2022-10-22 5:50 ` patchwork-bot+netdevbpf
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=20221020064215.2341278-5-Raju.Rangoju@amd.com \
--to=raju.rangoju@amd.com \
--cc=Rajesh1.Kumar@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=thomas.lendacky@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.