[PATCH v2 5/5] i3c: master: adi: Fix error propagation for CCCs

Jorge Marques posted 5 patches 3 weeks, 4 days ago
There is a newer version of this series
[PATCH v2 5/5] i3c: master: adi: Fix error propagation for CCCs
Posted by Jorge Marques 3 weeks, 4 days ago
adi_i3c_master_send_ccc_cmd() always returned 0, ignoring the transfer
result populated in the completion path. As a consequence, CCC command
errors were silently dropped, including the default -ETIMEDOUT and
later overwritten by adi_i3c_master_end_xfer_locked().

Fix this by returning xfer->ret so that callers correctly receive any
transfer error codes.

Fixes: a79ac2cdc91d ("i3c: master: Add driver for Analog Devices I3C Controller IP")
Signed-off-by: Jorge Marques <jorge.marques@analog.com>
---
 drivers/i3c/master/adi-i3c-master.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i3c/master/adi-i3c-master.c b/drivers/i3c/master/adi-i3c-master.c
index fb9a488304469..047081c9f0643 100644
--- a/drivers/i3c/master/adi-i3c-master.c
+++ b/drivers/i3c/master/adi-i3c-master.c
@@ -361,7 +361,7 @@ static int adi_i3c_master_send_ccc_cmd(struct i3c_master_controller *m,
 
 	cmd->err = adi_i3c_cmd_get_err(&xfer->cmds[0]);
 
-	return 0;
+	return xfer->ret;
 }
 
 static int adi_i3c_master_i3c_xfers(struct i3c_dev_desc *dev,

-- 
2.51.1
Re: [PATCH v2 5/5] i3c: master: adi: Fix error propagation for CCCs
Posted by Adrian Hunter 3 weeks, 3 days ago
On 12/03/2026 18:38, Jorge Marques wrote:
> adi_i3c_master_send_ccc_cmd() always returned 0, ignoring the transfer
> result populated in the completion path. As a consequence, CCC command
> errors were silently dropped, including the default -ETIMEDOUT and
> later overwritten by adi_i3c_master_end_xfer_locked().
> 
> Fix this by returning xfer->ret so that callers correctly receive any
> transfer error codes.
> 
> Fixes: a79ac2cdc91d ("i3c: master: Add driver for Analog Devices I3C Controller IP")
> Signed-off-by: Jorge Marques <jorge.marques@analog.com>

Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/i3c/master/adi-i3c-master.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i3c/master/adi-i3c-master.c b/drivers/i3c/master/adi-i3c-master.c
> index fb9a488304469..047081c9f0643 100644
> --- a/drivers/i3c/master/adi-i3c-master.c
> +++ b/drivers/i3c/master/adi-i3c-master.c
> @@ -361,7 +361,7 @@ static int adi_i3c_master_send_ccc_cmd(struct i3c_master_controller *m,
>  
>  	cmd->err = adi_i3c_cmd_get_err(&xfer->cmds[0]);
>  
> -	return 0;
> +	return xfer->ret;
>  }
>  
>  static int adi_i3c_master_i3c_xfers(struct i3c_dev_desc *dev,
>
Re: [PATCH v2 5/5] i3c: master: adi: Fix error propagation for CCCs
Posted by Frank Li 3 weeks, 4 days ago
On Thu, Mar 12, 2026 at 05:38:08PM +0100, Jorge Marques wrote:
> adi_i3c_master_send_ccc_cmd() always returned 0, ignoring the transfer
> result populated in the completion path. As a consequence, CCC command
> errors were silently dropped, including the default -ETIMEDOUT and
> later overwritten by adi_i3c_master_end_xfer_locked().
>
> Fix this by returning xfer->ret so that callers correctly receive any
> transfer error codes.
>
> Fixes: a79ac2cdc91d ("i3c: master: Add driver for Analog Devices I3C Controller IP")
> Signed-off-by: Jorge Marques <jorge.marques@analog.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/i3c/master/adi-i3c-master.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i3c/master/adi-i3c-master.c b/drivers/i3c/master/adi-i3c-master.c
> index fb9a488304469..047081c9f0643 100644
> --- a/drivers/i3c/master/adi-i3c-master.c
> +++ b/drivers/i3c/master/adi-i3c-master.c
> @@ -361,7 +361,7 @@ static int adi_i3c_master_send_ccc_cmd(struct i3c_master_controller *m,
>
>  	cmd->err = adi_i3c_cmd_get_err(&xfer->cmds[0]);
>
> -	return 0;
> +	return xfer->ret;
>  }
>
>  static int adi_i3c_master_i3c_xfers(struct i3c_dev_desc *dev,
>
> --
> 2.51.1
>