Hi,

With a pine64, I am experimenting regulary dwxe watchdog
timeout. Usually it is a sign that something doesn't work in the driver
itself.

The problem I am facing currently is when watchdog timeout occurs,
the interface is unusable. And so I need another system connected
permanently to serial in order to login and reboot the board to get it
working.

The following diff is still a workaround for the underline driver
problem. It tries to reset the interface when watchdog timeout
occurs. But at least, the board could come back in a more accessible
state.

When a watchdog timeout occurs, it will try to:
- down the interface (if it is up)
- reset it
- up the interface (if it called down previously)

With it, I have a "stable" connection to the board via network.

Comments or OK ?
-- 
Sebastien Marie


Index: if_dwxe.c
===================================================================
RCS file: /cvs/src/sys/dev/fdt/if_dwxe.c,v
retrieving revision 1.11
diff -u -p -r1.11 if_dwxe.c
--- if_dwxe.c   3 Jan 2019 00:59:58 -0000       1.11
+++ if_dwxe.c   15 Apr 2019 10:21:39 -0000
@@ -687,7 +687,21 @@ dwxe_ioctl(struct ifnet *ifp, u_long cmd
 void
 dwxe_watchdog(struct ifnet *ifp)
 {
-       printf("%s\n", __func__);
+       struct dwxe_softc *sc = ifp->if_softc;
+       int down_up = 0;
+
+       printf("%s: watchdog timeout\n", sc->sc_dev.dv_xname);
+       ifp->if_oerrors++;
+
+       if (ifp->if_flags & IFF_RUNNING) {
+               down_up = 1;
+               dwxe_down(sc);
+       }
+
+       dwxe_reset(sc);
+
+       if (down_up == 1)
+               dwxe_up(sc);
 }
 
 int

Reply via email to