Article View: linux.kernel.netdev
Article #24473Re: [PATCH net] net: airoha: deinit PPE on offload setup failures
From: Lorenzo Bianconi
Date: Mon, 30 Nov 2026 08:20
Date: Mon, 30 Nov 2026 08:20
87 lines
10602 bytes
10602 bytes
--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 <zhiqizhangg@gmail.com>
Reviewed-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
> 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--
Technical Details
Message-ID:
<aw0xwMYgf3Xxudwx@lore-desk>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374002-linux-kernel-netdev=dewy.ruReferences:
<20261130074419.98169-1-zhiqizhangg@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374002-linux-kernel-netdev=dewy.ru From: lorenzo@kernel.org (Lorenzo Bianconi) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net] net: airoha: deinit PPE on offload setup failures Date: Mon, 30 Nov 2026 09:20:16 +0100 Organization: Usenet Network Message-ID: <aw0xwMYgf3Xxudwx@lore-desk> References: <20261130074419.98169-1-zhiqizhangg@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="h8BXUAuSAevFl+pp" Injection-Info: usenet.network; logging-data="1374449"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:NPlJcbCPaxGV0uXm3Q7QBocG7DM= sha256:NK4kSr2xYnxAZen0x6wInb4VXP6MDk/CXE5lbeClF6U= sha1:mH7Xq6eQgfJ3urtDC33bdxTgaoQ= sha256:Z56/mZ69n2ZCQiLYmDgdkXzAXmRt5tANbV4fpy7thLU= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 424E1125FCD; Mon, 30 Nov 2026 11:20:35 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1r_DjoUGKK9H; Mon, 30 Nov 2026 11:20:32 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-374002-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 26A55125FCB; Mon, 30 Nov 2026 11:20:23 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 1FEC124928; Mon, 30 Nov 2026 08:20:21 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796026819; b=3GmdlKBV53Xaca00J+/HRQzfwX7vfI/lPnd2azXhKRM2xp5ozp/rM2kVM3UJk8pQGPtb Dmniuy7V1CU7BSjT7sU3tNoz+wOeWcoqAmtFlbBah1Ios9ISFx1iAYQ5ZRMVHS4okYJCn 83EW+WngCeJR4LBpentuvhKF5hUvt/RT4eD3t3ATVlT9dqBRzAPyQgnkuEAVFLQoWrJuX prMy8EY4z9U25NC57Q0ZEOhOk/o41aztalqZh9pYeWUsZj7GFO3TfuYOPTaZ8W7dQQR1f kLJILz65fRSj0dH8uy1KQMHbVxiTpjxyurLWWcGlX4Lx8vqXbmNPFTnScLxA/gTG/PQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796026819; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=58GK3ft0sDkjl98W6/C6CFvzdwKlbW+HsgmlAPK7aX4=; b=zfcn5sxs6WapuhLjahANJXgqy476uPmH3qaawR3sXJ4MlS1ZKdeQjjqQk7VJCz80FmXp BR1//g2PIVYcLTlIBEMNExWWCdyYHBCQxLkXwExpuqC4AQ2tFHXk0dbzq3FGj3ImQ3n5m HtkuCtX0CE2phTFeOW57YHynM58dOxuPPriYu4wOxssf9aTp2854Qk59d8dE6m/TKuDne INsJcCYXarc5StITlThI21tnI5nrkwzVTKKkum5JLM1Bm27gzQTLVhYQcu98XmcxGEJsJ wdMfyngdIHJCjcp42oR9W6l3EoOlJBcoxH1dicDolomw9ApRhAstrP5djxZYd2Sm2Ig== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IjsNicEd; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D33A0606A684; Mon, 30 Nov 2026 08:20:19 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IjsNicEd X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796026819; b=al/qJa8S7WHNyKafNU3D+oR/xlT7Y81K9qYTMMSIsKJ9nkFDj27D96omI0sKT7MFYldg oF41SuhiFJ3rku7H11yjVT1HRvs8gmjtjbRtjyr0t75wOZL5Xjga7Do65OXkSyJI/QrmQ o6hiYm9E1RCAORM25joSklsuRkUuNMvNwyxC6X1azLpA8eA6JrfnayueXbx8OdvZM5gTa CXuDKSB6FzZL4QgJdKnSFTyKvPK+QA9AVBdT7c6n7cl6QZcT0wMSW4mwcQF77P58UBBF8 negiGvRHVQVyIwWmJAKcSVA37MslaHMep+VYlGBF+3L01MTx6WTwvuQHFfHannVcNpg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796026819; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=58GK3ft0sDkjl98W6/C6CFvzdwKlbW+HsgmlAPK7aX4=; b=c+/DGWizt3gDN2fKpXAkZ49UbqS612ESL/4F2rzSzShrnRCqkoAmb4noA3gDaa7DJddT GWhyK+ANa4/E/pmuVn5PYq1gepD94Xjt2aBDT/BU1iO1IJIscG40gY6L+J2OyLwbpzh4C RhzzgJfs9gbFxGtqlxZe31tdc6/pPqXP2GdnmuLbyWnND5NVr+VO2VmEbcaj63uKRCKSD fkpFzBAEyfQPPalqLGEGfm2iYJumn1SFinrN8ml7UHeCphwkOzObi8w6/4FLzXZn3Ezpr 3gCn7f5wcsRn8xvNVjhOVgX2D+eDfH7bNIfyLHO72pKBgiRSa+kEojPkhXdT1o5BUXg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IjsNicEd; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E75D6606A686 for <netdev@vger.kernel.org>; Mon, 30 Nov 2026 08:20:18 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id E86651F0089C; Mon, 30 Nov 2026 08:20:17 +0000 (UTC) X-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== X-Cc: Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, netdev@vger.kernel.org X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261130074419.98169-1-zhiqizhangg@gmail.com>