Skip to content

Commit ceee777

Browse files
ecsvAndi Shyti
authored andcommitted
i2c: rtl9300: Increase timeout for transfer polling
The timeout for transfers was only set to 2ms. Because of this relatively low limit, 12-byte read operations to the frontend MCU of a RTL8239 POE PSE chip cluster was consistently resulting in a timeout. The original OpenWrt downstream driver [1] was not using any timeout limit at all. This is also possible by setting the timeout_us parameter of regmap_read_poll_timeout() to 0. But since the driver currently implements the ETIMEDOUT error, it is more sensible to increase the timeout in such a way that communication with the (quite common) Realtek I2C-connected POE management solution is possible. [1] https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/realtek/files-6.12/drivers/i2c/busses/i2c-rtl9300.c;h=c4d973195ef39dc56d6207e665d279745525fcac#l202 Fixes: c366be7 ("i2c: Add driver for the RTL9300 I2C controller") Signed-off-by: Sven Eckelmann <[email protected]> Cc: <[email protected]> # v6.13+ Reviewed-by: Chris Packham <[email protected]> Tested-by: Chris Packham <[email protected]> Signed-off-by: Andi Shyti <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d67b740 commit ceee777

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/busses/i2c-rtl9300.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static int rtl9300_i2c_execute_xfer(struct rtl9300_i2c *i2c, char read_write,
175175
return ret;
176176

177177
ret = regmap_read_poll_timeout(i2c->regmap, i2c->reg_base + RTL9300_I2C_MST_CTRL1,
178-
val, !(val & RTL9300_I2C_MST_CTRL1_I2C_TRIG), 100, 2000);
178+
val, !(val & RTL9300_I2C_MST_CTRL1_I2C_TRIG), 100, 100000);
179179
if (ret)
180180
return ret;
181181

0 commit comments

Comments
 (0)