netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] net: wwan: Add error handling for ipc_mux_dl_acb_send_cmds().
@ 2025-04-03  8:48 Wentao Liang
  2025-04-04  7:14 ` Michal Swiatkowski
  0 siblings, 1 reply; 3+ messages in thread
From: Wentao Liang @ 2025-04-03  8:48 UTC (permalink / raw)
  To: m.chetan.kumar, loic.poulain, ryazanov.s.a, johannes,
	andrew+netdev, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Wentao Liang

The ipc_mux_dl_acbcmd_decode() calls the ipc_mux_dl_acb_send_cmds(),
but does not report the error if ipc_mux_dl_acb_send_cmds() fails.
This makes it difficult to detect command sending failures. A proper
implementation can be found in ipc_mux_dl_cmd_decode().

Add error reporting to the call, logging an error message using dev_err()
if the command sending fails.

Fixes: 1f52d7b62285 ("net: wwan: iosm: Enable M.2 7360 WWAN card support")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
index bff46f7ca59f..478c9c8b638b 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
@@ -509,8 +509,11 @@ static void ipc_mux_dl_acbcmd_decode(struct iosm_mux *ipc_mux,
 			return;
 			}
 		trans_id = le32_to_cpu(cmdh->transaction_id);
-		ipc_mux_dl_acb_send_cmds(ipc_mux, cmd, cmdh->if_id,
-					 trans_id, cmd_p, size, false, true);
+		if (ipc_mux_dl_acb_send_cmds(ipc_mux, cmd, cmdh->if_id,
+					     trans_id, cmd_p, size, false, true))
+			dev_err(ipc_mux->dev,
+				"if_id %d: cmd send failed",
+				cmdh->if_id);
 	}
 }
 
-- 
2.42.0.windows.2


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

* Re: [PATCH v2] net: wwan: Add error handling for ipc_mux_dl_acb_send_cmds().
  2025-04-03  8:48 [PATCH v2] net: wwan: Add error handling for ipc_mux_dl_acb_send_cmds() Wentao Liang
@ 2025-04-04  7:14 ` Michal Swiatkowski
  2025-04-04 18:28   ` Sergey Ryazanov
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Swiatkowski @ 2025-04-04  7:14 UTC (permalink / raw)
  To: Wentao Liang
  Cc: m.chetan.kumar, loic.poulain, ryazanov.s.a, johannes,
	andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel

On Thu, Apr 03, 2025 at 04:48:00PM +0800, Wentao Liang wrote:
> The ipc_mux_dl_acbcmd_decode() calls the ipc_mux_dl_acb_send_cmds(),
> but does not report the error if ipc_mux_dl_acb_send_cmds() fails.
> This makes it difficult to detect command sending failures. A proper
> implementation can be found in ipc_mux_dl_cmd_decode().
> 
> Add error reporting to the call, logging an error message using dev_err()
> if the command sending fails.
> 
> Fixes: 1f52d7b62285 ("net: wwan: iosm: Enable M.2 7360 WWAN card support")
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>  drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
> index bff46f7ca59f..478c9c8b638b 100644
> --- a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
> +++ b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
> @@ -509,8 +509,11 @@ static void ipc_mux_dl_acbcmd_decode(struct iosm_mux *ipc_mux,
>  			return;
>  			}
>  		trans_id = le32_to_cpu(cmdh->transaction_id);
> -		ipc_mux_dl_acb_send_cmds(ipc_mux, cmd, cmdh->if_id,
> -					 trans_id, cmd_p, size, false, true);
> +		if (ipc_mux_dl_acb_send_cmds(ipc_mux, cmd, cmdh->if_id,
> +					     trans_id, cmd_p, size, false, true))
> +			dev_err(ipc_mux->dev,
> +				"if_id %d: cmd send failed",
> +				cmdh->if_id);

Shouldn't it go to the net-next? It isn't fixing anything, just adding
error message.

>  	}
>  }
>  
> -- 
> 2.42.0.windows.2

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

* Re: [PATCH v2] net: wwan: Add error handling for ipc_mux_dl_acb_send_cmds().
  2025-04-04  7:14 ` Michal Swiatkowski
@ 2025-04-04 18:28   ` Sergey Ryazanov
  0 siblings, 0 replies; 3+ messages in thread
From: Sergey Ryazanov @ 2025-04-04 18:28 UTC (permalink / raw)
  To: Michal Swiatkowski, Wentao Liang
  Cc: m.chetan.kumar, loic.poulain, johannes, andrew+netdev, davem,
	edumazet, kuba, pabeni, netdev, linux-kernel

On 04.04.2025 10:14, Michal Swiatkowski wrote:
> On Thu, Apr 03, 2025 at 04:48:00PM +0800, Wentao Liang wrote:
>> The ipc_mux_dl_acbcmd_decode() calls the ipc_mux_dl_acb_send_cmds(),
>> but does not report the error if ipc_mux_dl_acb_send_cmds() fails.
>> This makes it difficult to detect command sending failures. A proper
>> implementation can be found in ipc_mux_dl_cmd_decode().
>>
>> Add error reporting to the call, logging an error message using dev_err()
>> if the command sending fails.
>>
>> Fixes: 1f52d7b62285 ("net: wwan: iosm: Enable M.2 7360 WWAN card support")
>> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
>> ---
>>   drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 7 +++++--
>>   1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
>> index bff46f7ca59f..478c9c8b638b 100644
>> --- a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
>> +++ b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
>> @@ -509,8 +509,11 @@ static void ipc_mux_dl_acbcmd_decode(struct iosm_mux *ipc_mux,
>>   			return;
>>   			}
>>   		trans_id = le32_to_cpu(cmdh->transaction_id);
>> -		ipc_mux_dl_acb_send_cmds(ipc_mux, cmd, cmdh->if_id,
>> -					 trans_id, cmd_p, size, false, true);
>> +		if (ipc_mux_dl_acb_send_cmds(ipc_mux, cmd, cmdh->if_id,
>> +					     trans_id, cmd_p, size, false, true))
>> +			dev_err(ipc_mux->dev,
>> +				"if_id %d: cmd send failed",
>> +				cmdh->if_id);
> 
> Shouldn't it go to the net-next? It isn't fixing anything, just adding
> error message.

Michal, you are right. Patch does not fix a user's problem.

Wentao, could you resend the patch without 'Fixes' tag and targeting 
'net-next' tree (the subject should be 'PATH net-next v?').

> 
>>   	}
>>   }
>>   
>> -- 
>> 2.42.0.windows.2


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

end of thread, other threads:[~2025-04-04 18:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-03  8:48 [PATCH v2] net: wwan: Add error handling for ipc_mux_dl_acb_send_cmds() Wentao Liang
2025-04-04  7:14 ` Michal Swiatkowski
2025-04-04 18:28   ` Sergey Ryazanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).