]> git.baikalelectronics.ru Git - kernel.git/commitdiff
amd-xgbe: add the bit rate quirk for Molex cables
authorRaju Rangoju <Raju.Rangoju@amd.com>
Thu, 20 Oct 2022 06:42:15 +0000 (12:12 +0530)
committerJakub Kicinski <kuba@kernel.org>
Sat, 22 Oct 2022 05:40:22 +0000 (22:40 -0700)
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: b4e904b9c76f ("amd-xgbe: Add support for SFP+ modules")
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-phy-v2.c

index 8c41ac5676d65f2f6f4eae365b95b0a2bf560749..4064c3e3dd492f5856b03bb6f6d4e452bc14e154 100644 (file)
@@ -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;