On Wed, Apr 17, 2019 at 09:44:43AM +0200, Sebastien Marie wrote:
> 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
> 
> 

Just to add here, in my TESTS for 6.5, all of my 20 or so PINE64s have
had a really tough time with dwxe(4). I have had to put all of them into
10baseT mode. Previously, they all had "media 100baseTX" in their
/etc/hostname.dwxe0 (and these are supposedly 1Gb devices), so even in
the past it has been really flaky. If this helps improve things, I'm all
for it, but you should probably get oks from someone who knows the
driver better.

-ml

> 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