e6000sw: schedule e6000sw_tick() to occur once a second

Although all the machinery is present, the tick routine only ran once.
It was never rescheduled.  So, reschedule it.

However in practice I've discovered that the tick routine is running
whilst a bunch of phys are actually being probe/attached on each per-port
MII bus being created and probed off of the switch itself.

Until that's debugged (and likely the whole PHY management stuff is
cleaned up here), just add a NULL check and thus don't panic.

Differential Revision:	https://reviews.freebsd.org/D50031
Reviewed by:	imp
This commit is contained in:
Adrian Chadd
2025-04-25 11:44:22 -07:00
parent ee7f62faa8
commit c78f603ab7
+12
View File
@@ -1613,6 +1613,17 @@ e6000sw_tick(void *arg, int p __unused)
&mii->mii_media_status, &mii->mii_media_active);
LIST_FOREACH(miisc, &mii->mii_phys, mii_list) {
/*
* Note: this is sometimes NULL during PHY
* enumeration, although that shouldn't be
* happening /after/ tick runs. To work
* around this whilst the problem is being
* debugged, just do a NULL check here and
* continue.
*/
if (mii->mii_media.ifm_cur == NULL)
continue;
if (IFM_INST(mii->mii_media.ifm_cur->ifm_media)
!= miisc->mii_inst)
continue;
@@ -1620,6 +1631,7 @@ e6000sw_tick(void *arg, int p __unused)
}
}
E6000SW_UNLOCK(sc);
taskqueue_enqueue_timeout(sc->sc_tq, &sc->sc_tt, hz);
}
static void