* [PATCH v3 net 0/5] amd-xgbe: Miscellaneous fixes
@ 2022-10-20 6:42 Raju Rangoju
2022-10-20 6:42 ` [PATCH v3 net 1/5] amd-xgbe: Yellow carp devices do not need rrc Raju Rangoju
` (6 more replies)
0 siblings, 7 replies; 10+ messages in thread
From: Raju Rangoju @ 2022-10-20 6:42 UTC (permalink / raw)
To: thomas.lendacky, Shyam-sundar.S-k, davem, kuba
Cc: netdev, Rajesh1.Kumar, Raju Rangoju
(1) Fix the rrc for Yellow carp devices. CDR workaround path
is disabled for YC devices, receiver reset cycle is not
needed in such cases.
(2) Add enumerations for mailbox command and sub-commands.
Instead of using hard-coded values, use enums.
(3) Enable PLL_CTL for fixed PHY modes only. Driver does not
implement SW RRCM for Autoneg Off configuration, hence PLL
is needed for fixed PHY modes only.
(4) Fix the SFP compliance codes check for DAC cables. Some of
the passive cables have non-zero data at offset 6 in
SFP EEPROM data. So, fix the sfp compliance codes check.
(5) Add a quirk for Molex passive cables to extend the rate
ceiling to 0x78.
Raju Rangoju (5):
amd-xgbe: Yellow carp devices do not need rrc
amd-xgbe: use enums for mailbox cmd and sub_cmds
amd-xgbe: enable PLL_CTL for fixed PHY modes only
amd-xgbe: fix the SFP compliance codes check for DAC cables
amd-xgbe: add the bit rate quirk for Molex cables
drivers/net/ethernet/amd/xgbe/xgbe-pci.c | 5 ++
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 58 +++++++++++++--------
drivers/net/ethernet/amd/xgbe/xgbe.h | 26 +++++++++
3 files changed, 68 insertions(+), 21 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 net 1/5] amd-xgbe: Yellow carp devices do not need rrc
2022-10-20 6:42 [PATCH v3 net 0/5] amd-xgbe: Miscellaneous fixes Raju Rangoju
@ 2022-10-20 6:42 ` Raju Rangoju
2022-10-21 4:46 ` Jakub Kicinski
2022-10-20 6:42 ` [PATCH v3 net 2/5] amd-xgbe: use enums for mailbox cmd and sub_cmds Raju Rangoju
` (5 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Raju Rangoju @ 2022-10-20 6:42 UTC (permalink / raw)
To: thomas.lendacky, Shyam-sundar.S-k, davem, kuba
Cc: netdev, Rajesh1.Kumar, Raju Rangoju
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: dbb6c58b5a61 ("net: amd-xgbe: Add Support for Yellow Carp Ethernet device")
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
---
Changes since v1:
- Use the correct fixes tag
- Update the commit message
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
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 net 2/5] amd-xgbe: use enums for mailbox cmd and sub_cmds
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-20 6:42 ` Raju Rangoju
2022-10-20 6:42 ` [PATCH v3 net 3/5] amd-xgbe: enable PLL_CTL for fixed PHY modes only Raju Rangoju
` (4 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Raju Rangoju @ 2022-10-20 6:42 UTC (permalink / raw)
To: thomas.lendacky, Shyam-sundar.S-k, davem, kuba
Cc: netdev, Rajesh1.Kumar, Raju Rangoju
Instead of using hardcoded values, use enumerations for mailbox command
and sub commands.
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
---
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 29 ++++++++++++---------
drivers/net/ethernet/amd/xgbe/xgbe.h | 25 ++++++++++++++++++
2 files changed, 41 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
index 19b943eba560..8cf5d81fca36 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
@@ -1989,7 +1989,7 @@ static void xgbe_phy_pll_ctrl(struct xgbe_prv_data *pdata, bool enable)
}
static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata,
- unsigned int cmd, unsigned int sub_cmd)
+ enum xgbe_mb_cmd cmd, enum xgbe_mb_subcmd sub_cmd)
{
unsigned int s0 = 0;
unsigned int wait;
@@ -2036,7 +2036,7 @@ static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata,
static void xgbe_phy_rrc(struct xgbe_prv_data *pdata)
{
/* Receiver Reset Cycle */
- xgbe_phy_perform_ratechange(pdata, 5, 0);
+ xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_RRC, XGBE_MB_SUBCMD_NONE);
netif_dbg(pdata, link, pdata->netdev, "receiver reset complete\n");
}
@@ -2046,7 +2046,7 @@ static void xgbe_phy_power_off(struct xgbe_prv_data *pdata)
struct xgbe_phy_data *phy_data = pdata->phy_data;
/* Power off */
- xgbe_phy_perform_ratechange(pdata, 0, 0);
+ xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_POWER_OFF, XGBE_MB_SUBCMD_NONE);
phy_data->cur_mode = XGBE_MODE_UNKNOWN;
@@ -2061,14 +2061,17 @@ static void xgbe_phy_sfi_mode(struct xgbe_prv_data *pdata)
/* 10G/SFI */
if (phy_data->sfp_cable != XGBE_SFP_CABLE_PASSIVE) {
- xgbe_phy_perform_ratechange(pdata, 3, 0);
+ xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_SFI, XGBE_MB_SUBCMD_ACTIVE);
} else {
if (phy_data->sfp_cable_len <= 1)
- xgbe_phy_perform_ratechange(pdata, 3, 1);
+ xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_SFI,
+ XGBE_MB_SUBCMD_PASSIVE_1M);
else if (phy_data->sfp_cable_len <= 3)
- xgbe_phy_perform_ratechange(pdata, 3, 2);
+ xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_SFI,
+ XGBE_MB_SUBCMD_PASSIVE_3M);
else
- xgbe_phy_perform_ratechange(pdata, 3, 3);
+ xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_SFI,
+ XGBE_MB_SUBCMD_PASSIVE_OTHER);
}
phy_data->cur_mode = XGBE_MODE_SFI;
@@ -2083,7 +2086,7 @@ static void xgbe_phy_x_mode(struct xgbe_prv_data *pdata)
xgbe_phy_set_redrv_mode(pdata);
/* 1G/X */
- xgbe_phy_perform_ratechange(pdata, 1, 3);
+ xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_1G, XGBE_MB_SUBCMD_1G_KX);
phy_data->cur_mode = XGBE_MODE_X;
@@ -2097,7 +2100,7 @@ static void xgbe_phy_sgmii_1000_mode(struct xgbe_prv_data *pdata)
xgbe_phy_set_redrv_mode(pdata);
/* 1G/SGMII */
- xgbe_phy_perform_ratechange(pdata, 1, 2);
+ xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_1G, XGBE_MB_SUBCMD_1G_SGMII);
phy_data->cur_mode = XGBE_MODE_SGMII_1000;
@@ -2111,7 +2114,7 @@ static void xgbe_phy_sgmii_100_mode(struct xgbe_prv_data *pdata)
xgbe_phy_set_redrv_mode(pdata);
/* 100M/SGMII */
- xgbe_phy_perform_ratechange(pdata, 1, 1);
+ xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_1G, XGBE_MB_SUBCMD_100MBITS);
phy_data->cur_mode = XGBE_MODE_SGMII_100;
@@ -2125,7 +2128,7 @@ static void xgbe_phy_kr_mode(struct xgbe_prv_data *pdata)
xgbe_phy_set_redrv_mode(pdata);
/* 10G/KR */
- xgbe_phy_perform_ratechange(pdata, 4, 0);
+ xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_KR, XGBE_MB_SUBCMD_NONE);
phy_data->cur_mode = XGBE_MODE_KR;
@@ -2139,7 +2142,7 @@ static void xgbe_phy_kx_2500_mode(struct xgbe_prv_data *pdata)
xgbe_phy_set_redrv_mode(pdata);
/* 2.5G/KX */
- xgbe_phy_perform_ratechange(pdata, 2, 0);
+ xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_2_5G, XGBE_MB_SUBCMD_NONE);
phy_data->cur_mode = XGBE_MODE_KX_2500;
@@ -2153,7 +2156,7 @@ static void xgbe_phy_kx_1000_mode(struct xgbe_prv_data *pdata)
xgbe_phy_set_redrv_mode(pdata);
/* 1G/KX */
- xgbe_phy_perform_ratechange(pdata, 1, 3);
+ xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_1G, XGBE_MB_SUBCMD_1G_KX);
phy_data->cur_mode = XGBE_MODE_KX_1000;
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h
index 49d23abce73d..71f24cb47935 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe.h
+++ b/drivers/net/ethernet/amd/xgbe/xgbe.h
@@ -611,6 +611,31 @@ enum xgbe_mdio_mode {
XGBE_MDIO_MODE_CL45,
};
+enum xgbe_mb_cmd {
+ XGBE_MB_CMD_POWER_OFF = 0,
+ XGBE_MB_CMD_SET_1G,
+ XGBE_MB_CMD_SET_2_5G,
+ XGBE_MB_CMD_SET_10G_SFI,
+ XGBE_MB_CMD_SET_10G_KR,
+ XGBE_MB_CMD_RRC
+};
+
+enum xgbe_mb_subcmd {
+ XGBE_MB_SUBCMD_NONE = 0,
+
+ /* 10GbE SFP subcommands */
+ XGBE_MB_SUBCMD_ACTIVE = 0,
+ XGBE_MB_SUBCMD_PASSIVE_1M,
+ XGBE_MB_SUBCMD_PASSIVE_3M,
+ XGBE_MB_SUBCMD_PASSIVE_OTHER,
+
+ /* 1GbE Mode subcommands */
+ XGBE_MB_SUBCMD_10MBITS = 0,
+ XGBE_MB_SUBCMD_100MBITS,
+ XGBE_MB_SUBCMD_1G_SGMII,
+ XGBE_MB_SUBCMD_1G_KX
+};
+
struct xgbe_phy {
struct ethtool_link_ksettings lks;
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 net 3/5] amd-xgbe: enable PLL_CTL for fixed PHY modes only
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-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 ` Raju Rangoju
2022-10-20 6:42 ` [PATCH v3 net 4/5] amd-xgbe: fix the SFP compliance codes check for DAC cables Raju Rangoju
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Raju Rangoju @ 2022-10-20 6:42 UTC (permalink / raw)
To: thomas.lendacky, Shyam-sundar.S-k, davem, kuba
Cc: netdev, Rajesh1.Kumar, Raju Rangoju
PLL control setting(RRC) is needed only in fixed PHY configuration to
fix the peer-peer issues. Without the PLL control setting, the link up
takes longer time in a fixed phy configuration.
Driver implements SW RRC for Autoneg On configuration, hence PLL control
setting (RRC) is not needed for AN On configuration, and can be skipped.
Also, PLL re-initialization is not needed for PHY Power Off and RRC
commands. Otherwise, they lead to mailbox errors. Added the changes
accordingly.
Fixes: daf182d360e5 ("net: amd-xgbe: Toggle PLL settings during rate change")
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
---
Changes since v2:
- update the POWER_OFF and RRC enumerations
- updated the commit message to use RRC instead of RRCM
Changes since v1:
- used enums for all mailxbox command and subcommands, pre-patch to this
contains the enum updates
- updated the comment section to include RRC command
- updated the commit message to use RRC instead of RRCM
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
index 8cf5d81fca36..349ba0dc1fa2 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
@@ -1979,6 +1979,10 @@ static void xgbe_phy_rx_reset(struct xgbe_prv_data *pdata)
static void xgbe_phy_pll_ctrl(struct xgbe_prv_data *pdata, bool enable)
{
+ /* PLL_CTRL feature needs to be enabled for fixed PHY modes (Non-Autoneg) only */
+ if (pdata->phy.autoneg != AUTONEG_DISABLE)
+ return;
+
XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_VEND2_PMA_MISC_CTRL0,
XGBE_PMA_PLL_CTRL_MASK,
enable ? XGBE_PMA_PLL_CTRL_ENABLE
@@ -2029,8 +2033,10 @@ static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata,
xgbe_phy_rx_reset(pdata);
reenable_pll:
- /* Enable PLL re-initialization */
- xgbe_phy_pll_ctrl(pdata, true);
+ /* Enable PLL re-initialization, not needed for PHY Power Off and RRC cmds */
+ if (cmd != XGBE_MB_CMD_POWER_OFF &&
+ cmd != XGBE_MB_CMD_RRC)
+ xgbe_phy_pll_ctrl(pdata, true);
}
static void xgbe_phy_rrc(struct xgbe_prv_data *pdata)
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 net 4/5] amd-xgbe: fix the SFP compliance codes check for DAC cables
2022-10-20 6:42 [PATCH v3 net 0/5] amd-xgbe: Miscellaneous fixes Raju Rangoju
` (2 preceding siblings ...)
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
2022-10-20 6:42 ` [PATCH v3 net 5/5] amd-xgbe: add the bit rate quirk for Molex cables Raju Rangoju
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Raju Rangoju @ 2022-10-20 6:42 UTC (permalink / raw)
To: thomas.lendacky, Shyam-sundar.S-k, davem, kuba
Cc: netdev, Rajesh1.Kumar, Raju Rangoju
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
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 net 5/5] amd-xgbe: add the bit rate quirk for Molex cables
2022-10-20 6:42 [PATCH v3 net 0/5] amd-xgbe: Miscellaneous fixes Raju Rangoju
` (3 preceding siblings ...)
2022-10-20 6:42 ` [PATCH v3 net 4/5] amd-xgbe: fix the SFP compliance codes check for DAC cables Raju Rangoju
@ 2022-10-20 6:42 ` 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
6 siblings, 0 replies; 10+ messages in thread
From: Raju Rangoju @ 2022-10-20 6:42 UTC (permalink / raw)
To: thomas.lendacky, Shyam-sundar.S-k, davem, kuba
Cc: netdev, Rajesh1.Kumar, Raju Rangoju
The offset 12 (bit-rate) of EEPROM SFP DAC (passive) cables is expected
to be in the range 0x64 to 0x68. However, the 5 meter and 7 meter Molex
passive cables have the rate ceiling 0x78 at offset 12.
Add a quirk for Molex passive cables to extend the rate ceiling to 0x78.
Fixes: abf0a1c2b26a ("amd-xgbe: Add support for SFP+ modules")
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
---
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
index 8c41ac5676d6..4064c3e3dd49 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
@@ -239,6 +239,7 @@ enum xgbe_sfp_speed {
#define XGBE_SFP_BASE_BR_1GBE_MAX 0x0d
#define XGBE_SFP_BASE_BR_10GBE_MIN 0x64
#define XGBE_SFP_BASE_BR_10GBE_MAX 0x68
+#define XGBE_MOLEX_SFP_BASE_BR_10GBE_MAX 0x78
#define XGBE_SFP_BASE_CU_CABLE_LEN 18
@@ -284,6 +285,8 @@ struct xgbe_sfp_eeprom {
#define XGBE_BEL_FUSE_VENDOR "BEL-FUSE "
#define XGBE_BEL_FUSE_PARTNO "1GBT-SFP06 "
+#define XGBE_MOLEX_VENDOR "Molex Inc. "
+
struct xgbe_sfp_ascii {
union {
char vendor[XGBE_SFP_BASE_VENDOR_NAME_LEN + 1];
@@ -834,7 +837,11 @@ static bool xgbe_phy_sfp_bit_rate(struct xgbe_sfp_eeprom *sfp_eeprom,
break;
case XGBE_SFP_SPEED_10000:
min = XGBE_SFP_BASE_BR_10GBE_MIN;
- max = XGBE_SFP_BASE_BR_10GBE_MAX;
+ if (memcmp(&sfp_eeprom->base[XGBE_SFP_BASE_VENDOR_NAME],
+ XGBE_MOLEX_VENDOR, XGBE_SFP_BASE_VENDOR_NAME_LEN) == 0)
+ max = XGBE_MOLEX_SFP_BASE_BR_10GBE_MAX;
+ else
+ max = XGBE_SFP_BASE_BR_10GBE_MAX;
break;
default:
return false;
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v3 net 0/5] amd-xgbe: Miscellaneous fixes
2022-10-20 6:42 [PATCH v3 net 0/5] amd-xgbe: Miscellaneous fixes Raju Rangoju
` (4 preceding siblings ...)
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 ` Tom Lendacky
2022-10-22 5:50 ` patchwork-bot+netdevbpf
6 siblings, 0 replies; 10+ messages in thread
From: Tom Lendacky @ 2022-10-20 17:33 UTC (permalink / raw)
To: Raju Rangoju, Shyam-sundar.S-k, davem, kuba; +Cc: netdev, Rajesh1.Kumar
On 10/20/22 01:42, Raju Rangoju wrote:
> (1) Fix the rrc for Yellow carp devices. CDR workaround path
> is disabled for YC devices, receiver reset cycle is not
> needed in such cases.
>
> (2) Add enumerations for mailbox command and sub-commands.
> Instead of using hard-coded values, use enums.
>
> (3) Enable PLL_CTL for fixed PHY modes only. Driver does not
> implement SW RRCM for Autoneg Off configuration, hence PLL
> is needed for fixed PHY modes only.
>
> (4) Fix the SFP compliance codes check for DAC cables. Some of
> the passive cables have non-zero data at offset 6 in
> SFP EEPROM data. So, fix the sfp compliance codes check.
>
> (5) Add a quirk for Molex passive cables to extend the rate
> ceiling to 0x78.
>
> Raju Rangoju (5):
> amd-xgbe: Yellow carp devices do not need rrc
> amd-xgbe: use enums for mailbox cmd and sub_cmds
> amd-xgbe: enable PLL_CTL for fixed PHY modes only
> amd-xgbe: fix the SFP compliance codes check for DAC cables
> amd-xgbe: add the bit rate quirk for Molex cables
For the series,
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
>
> drivers/net/ethernet/amd/xgbe/xgbe-pci.c | 5 ++
> drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 58 +++++++++++++--------
> drivers/net/ethernet/amd/xgbe/xgbe.h | 26 +++++++++
> 3 files changed, 68 insertions(+), 21 deletions(-)
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 net 1/5] amd-xgbe: Yellow carp devices do not need rrc
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
0 siblings, 1 reply; 10+ messages in thread
From: Jakub Kicinski @ 2022-10-21 4:46 UTC (permalink / raw)
To: Raju Rangoju
Cc: thomas.lendacky, Shyam-sundar.S-k, davem, netdev, Rajesh1.Kumar
On Thu, 20 Oct 2022 12:12:11 +0530 Raju Rangoju wrote:
> 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.
Let me retry [1] the same question:
These devices are only present on SoCs? Changing global data during
probe looks odd.
[1] https://lore.kernel.org/all/20221006172654.45372b3b@kernel.org/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 net 1/5] amd-xgbe: Yellow carp devices do not need rrc
2022-10-21 4:46 ` Jakub Kicinski
@ 2022-10-21 13:40 ` Tom Lendacky
0 siblings, 0 replies; 10+ messages in thread
From: Tom Lendacky @ 2022-10-21 13:40 UTC (permalink / raw)
To: Jakub Kicinski, Raju Rangoju
Cc: Shyam-sundar.S-k, davem, netdev, Rajesh1.Kumar
On 10/20/22 23:46, Jakub Kicinski wrote:
> On Thu, 20 Oct 2022 12:12:11 +0530 Raju Rangoju wrote:
>> 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.
>
> Let me retry [1] the same question:
>
> These devices are only present on SoCs? Changing global data during
> probe looks odd.
I can answer for Raju, yes, these are only on SoCs.
But it would still probably be worth a series that allocates memory to
copy the vdata and use that, free to modify without impacting any other
device that is probed.
Thanks,
Tom
>
> [1] https://lore.kernel.org/all/20221006172654.45372b3b@kernel.org/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 net 0/5] amd-xgbe: Miscellaneous fixes
2022-10-20 6:42 [PATCH v3 net 0/5] amd-xgbe: Miscellaneous fixes Raju Rangoju
` (5 preceding siblings ...)
2022-10-20 17:33 ` [PATCH v3 net 0/5] amd-xgbe: Miscellaneous fixes Tom Lendacky
@ 2022-10-22 5:50 ` patchwork-bot+netdevbpf
6 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-10-22 5:50 UTC (permalink / raw)
To: Raju Rangoju
Cc: thomas.lendacky, Shyam-sundar.S-k, davem, kuba, netdev, Rajesh1.Kumar
Hello:
This series was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 20 Oct 2022 12:12:10 +0530 you wrote:
> (1) Fix the rrc for Yellow carp devices. CDR workaround path
> is disabled for YC devices, receiver reset cycle is not
> needed in such cases.
>
> (2) Add enumerations for mailbox command and sub-commands.
> Instead of using hard-coded values, use enums.
>
> [...]
Here is the summary with links:
- [v3,net,1/5] amd-xgbe: Yellow carp devices do not need rrc
https://git.kernel.org/netdev/net/c/f97fc7ef4146
- [v3,net,2/5] amd-xgbe: use enums for mailbox cmd and sub_cmds
https://git.kernel.org/netdev/net/c/1246d0862349
- [v3,net,3/5] amd-xgbe: enable PLL_CTL for fixed PHY modes only
https://git.kernel.org/netdev/net/c/fc75c032aee6
- [v3,net,4/5] amd-xgbe: fix the SFP compliance codes check for DAC cables
https://git.kernel.org/netdev/net/c/09c5f6bf11ac
- [v3,net,5/5] amd-xgbe: add the bit rate quirk for Molex cables
https://git.kernel.org/netdev/net/c/170a9e341a3b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2022-10-22 5:50 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH v3 net 4/5] amd-xgbe: fix the SFP compliance codes check for DAC cables Raju Rangoju
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
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.