Re: [PATCH net-next v18 07/10] net: phy: phy_link_topology: Add a helper to retrieve ports

From: Maxime Chevallier

Date: Wed Sep 30 2026 - 09:25:07 EST




On 9/29/26 02:38, netdev-bot+sashiko@xxxxxxxxxx wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue(s) to consider.
>
> Critical: 0 · High: 1 · Medium: 0 · Low: 0
>

>
> [Severity: High]
> No reference is taken on the returned port. The only thing keeping it
> alive is RTNL, and ASSERT_RTNL() only warns. The commit message states the
> rule as "the caller must hold rtnl until it's done with it".
>
> Do all the paths that erase and free ports hold RTNL?

Nope, but really this isn't that simple, unbinding a MAC/HY with an SFP
module that itself has a PHY isn't straightforward, we deadlock if we
grab rtnl as the SFP cleanup path also acquires it.

unbinding is a blind spot for the PHY-in-SFP case it would make sense to address
that as a separate work :(

Maxime