Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Lorenzo Bianconi
Mon, 30 Nov 2026 08:31
Re: [PATCH net 2/2] net: airoha: retry WLAN initialization commands
Author: Lorenzo Bianconi
Date: Mon, 30 Nov 2026 08:31
Date: Mon, 30 Nov 2026 08:31
131 lines
11841 bytes
11841 bytes
--4NFd+x7pAE2hnf/v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
> DESCRIBE_THE_CONFIRMED_FAILURE_AND_WHY_RETRYING_IS_SAFE.
>=20
> Allow up to three total attempts for WLAN initialization commands,Sleep f=
or 10 ms between failed attempts before reporting the final error.
Can you please provide more details about the issue? What is the root cause=
of
the problem? Can you please explain why just commands in
airoha_npu_wlan_init_memory() can fail?
>=20
> Fixes: REAL_LINUX_SHA ("EXACT_ORIGINAL_COMMIT_SUBJECT")
Ivalid Fixes tag.
Regards,
Lorenzo
> Signed-off-by: Faliang Wang <faliang.wang@airoha.com>
> ---
> drivers/net/ethernet/airoha/airoha_npu.c | 41 ++++++++++++++++++------
> 1 file changed, 31 insertions(+), 10 deletions(-)
>=20
> diff --git a/drivers/net/ethernet/airoha/airoha_npu.c b/drivers/net/ether=
net/airoha/airoha_npu.c
> index 7f7cdc2553ad..6fb4eec20c20 100644
> --- a/drivers/net/ethernet/airoha/airoha_npu.c
> +++ b/drivers/net/ethernet/airoha/airoha_npu.c
> @@ -527,44 +527,65 @@ airoha_npu_wlan_set_reserved_memory(struct airoha_n=
pu *npu,
> return airoha_npu_wlan_msg_send(npu, ifindex, func_id, &val,
> sizeof(val), GFP_KERNEL);
> }
> +static int airoha_npu_wlan_cmd_with_retry(struct airoha_npu *npu,
> + int ifindex,
> + enum airoha_npu_wlan_set_cmd cmd,
> + const char *name, bool is_msg_send,
> + u32 *val)
> +{
> + int retry, err;
> +
> + for (retry =3D 0; retry < 3; retry++) {
> + if (is_msg_send)
> + err =3D airoha_npu_wlan_msg_send(npu, ifindex, cmd, val,
> + sizeof(*val),
> + GFP_KERNEL);
> + else
> + err =3D airoha_npu_wlan_set_reserved_memory(npu, ifindex,
> + name, cmd);
> + if (!err)
> + return 0;
> +
> + if (retry < 2)
> + msleep(10);
> + }
> =20
> + return err;
> +}
> static int airoha_npu_wlan_init_memory(struct airoha_npu *npu)
> {
> enum airoha_npu_wlan_set_cmd cmd =3D WLAN_FUNC_SET_WAIT_NPU_BAND0_ONCPU;
> u32 val =3D 0;
> - int err;
> -
> - err =3D airoha_npu_wlan_msg_send(npu, 1, cmd, &val, sizeof(val),
> - GFP_KERNEL);
> + int err =3D 0;
> + err =3D airoha_npu_wlan_cmd_with_retry(npu, 1, cmd, "band0_oncpu",1, &v=
al);
> if (err)
> return err;
> =20
> cmd =3D WLAN_FUNC_SET_WAIT_TX_BUF_CHECK_ADDR;
> - err =3D airoha_npu_wlan_set_reserved_memory(npu, 0, "tx-bufid", cmd);
> + err =3D airoha_npu_wlan_cmd_with_retry(npu, 0, cmd, "tx-bufid", 0, NULL=
);
> if (err)
> return err;
> =20
> cmd =3D WLAN_FUNC_SET_WAIT_PKT_BUF_ADDR;
> - err =3D airoha_npu_wlan_set_reserved_memory(npu, 0, "pkt", cmd);
> + err =3D airoha_npu_wlan_cmd_with_retry(npu, 0, cmd, "pkt", 0, NULL);
> if (err)
> return err;
> =20
> cmd =3D WLAN_FUNC_SET_WAIT_TX_PKT_BUF_ADDR;
> - err =3D airoha_npu_wlan_set_reserved_memory(npu, 0, "tx-pkt", cmd);
> + err =3D airoha_npu_wlan_cmd_with_retry(npu, 0, cmd, "tx-pkt", 0, NULL);
> if (err)
> return err;
> =20
> if (of_property_match_string(npu->dev->of_node, "memory-region-names",
> "ba") >=3D 0) {
> cmd =3D WLAN_FUNC_SET_WAIT_DRAM_BA_NODE_ADDR;
> - err =3D airoha_npu_wlan_set_reserved_memory(npu, 0, "ba", cmd);
> + err =3D airoha_npu_wlan_cmd_with_retry(npu, 0, cmd, "ba",false, NULL);
> if (err)
> return err;
> }
> =20
> cmd =3D WLAN_FUNC_SET_WAIT_IS_FORCE_TO_CPU;
> - return airoha_npu_wlan_msg_send(npu, 0, cmd, &val, sizeof(val),
> - GFP_KERNEL);
> + return airoha_npu_wlan_cmd_with_retry(npu, 0, cmd, "force_to_cpu", 1,&v=
al);
> }
> =20
> static u32 airoha_npu_wlan_queue_addr_get(struct airoha_npu *npu, int qi=
d,
> --=20
> 2.43.0
>=20
--4NFd+x7pAE2hnf/v
Content-Type: application/pgp-signature; name=signature.asc
-----BEGIN PGP SIGNATURE-----
iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCaw00SwAKCRA6cBh0uS2t
rLMtAP9Ca9b4m5SlMHR3657aaj3AGE7y4O7k5GetMKyrAlkZRQEAuOGeFros8sKl
Zl+cDCMg9vA2utK5K5snS2UsiJTEXAs=
=1uSI
-----END PGP SIGNATURE-----
--4NFd+x7pAE2hnf/v--
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads