Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795954562; b=x66O9PsaoXRbbSNzUQfLSDRA/rYxd0KvsXa8XHSJ03yr2zpqK73XB42TF3UL3VS74F/k cbsmQYeoG/Y15/ckMrK4n4oq50WcoQEN69iaVm7By8hEaUxxHTfSsNb9JJ3akj4WsIWhf ugpTT0rL/OjhXW3YIu7lDUjIeS30C6DjnGZzD2lDajrhXc24nSCm7oFXSAapNhVQkJyJ2 9stDPHct10/4n0gZw2p8oXzKvOHGJFhkVYpH11rvzfzopRhUcWoe94rIgwWta0Y/iEsEY fkUh174Q4nX78z/6sIzb/ftvNesYwnUsAhMM1MhHfueYyuXT6IvRklrds7wArNF2atQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795954562; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=eoq+XLagegkKeEubOrvigVafm3GQfqk/3GITUD1FIVg=; b=dXizmbK9nKUTiVnUQpf8uCDOr6aSSBbQY25iFUad5nzN68IT9uLN6RbnMgwWctCocrZC CAVhkSXP8chUjfRNHAn7tCDL0+GoW8t7bcprpqx2jveRnAsUroVGt+UfFfeth8p5t4jap nF9itt2Ep2yX+JdF4yn1XiLOlCVArwpOFtrmG1Q79Kug5ca1qukGUQWJjoV86rLfdCLjm CfZIyVKfgezhTZX1Z7ikb5UDHPJeLRPTAgrwD2syhV+Vkpdh2vnRuwY1C0p18urVaQj9/ nMAi+ZkaUFclHloRBOQRMyRjWzYiOAb+CPhqAxlUNhlaejHiHvfOmnX3M/gFyK4C37w== 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=cm6yfbg9; arc=none smtp.remote-ip=100.103.45.18 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 45999606A31C for ; Sun, 29 Nov 2026 12:16:02 +0000 (UTC) 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=cm6yfbg9 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F00651F00919; Sun, 29 Nov 2026 12:15:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795954561; bh=eoq+XLagegkKeEubOrvigVafm3GQfqk/3GITUD1FIVg=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=cm6yfbg9SOgs1qsFsLKKtCt4B5BYO6vWA3r4X6mHR9YDuFIdA+tmUFGvhM7jv6V/j aODi9tC8/PAjPF/f1VGxxox87O3vCckN/5l8CP/XhaWF297+hk0VWNTW57R6LxThln ISUobese5F/zUd/UlefudtepEJbIgRviqSGQIPci/pS+lt9Qw3ZZkEvq0mS8/hPWxK +Nc7Ny1EEm08b2ckMUuhVRnUt/maywVlV7r83+Mb8/g9DyAS8BvQquZ16KPX4ACg6L EdZxzvfxapKtdHxMFWdKOfIEpJSv1Y2rP86CIq7Ut/UCqdEqx/vuvAH6vcaJ9zb5hV BYFVbNfVtXQEQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net-next v6 2/2] net: pse-pd: add LED trigger support via notification path Reply-To: sashiko-reviews@lists.linux.dev To: "Carlo Szelinsky" Cc: linux-leds@vger.kernel.org, lee@kernel.org In-Reply-To: <20261128121525.3909836-3-github@szelinsky.de> References: <20261128121525.3909836-1-github@szelinsky.de> <20261128121525.3909836-3-github@szelinsky.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 29 Nov 2026 12:15:58 +0000 X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] net: pse-pd: uninitialized or stale admin_state_enabled in pse_pi_get_states() -- commit 2a4f233cb7c3e4753e63b541d451694d1abc8a64 Author: Carlo Szelinsky net: pse-pd: add LED trigger support via notification path This commit adds per-PI "delivering" and "enabled" LED triggers to the PSE core and updates them on PI state changes and notification events. > diff --git a/drivers/net/pse-pd/pse_core.c b/drivers/net/pse-pd/pse_core.c > index 2fb10f5d8f8e1..0e8584567042b 100644 > --- a/drivers/net/pse-pd/pse_core.c > +++ b/drivers/net/pse-pd/pse_core.c [ ... ] > +static int pse_pi_get_states(struct pse_controller_dev *pcdev, int id, > + bool *delivering, bool *enabled) > +{ [ ... ] > + /* Under software power control, the hardware is off until a PD > + * is detected, so use the admin state the core keeps. > + */ > + if (pse_pw_d_is_sw_pw_control(pcdev, pcdev->pi[id].pw_d)) { > + *enabled =3D pcdev->pi[id].admin_state_enabled; > + return 0; > + } [Severity: Medium] Can pse_pi_get_states() read an uninitialized pcdev->pi[id].pw_d or a stale pcdev->pi[id].admin_state_enabled under software power control? In pse_controller_register(), pse_led_triggers_register() runs before pse_register_pw_ds() populates pcdev->pi[id].pw_d. If an LED with a matching default_trigger activates during trigger registration, pse_pw_d_is_sw_pw_control() sees pw_d =3D=3D NULL and queries ops->pi_get_admin_state() instead of admin_state_enabled. Even after pse_register_pw_ds() runs, pcdev->pi[id].admin_state_enabled remains zero-initialized until a consumer calls of_pse_control_get() -> pse_control_get_internal(), which then initializes admin_state_enabled without holding pcdev->lock or calling pse_led_update(): drivers/net/pse-pd/pse_core.c:pse_control_get_internal() { ... ret =3D pse_pi_is_hw_enabled(pcdev, index); if (ret < 0) goto put_module; pcdev->pi[index].admin_state_enabled =3D ret; ... } As a result, the "enabled" LED trigger can stay out of sync with the actual admin state. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261128121525.3909= 836-1-github@szelinsky.de?part=3D2