From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E73B606A31C for ; Mon, 30 Nov 2026 08:31:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=lacECUdp; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CotP1KgO DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=pA6gqy2r2KaE6R4mPD1M1TSWPBcdqhRCYzPjs7eZ3cY=; b=lacECUdpHZvGV7ahTaVcoAGb2O 1/1ct/o6Ul2eYEb0WwQT41XolrbloDk8rDirPbDWtzpanarL3DQ5hnICbi6fY4KP+py4/2TIPn0lk 5n8lT0tYtHrWrDFV2QdtA13u1/s0rK9OAKBmo3/7YIg5hpRVFH1sFy7D4qaV6JUbkCA5WRD0y6zHR ceP3s17KV93Wj0xKWf+3Y9G6uZh0LpwMFtj17LL2wObR+BnSvmfiYcsLkkkSYangaavn0KfhTQBpx FvB9MSkEMw9mwdnP7CPIFejgqosffxQguc8C5XPriuHqGJdQkHEZlszSU+s+uifYB59v4GJ5Mqagr cJE0zv/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXwn3-00000003lbV-41AI; Mon, 30 Nov 2026 08:31:13 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXwn0-00000003laj-3MEl; Mon, 30 Nov 2026 08:31:10 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 713DA40BDE; Mon, 30 Nov 2026 08:31:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 699811F00897; Mon, 30 Nov 2026 08:31:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796027469; bh=pA6gqy2r2KaE6R4mPD1M1TSWPBcdqhRCYzPjs7eZ3cY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=CotP1KgO201q3p0o7gVYxaTqPVljLqlJV6gLxYw4VAP4WIAnaTT7ld6z/XhkdYRUx 9WMnvXkdWE+mMjn15ZNZGm8rZgdGZp9fCkrVQb3E99D0UmwEYhmZVO8LdvtDTLX61d G8js/xZBfE1ZC0oRVKsrOwDEt81nq6A8QS5XItsj5Qxp1H082kV1X3dXrd+qhm2vYK rJVG+kg8cPzbp9aXRm1m/82kuLlp/U8JJQJN58d3KuzwMtDup+O4lXLmBMnzmTSL3B JIVeWvly/aqOtphAQgaO9OCtRyesIa2DLt7NIYKUdfz0uk1HA6MAmIGaIDlOZzuZbt hJMQPTVa7QDHQ== Date: Mon, 30 Nov 2026 09:31:07 +0100 From: Lorenzo Bianconi To: Faliang Wang Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH net 2/2] net: airoha: retry WLAN initialization commands Message-ID: References: <20261130034106.869059-1-faliang.wang@airoha.com> <20261130034106.869059-3-faliang.wang@airoha.com> X-Archived-By: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4NFd+x7pAE2hnf/v" Content-Disposition: inline In-Reply-To: <20261130034106.869059-3-faliang.wang@airoha.com> X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 --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 > --- > 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--