Re: [PATCH net] bonding: fix missing down path on speed/duplex failure after FAIL->UP

From: Hangbin Liu

Date: Sun Oct 25 2026 - 20:57:16 EST


On Fri, Oct 23, 2026 at 03:35:57PM +0300, Timur Stukan wrote:
> On Fri, 23 Oct 2026 at 10:48, Hangbin Liu <hangbin.liu@xxxxxxxxx> wrote:
>
> > > static void bond_miimon_commit(struct bonding *bond)
> > > {
> > > struct slave *slave, *primary, *active;
> > > @@ -2807,10 +2828,21 @@ static void bond_miimon_commit(struct bonding *bond)
> > > err = bond_update_speed_duplex(slave);
> > > netdev_unlock_ops(slave->dev);
> > > if (err && bond_needs_speed_duplex(bond)) {
> > > - slave->link = BOND_LINK_DOWN;
> >
> > Hmm, this issue only happens when link_state is on
> >
> > netif_running(slave->dev) && netif_carrier_ok(slave->dev);
> >
> > while !netif_device_present. Should we set the link up when device detached?
>
>
> Hi Hangbin,
>
> Thanks for the review and the suggestion.
>
> A detached device is one way to get there, but it does not cover all
> the ways to hit this bug. In particular, it does not cover the case i
> reproduced: during inspect both link_state and netif_device_present()
> are true, but the carrier is lost after inspect and before commit, so
> reading speed/duplex fails in commit.

Hi Timur,

Thanks for the explain, but the same question to this patch. How do you
make sure the carrier is not lost during bond_miimon_inspect() and
this slave->link_prev_state setting?

Thanks
Hangbin