Page MenuHomeFreeBSD

iflib: Reject media changes during suspend
ClosedPublic

Authored by kbowling on Sep 3 2026, 4:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 5, 5:27 PM
Unknown Object (File)
Sat, Oct 3, 10:04 PM
Unknown Object (File)
Sat, Oct 3, 12:27 AM
Unknown Object (File)
Sat, Oct 3, 12:16 AM
Unknown Object (File)
Thu, Oct 1, 12:09 PM
Unknown Object (File)
Thu, Oct 1, 12:07 PM
Unknown Object (File)
Thu, Oct 1, 4:32 AM
Unknown Object (File)
Sun, Sep 27, 9:47 PM

Details

Summary
iflib gates its built-in administrative and media-status callbacks once
a power transition starts, but iflib_media_change() could still invoke a
driver while the device was suspending or suspended.  Several drivers
perform PHY or firmware I/O directly from this callback.

Return EBUSY before invoking IFDI_MEDIA_CHANGE() unless the device is
active.  ifmedia then restores the prior selection, avoiding both
suspended hardware access and an unvalidated configuration that would
need to be replayed during resume.

Validated with device suspend on 82579LM, I210, and I225-IT
controllers.  Media-selection requests returned EBUSY on every
suspended device.  Resume restored the linked management interfaces at
1 Gbps with working traffic and no watchdogs; unconfigured interfaces
retained their prior admin and link state.

MFC after:      2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable