Re: [PATCH RESEND net-next v2 3/3] rust: net: phy: pass a MaybeLocked device to soft_reset

From: SeungJong Ha

Date: Mon Nov 16 2026 - 08:48:24 EST


On Mon, Nov 16, 2026 at 4:33 PM <netdev-bot+sashiko@xxxxxxxxxx> wrote:

> [Severity: Medium]
> Is it sound to call genphy_soft_reset() on a Device<MaybeLocked> when the
> caller is phy_mii_ioctl()?
[...]
> The race itself is older than this series. C drivers that use
> genphy_soft_reset() have it too, and phy_mii_ioctl() is documented as
> incompatible with the PHYCONTROL layer. However, this patch is the first
> to call genphy_soft_reset() on a MaybeLocked device based on the new
> soundness claims.

As you say, the race is older than this series, and I think the fix
belongs in phy_mii_ioctl() rather than here.

> Would it make sense to take genphy_soft_reset() out of the generic impl?
> Alternatively, the MaybeLocked/Locked docs could describe the exclusion
> that the unlocked callers rely on, and note that the phy_mii_ioctl() path
> breaks it.

I would rather keep genphy_soft_reset() there, since C drivers call it on
the same path. v3 will document that the unlocked callers rely on the
state machine not running, and that phy_mii_ioctl() does not.

> [Severity: Low]
> This fixes the lock-held SAFETY comment in soft_reset_callback().
[...]
> Is that still accurate for either of them?

No. As in my reply to patch 2, v3 drops match_phy_device, and the
get_features comment will rely on the same assumption as probe.

Best regards,
SeungJong