public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] i3c: master: Fix missing 'ret' assignment in set_speed()
@ 2025-01-08 22:55 Frank Li
  2025-01-09  7:43 ` Wolfram Sang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Frank Li @ 2025-01-08 22:55 UTC (permalink / raw)
  To: Alexandre Belloni, Carlos Song, Miquel Raynal,
	moderated list:I3C SUBSYSTEM, open list
  Cc: imx

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`.

Cc: stable@vger.kernel.org
Fixes: aef79e189ba2 ("i3c: master: support to adjust first broadcast address speed")
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 drivers/i3c/master.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 42310c9a00c2d..53ab814b676ff 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -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;
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] i3c: master: Fix missing 'ret' assignment in set_speed()
  2025-01-08 22:55 [PATCH 1/1] i3c: master: Fix missing 'ret' assignment in set_speed() Frank Li
@ 2025-01-09  7:43 ` Wolfram Sang
  2025-01-09  8:50 ` Mukesh Kumar Savaliya
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2025-01-09  7:43 UTC (permalink / raw)
  To: Frank Li
  Cc: Alexandre Belloni, Carlos Song, Miquel Raynal,
	moderated list:I3C SUBSYSTEM, open list, imx

[-- Attachment #1: Type: text/plain, Size: 864 bytes --]

On Wed, Jan 08, 2025 at 05:55:33PM -0500, Frank Li wrote:
> 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`.
> 
> Cc: stable@vger.kernel.org
> Fixes: aef79e189ba2 ("i3c: master: support to adjust first broadcast address speed")
> Signed-off-by: Frank Li <Frank.Li@nxp.com>

Precisely.

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

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

Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] i3c: master: Fix missing 'ret' assignment in set_speed()
  2025-01-08 22:55 [PATCH 1/1] i3c: master: Fix missing 'ret' assignment in set_speed() Frank Li
  2025-01-09  7:43 ` Wolfram Sang
@ 2025-01-09  8:50 ` Mukesh Kumar Savaliya
  2025-01-09 13:04 ` Miquel Raynal
  2025-01-12 23:04 ` Alexandre Belloni
  3 siblings, 0 replies; 5+ messages in thread
From: Mukesh Kumar Savaliya @ 2025-01-09  8:50 UTC (permalink / raw)
  To: Frank Li, Alexandre Belloni, Carlos Song, Miquel Raynal,
	moderated list:I3C SUBSYSTEM, open list
  Cc: imx

Hi Frank, change looks good to me.

On 1/9/2025 4:25 AM, Frank Li wrote:
> 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`.
> 
> Cc: stable@vger.kernel.org
> Fixes: aef79e189ba2 ("i3c: master: support to adjust first broadcast address speed")
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>   drivers/i3c/master.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index 42310c9a00c2d..53ab814b676ff 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
> @@ -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;
>   	}
Acked-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] i3c: master: Fix missing 'ret' assignment in set_speed()
  2025-01-08 22:55 [PATCH 1/1] i3c: master: Fix missing 'ret' assignment in set_speed() Frank Li
  2025-01-09  7:43 ` Wolfram Sang
  2025-01-09  8:50 ` Mukesh Kumar Savaliya
@ 2025-01-09 13:04 ` Miquel Raynal
  2025-01-12 23:04 ` Alexandre Belloni
  3 siblings, 0 replies; 5+ messages in thread
From: Miquel Raynal @ 2025-01-09 13:04 UTC (permalink / raw)
  To: Frank Li
  Cc: Alexandre Belloni, Carlos Song, moderated list:I3C SUBSYSTEM,
	open list, imx

On 08/01/2025 at 17:55:33 -05, Frank Li <Frank.Li@nxp.com> wrote:

> 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`.

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] i3c: master: Fix missing 'ret' assignment in set_speed()
  2025-01-08 22:55 [PATCH 1/1] i3c: master: Fix missing 'ret' assignment in set_speed() Frank Li
                   ` (2 preceding siblings ...)
  2025-01-09 13:04 ` Miquel Raynal
@ 2025-01-12 23:04 ` Alexandre Belloni
  3 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2025-01-12 23:04 UTC (permalink / raw)
  To: Carlos Song, Miquel Raynal, linux-i3c, linux-kernel, Frank Li; +Cc: imx

On Wed, 08 Jan 2025 17:55:33 -0500, Frank Li wrote:
> 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,

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-12 23:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-08 22:55 [PATCH 1/1] i3c: master: Fix missing 'ret' assignment in set_speed() Frank Li
2025-01-09  7:43 ` Wolfram Sang
2025-01-09  8:50 ` Mukesh Kumar Savaliya
2025-01-09 13:04 ` Miquel Raynal
2025-01-12 23:04 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox