[dpdk-stable] patch 'net/txgbe: fix reading SFP module SFF-8472 data' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:28:11 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/12/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/05af857e4305c4d5533c44c458b92f15e9af4281

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 05af857e4305c4d5533c44c458b92f15e9af4281 Mon Sep 17 00:00:00 2001
From: Jiawen Wu <jiawenwu at trustnetic.com>
Date: Thu, 12 Aug 2021 10:00:19 +0800
Subject: [PATCH] net/txgbe: fix reading SFP module SFF-8472 data
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 00970f6398c871df52cfe3b87ebbe418616c9117 ]

Fix the I2C target address selection to read SFP module's SFF-8472 data.

Fixes: 8f09fb4642fa ("net/txgbe: add module identify")

Signed-off-by: Jiawen Wu <jiawenwu at trustnetic.com>
---
 drivers/net/txgbe/base/txgbe_phy.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/net/txgbe/base/txgbe_phy.c b/drivers/net/txgbe/base/txgbe_phy.c
index bdd6bf780e..aa8037a36e 100644
--- a/drivers/net/txgbe/base/txgbe_phy.c
+++ b/drivers/net/txgbe/base/txgbe_phy.c
@@ -7,7 +7,7 @@
 #include "txgbe_mng.h"
 #include "txgbe_phy.h"
 
-static void txgbe_i2c_start(struct txgbe_hw *hw);
+static void txgbe_i2c_start(struct txgbe_hw *hw, u8 dev_addr);
 static void txgbe_i2c_stop(struct txgbe_hw *hw);
 
 /**
@@ -1223,11 +1223,9 @@ s32 txgbe_write_i2c_eeprom(struct txgbe_hw *hw, u8 byte_offset,
 s32 txgbe_read_i2c_byte_unlocked(struct txgbe_hw *hw, u8 byte_offset,
 					   u8 dev_addr, u8 *data)
 {
-	UNREFERENCED_PARAMETER(dev_addr);
-
 	DEBUGFUNC("txgbe_read_i2c_byte");
 
-	txgbe_i2c_start(hw);
+	txgbe_i2c_start(hw, dev_addr);
 
 	/* wait tx empty */
 	if (!po32m(hw, TXGBE_I2CICR, TXGBE_I2CICR_TXEMPTY,
@@ -1289,11 +1287,9 @@ s32 txgbe_read_i2c_byte(struct txgbe_hw *hw, u8 byte_offset,
 s32 txgbe_write_i2c_byte_unlocked(struct txgbe_hw *hw, u8 byte_offset,
 					    u8 dev_addr, u8 data)
 {
-	UNREFERENCED_PARAMETER(dev_addr);
-
 	DEBUGFUNC("txgbe_write_i2c_byte");
 
-	txgbe_i2c_start(hw);
+	txgbe_i2c_start(hw, dev_addr);
 
 	/* wait tx empty */
 	if (!po32m(hw, TXGBE_I2CICR, TXGBE_I2CICR_TXEMPTY,
@@ -1344,7 +1340,7 @@ s32 txgbe_write_i2c_byte(struct txgbe_hw *hw, u8 byte_offset,
  *
  *  Sets I2C start condition (High -> Low on SDA while SCL is High)
  **/
-static void txgbe_i2c_start(struct txgbe_hw *hw)
+static void txgbe_i2c_start(struct txgbe_hw *hw, u8 dev_addr)
 {
 	DEBUGFUNC("txgbe_i2c_start");
 
@@ -1355,9 +1351,9 @@ static void txgbe_i2c_start(struct txgbe_hw *hw)
 		TXGBE_I2CCON_SPEED(1) |
 		TXGBE_I2CCON_RESTART |
 		TXGBE_I2CCON_SDIA));
-	wr32(hw, TXGBE_I2CTAR, TXGBE_I2C_SLAVEADDR);
-	wr32(hw, TXGBE_I2CSSSCLHCNT, 600);
-	wr32(hw, TXGBE_I2CSSSCLLCNT, 600);
+	wr32(hw, TXGBE_I2CTAR, dev_addr >> 1);
+	wr32(hw, TXGBE_I2CSSSCLHCNT, 200);
+	wr32(hw, TXGBE_I2CSSSCLLCNT, 200);
 	wr32(hw, TXGBE_I2CRXTL, 0); /* 1byte for rx full signal */
 	wr32(hw, TXGBE_I2CTXTL, 4);
 	wr32(hw, TXGBE_I2CSCLTMOUT, 0xFFFFFF);
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:02.444702146 +0800
+++ 0007-net-txgbe-fix-reading-SFP-module-SFF-8472-data.patch	2021-11-10 14:17:01.740747155 +0800
@@ -1 +1 @@
-From 00970f6398c871df52cfe3b87ebbe418616c9117 Mon Sep 17 00:00:00 2001
+From 05af857e4305c4d5533c44c458b92f15e9af4281 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 00970f6398c871df52cfe3b87ebbe418616c9117 ]
@@ -9 +11,0 @@
-Cc: stable at dpdk.org
@@ -17 +19 @@
-index 3e9f507212..2db87ae0c5 100644
+index bdd6bf780e..aa8037a36e 100644
@@ -20 +22 @@
-@@ -8,7 +8,7 @@
+@@ -7,7 +7,7 @@
@@ -27,3 +29,3 @@
- static s32 txgbe_handle_bp_flow(u32 link_mode, struct txgbe_hw *hw);
- static void txgbe_get_bp_ability(struct txgbe_backplane_ability *ability,
-@@ -1248,11 +1248,9 @@ s32 txgbe_write_i2c_eeprom(struct txgbe_hw *hw, u8 byte_offset,
+ 
+ /**
+@@ -1223,11 +1223,9 @@ s32 txgbe_write_i2c_eeprom(struct txgbe_hw *hw, u8 byte_offset,
@@ -42 +44 @@
-@@ -1314,11 +1312,9 @@ s32 txgbe_read_i2c_byte(struct txgbe_hw *hw, u8 byte_offset,
+@@ -1289,11 +1287,9 @@ s32 txgbe_read_i2c_byte(struct txgbe_hw *hw, u8 byte_offset,
@@ -55 +57 @@
-@@ -1369,7 +1365,7 @@ s32 txgbe_write_i2c_byte(struct txgbe_hw *hw, u8 byte_offset,
+@@ -1344,7 +1340,7 @@ s32 txgbe_write_i2c_byte(struct txgbe_hw *hw, u8 byte_offset,
@@ -64 +66 @@
-@@ -1380,9 +1376,9 @@ static void txgbe_i2c_start(struct txgbe_hw *hw)
+@@ -1355,9 +1351,9 @@ static void txgbe_i2c_start(struct txgbe_hw *hw)


More information about the stable mailing list