Skip to contentSkip to conversation

i3c: master: Fix missing 'ret' assignment in set_speed()

PATCH Applied Frank Li 5 participants 5 messages Jan 8, 2025 – Jan 12, 2025

Subsystems (2)
lore
Share & tools
lore

Frank Li

author maintainer
#0 lore raw

PATCH 1/1 i3c: master: Fix missing 'ret' assignment in set_speed()

Fix a probe failure in the i3c master driver that occurs when no i3c devices are connected to the bus.

The issue arises in i3c_master_bus_init() where the ret value is not updated after calling master->ops->set_speed(). If no devices are present, ret remains set to I3C_ERROR_M2, causing the code to incorrectly proceed to err_bus_cleanup.

Fixes aef79e189ba2 ("i3c: master: support to adjust first broadcast address speed")
---
 drivers/i3c/master.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i3c/master.c +1 -1
index 42310c9a00c2d..53ab814b676ff 100644
@@ -1919,7 +1919,7 @@ static int i3c_master_bus_init(struct i3c_master_controller *master)
 		goto err_bus_cleanup;
 
 	if (master->ops->set_speed) {
-		master->ops->set_speed(master, I3C_OPEN_DRAIN_NORMAL_SPEED);
+		ret = master->ops->set_speed(master, I3C_OPEN_DRAIN_NORMAL_SPEED);
 		if (ret)
 			goto err_bus_cleanup;
 	}
Signature · 1 line
2.34.1
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 11 lines · Frank Li

Fix a probe failure in the i3c master driver that occurs when no i3c devices are connected to the bus.

The issue arises in i3c_master_bus_init() where the ret value is not updated after calling master->ops->set_speed(). If no devices are present, ret remains set to I3C_ERROR_M2, causing the code to incorrectly proceed to err_bus_cleanup.

Fixes aef79e189ba2 ("i3c: master: support to adjust first broadcast address speed")

Precisely.

Tested with a Renesas RZ/G3S-SMARC board with some test code added to the still under-development controller driver:

Acked-by on v1 1/1
#2 lore raw
In reply to Frank Li

Hi Frank, change looks good to me.

Quoted 20 lines · Frank Li

Fix a probe failure in the i3c master driver that occurs when no i3c devices are connected to the bus.

The issue arises in i3c_master_bus_init() where the ret value is not updated after calling master->ops->set_speed(). If no devices are present, ret remains set to I3C_ERROR_M2, causing the code to incorrectly proceed to err_bus_cleanup.

Fixes aef79e189ba2 ("i3c: master: support to adjust first broadcast address speed")
---
  drivers/i3c/master.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i3c/master.c +0 -0
index 42310c9a00c2d..53ab814b676ff 100644

drivers/i3c/master.c static int i3c_master_bus_init(struct i3c_master_controller *master) · line 1925

Quoted 8 lines
drivers/i3c/master.c +1 -1
@@ -1919,7 +1919,7 @@ static int i3c_master_bus_init(struct i3c_master_controller *master)
  		goto err_bus_cleanup;
 
  	if (master->ops->set_speed) {
-		master->ops->set_speed(master, I3C_OPEN_DRAIN_NORMAL_SPEED);
+		ret = master->ops->set_speed(master, I3C_OPEN_DRAIN_NORMAL_SPEED);
  		if (ret)
  			goto err_bus_cleanup;
  	}
Reviewed-by on v1 1/1
#3 lore raw
In reply to Frank Li
Quoted 7 lines · Frank Li

Fix a probe failure in the i3c master driver that occurs when no i3c devices are connected to the bus.

The issue arises in i3c_master_bus_init() where the ret value is not updated after calling master->ops->set_speed(). If no devices are present, ret remains set to I3C_ERROR_M2, causing the code to incorrectly proceed to err_bus_cleanup.

Thanks,
Miquèl

Signature · 3 lines
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
maintainer Applied
#4 lore raw
In reply to Frank Li
Quoted 9 lines · Frank Li

Fix a probe failure in the i3c master driver that occurs when no i3c devices are connected to the bus.

The issue arises in i3c_master_bus_init() where the ret value is not updated after calling master->ops->set_speed(). If no devices are present, ret remains set to I3C_ERROR_M2, causing the code to incorrectly proceed to err_bus_cleanup.

[...]

Applied, thanks!

[1/1] i3c: master: Fix missing 'ret' assignment in set_speed()

      https://git.kernel.org/abelloni/c/b266e0d4dac0

Best regards,

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com