Article View: linux.kernel.netdev
Article #11579Re: [PATCH net v3 08/14] net: pse-pd: stop async event sources before freeing PI data in unregister
From: netdev-bot+sashiko
Date: Thu, 05 Nov 2026 10:08
Date: Thu, 05 Nov 2026 10:08
67 lines
10640 bytes
10640 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] net: pse-pd: spurious error event in pse_isr() on -ENODEV
during unregister
--
> diff --git a/drivers/net/pse-pd/pse_core.c b/drivers/net/pse-pd/pse_core.c
> --- a/drivers/net/pse-pd/pse_core.c
> +++ b/drivers/net/pse-pd/pse_core.c
> @@ -612,6 +612,13 @@ static int _pse_pi_delivery_power_sw_pw_ctrl(struct pse_controller_dev *pcdev,
> struct pse_pi *pi = &pcdev->pi[id];
> int ret, pw_req;
>
> + /* pse_isr(), a priority change and the retry after a disable all
> + * power a PI through here, so stop them here once unregistering
> + * has started.
> + */
> + if (pcdev->unregistering)
> + return -ENODEV;
> +
> if (!ops->pi_get_pw_req) {
> /* No power allocation management */
> ret = ops->pi_enable(pcdev, id);
[Severity: Medium]
pse_isr() can report a false power control error during unregister.
Say the threaded pse_isr() is already blocked on pcdev->lock when
pse_controller_unregister() sets pcdev->unregistering and drops the
lock. It then takes the lock while disable_irq() is still waiting for
it to finish.
For a classification event on a PI with admin_state_enabled set,
pse_set_config_isr() calls _pse_pi_delivery_power_sw_pw_ctrl(). That
now returns -ENODEV at this new check.
pse_set_config_isr() only clears -ERANGE, so -ENODEV goes back to
pse_isr(). pse_isr() treats any non-zero return as a failure and sets
ETHTOOL_PSE_EVENT_SW_PW_CONTROL_ERROR for that PI. It pushes the event
into pcdev->ntf_fifo and schedules ntf_work before cancel_work_sync()
runs.
If pse_send_ntf_worker() is already running at that point, it can
pick up the entry and send it through ethnl_pse_send_ntf(). Userspace
then sees a power control error for a PI that did not fail; the
controller is only going away.
This is not a memory safety problem, since disable_irq() orders the
queueing before the drain, but the event is misleading.
Should pse_set_config_isr() filter the -ENODEV from the unregistering
check the same way it filters -ERANGE? Or would you rather have
pse_isr() skip the PIs once pcdev->unregistering is set?
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261103220217.1131971-1-github%40szelinsky.de
Technical Details
Message-ID:
<179387331572.488856.14138423432886028016@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357205-linux-kernel-netdev=dewy.ruReferences:
<20261103220217.1131971-9-github@szelinsky.de>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357205-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v3 08/14] net: pse-pd: stop async event sources before freeing PI data in unregister Date: Thu, 05 Nov 2026 10:08:35 +0000 Organization: Usenet Network Message-ID: <179387331572.488856.14138423432886028016@kernel.org> References: <20261103220217.1131971-9-github@szelinsky.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3611856"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:lNwAVY98AwJkhh6oPqZW7YB7jOA= sha256:I+pD2BeJzz2NpASqHuxcDqdINMbcCpaAu32SA5Hbc78= sha1:FtX4WaUAkdN9ylUT2CTUd7C4lMg= sha256:KdXsklEHrwHL0xXviBd8M4eWQduIbAp1X6MsOiFYpBY= 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 1DA00112F02; Thu, 5 Nov 2026 13:25:05 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, 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, URIBL_BLOCKED=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 Hxg0-RWHlb5R; Thu, 5 Nov 2026 13:25:01 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-357205-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 11233112EF5; Thu, 5 Nov 2026 13:24:53 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id B90EE2E088; Thu, 5 Nov 2026 10:12:26 +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=1793873319; b=kXk/wvENofoC1iH2eu+WLHZLkQSY+rQ9fL4NrxEmBjEX/GVpLqmiAUBAuI3ddwWDTMnZ xP4Y064+auk9+5P4efhNGFd4BusFScRRVVxDCXHtIOdzuZhrcbhRwt4odakHNzckukgfz 3FF8SdOjzM+H4KImQsY8H42QKzpVYWrUaqrbVcnmQk/mY4sz/5IlpzxtcuDBIgZ5u4bMs 2h2XtpxUipl9DhV2ENqemwMDSGk3GZB/pU8NZ1zjNA2qAve9CBRRsBQCbGO/Wpc0xxHhY pysm6lihvE1ec5kz2gdgoceXQPqb7j1Nru+lck25og+Vo49K5Va7lKuT3r8h3/KKxYw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793873319; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=N6AE4P7gJc5QCWHdSGV8OXNHdYwxH3AcE81yYUGoqK0=; b=XS//GIuzKnwmen/T8x4B+kyDlISE4wE0WLmggOulAIQNuyr+VkCHDE2t0u9XfTUbFr+/ KOoOzayXX6SzkvS8soNbASuVV57o2TT14DVHR9t1jqITC+LKe+RYTm7M8+dmQAxcUIIAV eIn7kLfFWUdrCWniXlinO5P5jlZi4vJ08ymdPIL1gao1s39RdLlJSRNpSm/sMc7FhMlCI H3zaUrYdLCYngVfUT9b8lL0wRdEyV4c2AL+kkZEoXOfrntGU+Ub0cqvyDcgiGSe31iEmL bLqV92mlsIuK211hzZFX9Iv9nTQAeuskb/3oBwB6vcTihHb7BQWQCaV0bOG3y6H2Crg== 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="OQ+pAV/5"; 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 EA31A6083636; Thu, 5 Nov 2026 10:08:38 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OQ+pAV/5 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=1793873317; b=rKgVIK89U33dbwWP/lu6V4yzOQUvEMT7VCoYWzyLfJXiFSIDhD1QSWmx1dqrDIpxBkNO 1LAaLuulfg7vopEnlJFMF1Kr0ZeHnZ94F5Z/WYcD6UW3LJ5CNJuDFH7Smcjewyetu+76j oQR9YsX7uHyFfuuR4ZHDbieZcIEJwo67u/1T8TW03svbIqKj7V4HL3j6HUe8gM/bxjKU1 y9VgMGZRFnCQiTdkRNhPtI1xaMvQ2i0X8WB5N3a/tR+MAHHoymXxry8n82wuCs5/Ky8VC 4YXyZ2mC30o0OlqjvY3L6af36tIDtpchvvq4dnujHm/XbKypEbMySiPypONQqgFlmuA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793873317; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=N6AE4P7gJc5QCWHdSGV8OXNHdYwxH3AcE81yYUGoqK0=; b=qTXFp/A6zcc+s2PYm3LH06NFm+b/1xzoP6HOHqA0qTSdNBLZV0NqDs3OMtyaBKWKeGIK zWBQW+m0EIfE+Pi+Rcf5Ui9z2Tqr/hVhzWuhDNSLgE/dXF+cmTLwCI5If4PATkkaxs4yw Hjw2eHJ1o5vnZvOqXeyfcxlx/lgzftRTOQcJ/CY/hnxaLEfZSpBPUpuH1yYFxkY1CMQLT u5ACDci48njKlhjEGsBsHDRpnxZJDRe/NyVG0rdzdXOf1UqQ3Ox/TldCQVYxiRU7c5s2e KPOItRh/Smv/c8M8LFNrWE5mfGC9yws6rbIc657/RrYzZiTkluhUqVgaakgbIMM47AQ== 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="OQ+pAV/5"; 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 72A77608362C; Thu, 5 Nov 2026 10:08:37 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C7B31F000C1; Thu, 5 Nov 2026 10:08:36 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793873317; bh=N6AE4P7gJc5QCWHdSGV8OXNHdYwxH3AcE81yYUGoqK0=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=OQ+pAV/5YXN/zn0H23OPLUQodmXHXDzbfWmosc0j8sSJMXLjM3GSjGUVnRqS6dIkv gm6akoUHbpcj/iih6S7yrSymd0dsRnPu/ieH5ehSXsHNFHE0NvFGGW4l44XpXegmgX oA6unzJUntQ3WE7QcL6GA3BuyBTEpGBUtntqtKpdeEBav+3diXVdEygDrRIrLNQfgl OgVq20krqxXzfLBUNjG+Qo6Lrcvtvn/9i2vooG33vXqMqWn+Mrrmgx3uZ0EmT8fpVN 0PwNE/qoyryhUsGcazja8U1oPuu5LjMhWvM7+X4mV/wT7QpnhD1IAfnEBiYLMBi/Fo 1+P/mFwcvHZ0w== X-Cc: o.rempel@pengutronix.de, kory.maincent@bootlin.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, broonie@kernel.org, lgirdwood@gmail.com, maxime.chevallier@bootlin.com, kyle.swenson@est.tech, ross@r-sc.ca, netdev-bot+sashiko@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-In-Reply-To: <20261103220217.1131971-9-github@szelinsky.de> X-sashiko-severity: Medium 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