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 AC6C8606A33D for ; Mon, 30 Nov 2026 08:20:29 +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=kXy7uFnm; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IjsNicEd 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=58GK3ft0sDkjl98W6/C6CFvzdwKlbW+HsgmlAPK7aX4=; b=kXy7uFnmL/AFHMTDODpLxPZG22 k4iX7F0ZB+Mc7bn5HVhZHvUJMBz79XST9G88uczU9dNde9t+bWpU2gPPzVGS/z6Ej8vyfG0EIhEhz Puk7YVZq0yZITvtX14JfGWgf/w6AbkNaG0CfBCRP7Nd3SZQl7jW6IoErQDh1TAt2YaIOrTsQ919w2 ahKUn/0pcMPfaHvAGbXSaC1L5y/8zdNVo2YuTbD1hFExFvrr4pw/bUp8YXYnn3Ym+r7vAXJ3cZ/D+ OHdrKsrwzn/fN2e+0wJ3F0laoFrVrsk+Vks5XIcZfAUvkSbi9yfIccFIb/Wm3AfIRIe0sQVfu0HIE eyDY1oSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXwcW-00000003itT-1igv; Mon, 30 Nov 2026 08:20:20 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXwcV-00000003it7-2F5i; Mon, 30 Nov 2026 08:20:19 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id CC3D561D32; Mon, 30 Nov 2026 08:20:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E86651F0089C; Mon, 30 Nov 2026 08:20:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796026818; bh=58GK3ft0sDkjl98W6/C6CFvzdwKlbW+HsgmlAPK7aX4=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=IjsNicEdXcV7MJLa75RIWh7ZuBb/36r60gn3pzWxerbAwFoK7v8vBFaFMbu8SuJwc khgYS/aY5UdFpPLgsBa6tBuCTgwZMFHm4xoaGBnQwge2UFvj0ahbGkWFkZWxAHtmcP wBWH0DSFsOi0YJoEydMICPhw7Kb//Me6wfHG8+KXMVg/IaO4u1kkZ95FmG7VwyirU+ vLL3vwWWWBOe3mi/ILgdc98v2w7S/ip3WYfONL2/xt8ai1KRFYo8TliBIyjwqGOxXY iZF/jZ9S87g55BO078SwNLRWlfH4Hzb+NJQomVle40MONZUvRpxaVDG08L8Llq6dr3 fk3p7xh232YMw== Date: Mon, 30 Nov 2026 09:20:16 +0100 From: Lorenzo Bianconi To: Zhiqi Zhang Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, netdev@vger.kernel.org Subject: Re: [PATCH net] net: airoha: deinit PPE on offload setup failures Message-ID: References: <20261130074419.98169-1-zhiqizhangg@gmail.com> X-Archived-By: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="h8BXUAuSAevFl+pp" Content-Disposition: inline In-Reply-To: <20261130074419.98169-1-zhiqizhangg@gmail.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" 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=unavailable 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 --h8BXUAuSAevFl+pp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > airoha_ppe_offload_setup() calls the NPU PPE init callback before > waiting for the firmware-side configuration and before initializing flow > stats. >=20 > When either later step fails, the error path only drops the NPU > reference. That leaves the PPE side initialized even though setup did > not complete, while the normal teardown path calls ppe_deinit(). >=20 > Run the PPE deinit callback before dropping the NPU reference on those > failures, matching the successful setup teardown sequence. >=20 > Fixes: 105ce7ad57e4 ("net: airoha: npu: Add a NPU callback to initialize = flow stats") > Fixes: f3206328bb52 ("net: airoha: Wait for NPU PPE configuration to comp= lete in airoha_ppe_offload_setup()") > Signed-off-by: Zhiqi Zhang Reviewed-by: Lorenzo Bianconi > --- > AI assistance disclosure: I found the bug. Codex modified the code. > I reviewed the change. >=20 > Build-tested with ARCH=3Darm64 allmodconfig object builds. > I did not test on hardware. >=20 > drivers/net/ethernet/airoha/airoha_ppe.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/ethernet/airoha/airoha_ppe.c b/drivers/net/ether= net/airoha/airoha_ppe.c > index f5369c4576..35754f8d2d 100644 > --- a/drivers/net/ethernet/airoha/airoha_ppe.c > +++ b/drivers/net/ethernet/airoha/airoha_ppe.c > @@ -1450,14 +1450,14 @@ static int airoha_ppe_offload_setup(struct airoha= _eth *eth) > /* Wait for NPU PPE configuration to complete */ > err =3D airoha_ppe_wait_for_npu_init(eth); > if (err) > - goto error_npu_put; > + goto error_ppe_deinit; > =20 > ppe_num_stats_entries =3D airoha_ppe_get_total_num_stats_entries(ppe); > if (ppe_num_stats_entries > 0) { > err =3D npu->ops.ppe_init_stats(npu, ppe->foe_stats_dma, > ppe_num_stats_entries); > if (err) > - goto error_npu_put; > + goto error_ppe_deinit; > } > =20 > airoha_ppe_hw_init(ppe); > @@ -1468,6 +1468,8 @@ static int airoha_ppe_offload_setup(struct airoha_e= th *eth) > =20 > return 0; > =20 > +error_ppe_deinit: > + npu->ops.ppe_deinit(npu); > error_npu_put: > airoha_npu_put(npu); > =20 >=20 > base-commit: 25faec9ce61c01fb45abf812a222c5b43c3cd5c5 > prerequisite-patch-id: e29c14650c775fee7e7fa5755614582933aa0b48 > --=20 > 2.54.0 (Apple Git-157) >=20 --h8BXUAuSAevFl+pp Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCaw0xwAAKCRA6cBh0uS2t rGZLAQDJuNr1Q+iyz9pGWYxduhc1KXarTckLtkF8ac6NZlY8iAD+MB2V2ja8Vvew snXoOkRASpgDqCuhCMCiJqBkIWD2mgE= =IYaq -----END PGP SIGNATURE----- --h8BXUAuSAevFl+pp--