Page MenuHomeFreeBSD

D61199.1794702817.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D61199.1794702817.diff

diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c
--- a/sys/dev/ixgbe/if_ix.c
+++ b/sys/dev/ixgbe/if_ix.c
@@ -178,6 +178,7 @@
};
static void *ixgbe_register(device_t);
+static int ixgbe_attach(device_t);
static int ixgbe_if_attach_pre(if_ctx_t);
static int ixgbe_if_attach_post(if_ctx_t);
static int ixgbe_if_detach(if_ctx_t);
@@ -317,7 +318,7 @@
/* Device interface */
DEVMETHOD(device_register, ixgbe_register),
DEVMETHOD(device_probe, iflib_device_probe),
- DEVMETHOD(device_attach, iflib_device_attach),
+ DEVMETHOD(device_attach, ixgbe_attach),
DEVMETHOD(device_detach, iflib_device_detach),
DEVMETHOD(device_shutdown, iflib_device_shutdown),
DEVMETHOD(device_suspend, iflib_device_suspend),
@@ -1151,6 +1152,24 @@
return (&ixgbe_sctx_init);
} /* ixgbe_register */
+/************************************************************************
+ * ixgbe_attach - Device attach entry point
+ *
+ * The MDIO bus children are attached here rather than in
+ * ixgbe_if_attach_post(): their register accesses take the iflib
+ * context lock, which iflib holds across IFDI_ATTACH_POST.
+ ************************************************************************/
+static int
+ixgbe_attach(device_t dev)
+{
+ int error;
+
+ error = iflib_device_attach(dev);
+ if (error == 0)
+ ixgbe_mdio_attach(iflib_get_softc(device_get_softc(dev)));
+ return (error);
+} /* ixgbe_attach */
+
/************************************************************************
* ixgbe_if_attach_pre - Device initialization routine, part 1
*
@@ -1459,9 +1478,6 @@
/* Add sysctls */
ixgbe_add_device_sysctls(ctx);
- /* Add MDIO bus if required / supported */
- ixgbe_mdio_attach(sc);
-
/* Init recovery mode timer and state variable */
if (sc->feat_en & IXGBE_FEATURE_RECOVERY_MODE) {
sc->recovery_mode = 0;

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 15, 12:33 AM (3 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41476355
Default Alt Text
D61199.1794702817.diff (1 KB)

Event Timeline