--- if_re.c.lock 2021-06-21 23:04:01.666272000 +0200 +++ if_re.c 2021-06-21 23:09:05.892018000 +0200 @@ -184,6 +184,7 @@ static void re_driver_stop __P((struct re_sof static void re_hw_phy_config __P((struct re_softc *)); static void re_init __P((void *)); +static void re_init_locked __P((void *)); static int re_var_init __P((struct re_softc *)); static void re_reset __P((struct re_softc *)); static void re_stop __P((struct re_softc *)); @@ -7077,12 +7078,11 @@ static void re_init_unlock(void *xsc) /* Software & return; } -static void re_init(void *xsc) /* Software & Hardware Initialize */ +static void re_init_locked(void *xsc) /* Software & Hardware Initialize */ { struct re_softc *sc = xsc; struct ifnet *ifp; - RE_LOCK(sc); ifp = RE_GET_IFNET(sc); if (re_link_ok(sc)) { @@ -7093,7 +7093,14 @@ static void re_init(void *xsc) /* Software & Hardwar sc->re_link_chg_det = 1; re_start_timer(sc); +} +static void re_init(void *xsc) /* Software & Hardware Initialize */ +{ + struct re_softc *sc = xsc; + + RE_LOCK(sc); + re_init_locked(sc); RE_UNLOCK(sc); } @@ -8442,7 +8449,7 @@ static void re_int_task(void *arg, int npending) if ((status & RE_ISR_FIFO_OFLOW) && (!(status & (RE_ISR_RX_OK | RE_ISR_TX_OK | RE_ISR_RX_OVERRUN)))) { re_reset(sc); - re_init(sc); + re_init_locked(sc); sc->rx_fifo_overflow = 0; CSR_WRITE_2(sc, RE_ISR, RE_ISR_FIFO_OFLOW); } @@ -8453,7 +8460,7 @@ static void re_int_task(void *arg, int npending) if (status & RE_ISR_SYSTEM_ERR) { re_reset(sc); - re_init(sc); + re_init_locked(sc); } switch(sc->re_type) { @@ -8518,7 +8525,7 @@ static void re_int_task_8125(void *arg, int npending) if (status & RE_ISR_SYSTEM_ERR) { re_reset(sc); - re_init(sc); + re_init_locked(sc); } RE_UNLOCK(sc); @@ -8750,7 +8757,7 @@ caddr_t data; error =re_alloc_buf(sc); if (error == 0) { - re_init(sc); + re_init_locked(sc); } RE_UNLOCK(sc); @@ -8773,7 +8780,7 @@ caddr_t data; case SIOCSIFFLAGS: RE_LOCK(sc); if (ifp->if_flags & IFF_UP) { - re_init(sc); + re_init_locked(sc); } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { re_stop(sc); }