[SRU][N:linux-bluefield][PATCH v1 2/5] Revert "UBUNTU: SAUCE: i2c-mlxbf: Improve I2C bus timing configuration"

Chris Babroski cbabroski at nvidia.com
Wed Aug 6 19:02:56 UTC 2025


BugLink: https://bugs.launchpad.net/bugs/2119651

This reverts commit 6727348a8698f705aef0109c0c428894f1b16dbb.

Signed-off-by: Chris Babroski <cbabroski at nvidia.com>
---
 drivers/i2c/busses/i2c-mlxbf.c | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c
index a3c665bac6d4..298cb2cb33e9 100644
--- a/drivers/i2c/busses/i2c-mlxbf.c
+++ b/drivers/i2c/busses/i2c-mlxbf.c
@@ -197,7 +197,6 @@
 
 #define MLXBF_I2C_MASK_8    GENMASK(7, 0)
 #define MLXBF_I2C_MASK_16   GENMASK(15, 0)
-#define MLXBF_I2C_MASK_32   GENMASK(31, 0)
 
 #define MLXBF_I2C_MST_ADDR_OFFSET         0x200
 
@@ -1131,8 +1130,7 @@ static void mlxbf_i2c_set_timings(struct mlxbf_i2c_priv *priv,
 				     MLXBF_I2C_MASK_16, MLXBF_I2C_SHIFT_16);
 	writel(timer, priv->timer->io + MLXBF_I2C_SMBUS_THIGH_MAX_TBUF);
 
-	timer = mlxbf_i2c_set_timer(priv, timings->timeout, false,
-				    MLXBF_I2C_MASK_32, MLXBF_I2C_SHIFT_0);
+	timer = timings->timeout;
 	writel(timer, priv->timer->io + MLXBF_I2C_SMBUS_SCL_LOW_TIMEOUT);
 }
 
@@ -1142,7 +1140,11 @@ enum mlxbf_i2c_timings_config {
 	MLXBF_I2C_TIMING_CONFIG_1000KHZ,
 };
 
-/* Timing values are in nanoseconds */
+/*
+ * Note that the mlxbf_i2c_timings->timeout value is not related to the
+ * bus frequency, it is impacted by the time it takes the driver to
+ * complete data transmission before transaction abort.
+ */
 static const struct mlxbf_i2c_timings mlxbf_i2c_timings[] = {
 	[MLXBF_I2C_TIMING_CONFIG_100KHZ] = {
 		.scl_high = 4810,
@@ -1157,8 +1159,8 @@ static const struct mlxbf_i2c_timings mlxbf_i2c_timings[] = {
 		.scl_fall = 50,
 		.hold_data = 300,
 		.buf = 20000,
-		.thigh_max = 50000,
-		.timeout = 35000000
+		.thigh_max = 5000,
+		.timeout = 106500
 	},
 	[MLXBF_I2C_TIMING_CONFIG_400KHZ] = {
 		.scl_high = 1011,
@@ -1173,24 +1175,24 @@ static const struct mlxbf_i2c_timings mlxbf_i2c_timings[] = {
 		.scl_fall = 50,
 		.hold_data = 300,
 		.buf = 20000,
-		.thigh_max = 50000,
-		.timeout = 35000000
+		.thigh_max = 5000,
+		.timeout = 106500
 	},
 	[MLXBF_I2C_TIMING_CONFIG_1000KHZ] = {
-		.scl_high = 383,
-		.scl_low = 460,
+		.scl_high = 600,
+		.scl_low = 1300,
 		.hold_start = 600,
-		.setup_start = 260,
-		.setup_stop = 260,
-		.setup_data = 50,
+		.setup_start = 600,
+		.setup_stop = 600,
+		.setup_data = 100,
 		.sda_rise = 50,
 		.sda_fall = 50,
 		.scl_rise = 50,
 		.scl_fall = 50,
 		.hold_data = 300,
-		.buf = 500,
-		.thigh_max = 50000,
-		.timeout = 35000000
+		.buf = 20000,
+		.thigh_max = 5000,
+		.timeout = 106500
 	}
 };
 
-- 
2.34.1




More information about the kernel-team mailing list