From mboxrd@z Thu Jan 1 00:00:00 1970 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=1796089856; b=hTARPjcNfUhIWiJcYPxqazr3+den/zqeD0yWPcHO52+rYTbHCcABDecmTfIyct5zVeX/ IJ/FgwLA5o+hpwZBQ8bJ8h+dg2JHpYQ2sq5hKZNhsfiGReU4f1QkAnVW02RFALM2tMDoG w7JVe9T280/OhYA7rosHgzjPcAoZKWOF52yiyDNWAD12EBaSGJqo6XmHg5yLPQPk+nQ8q mlgpI2wV250oP95zTIBcziHdpXXWcnOtltlWe7CuLOefC23//UgM8taZ7fWZ6/t2r6sZx 9jaTjHUkaxdk3tJY68mtX27fikyDtQjrl0yePciefcBpF4sKffQl1svTNc01HtbVisA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796089856; 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=ZBM9gpcKXcfc3Smm/RZ0+h+4GF0oJSilG0a1K9u3KYU=; b=V+Z/JdTqUE5+1x0LdwANd8fGxoFy3T3EEkhQvMZNegCrEJaFXLJeoTWeRdnkuP9hRops FFKLjq76JgpmILLll61xxYWPO5CfAzboiDfhwlhHgFDVehgjyCLkTGnNPuVlRR34FgM9n 5fQ68no0mY7uMDSfyfLeNE8DYA5JoT3YwSQzEtgxYf6oZhWV3q4Oyvfrbn2oQ/2voiwam N1Df+b47ivHjtzU9WASsAY4PaUfKXQQUnX4mO2gYxBqqz0FvzxJYgYwsW5AxuExD+O6ea LONbx4Lngk1adxJjNrKSxP4IimXQ5M/53n1m6V8CBBNA8pybM0ki0bJixs0kVahgTkQ== 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=gaVOGwgF; 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 E327D606A339 for ; Tue, 1 Dec 2026 01:50:55 +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=gaVOGwgF Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02CEC1F00893; Tue, 1 Dec 2026 01:50:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796089855; bh=ZBM9gpcKXcfc3Smm/RZ0+h+4GF0oJSilG0a1K9u3KYU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=gaVOGwgFdUWfVYSSkAbbxAdWzSOnb/osg6J+W3Ru6/olT7DpxpxdkFJDRHNDpM/bW Tvwyv+Xd3+R9fzx3eL4Y1M+4KX5h45VqKWNsr8Vl4XXwS2yTOkCSZBStgzudpEcyOw rBEHrWC/mVw9WNxIizSKD6W29JH1K0Avk0gAnvzQlttgqVKBStCRAHMjG2SnvTugy7 1KvyuW87EsCViKwKWHaHpGnlBD12xXBhV3JJokTYw2IsGJsqM+SKuXvwUoop3gpSuE FXG/b41DSG4SAxht7qQFUYaxbKLq1J/rQTEq/IWldr1EUk13H8yfkrXMlaGBOlN31F msIEe5Ur3pAkw== Subject: Re: [PATCH net 07/14] net: phy: as21xxx: Write IPC payload under ipc_lock From: netdev-bot+sashiko@kernel.org To: cristian.ciocaltea@collabora.com Cc: ansuelsmth@gmail.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, kernel@collabora.com, netdev@vger.kernel.org Date: Tue, 01 Dec 2026 01:50:54 +0000 Message-ID: <179608985454.3146.10885911079866736742@kernel.org> In-Reply-To: <20261130-as21xxx-fixes-v1-7-1bd2eae6ccbc@collabora.com> References: <20261130-as21xxx-fixes-v1-7-1bd2eae6ccbc@collabora.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] The commit message describes a race that cannot happen on any current path. -- net: phy: as21xxx: Write IPC payload under ipc_lock This patch moves mutex_lock(&priv->ipc_lock) in aeon_ipc_send_msg() above the loop that writes the VEND1_IPC_DATA registers. The payload writes and the command issue are then covered by the same critical section. The argument checks stay outside the lock. > aeon_ipc_send_msg() writes the message payload to the shared > VEND1_IPC_DATA registers before taking ipc_lock. Two concurrent > senders may interleave, so that one overwrites the payload of the > other before the corresponding command is issued. The firmware would > then execute a command with the wrong arguments. [ ... ] > Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs") [Severity: Low] Can two senders actually overlap on any current path? In drivers/net/phy/as21xxx.c, aeon_ipc_send_msg() has only two callers: aeon_ipc_get_fw_version() and aeon_dpc_ra_enable(). as21xxx_probe() calls them one after the other, on the same thread: as21xxx_probe() { ... ret = aeon_ipc_get_fw_version(phydev); ... return aeon_dpc_ra_enable(phydev); } That same probe allocates priv and priv->ipc_lock for each phydev, and the driver core serializes probe of a device. The only other IPC user is as21xxx_match_phy_device(). It uses its own temporary priv and mutex, sends only zero-length NOOPs and never writes VEND1_IPC_DATA. It also runs before probe. The later patch in this series, "net: phy: as21xxx: Configure autoneg advertisement via IPC", adds runtime senders from as21xxx_config_aneg(): aeon_set_top_speed() and aeon_restart_aneg(). Those paths already hold phydev->lock: - _phy_start_aneg() has lockdep_assert_held(&phydev->lock). - phy_speed_down() and phy_speed_up() take phydev->lock around phy_config_aneg(). The code change looks fine as hardening, because the lock now covers the whole transaction. Could the commit message describe this as hardening, or as preparation for future runtime IPC users, rather than as a fix for a firmware misconfiguration that can't currently happen? Should the Fixes: tag also be dropped, so this isn't picked up for net and stable as a bug fix? -- Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc%40collabora.com