On Tue, Oct 18, 2016 at 12:12:28PM +0200, Mark Kettenis wrote:
> > Date: Tue, 18 Oct 2016 09:20:08 +1100
> > From: Jonathan Gray <[email protected]>
> >
> > On Sun, Oct 16, 2016 at 07:02:55PM +1100, Jonathan Gray wrote:
> > > On Sun, Oct 16, 2016 at 12:45:36AM -0700, Philip Guenther wrote:
> > > > On Sun, 16 Oct 2016, Matthieu Herrb wrote:
> > > > > my Sabre Lite board paniced during the night for the 1st time in
> > > > > several
> > > > > month. Here is the information I collected:
> > > > >
> > > > > kernel diagnostic assertion "p->p_wchan == NULL" failed: file
> > > > > "/usr/src/sys/ker
> > > > > n/kern_sched.c", line 333
> > > >
> > > > This means a thread was somehow in the CPU's run-queue...but had a wait
> > > > channel as if it was waiting to be woken.
> > > >
> > > > ...
> > > > > ddb> ps
> > > > > TID PPID PGRP UID S FLAGS WAIT COMMAND
> > > > ...
> > > > > 86009 0 0 0 2 0x40014200 miiaut idle0
> > > >
> > > > Bingo: S=2 --> SRUN! Or in this case, WTF!? idle threads must *NEVER*
> > > > have a wait channel. That smells like someone called tsleep() from an
> > > > interrupt and arm doesn't have the low-level machinery to detect and
> > > > panic
> > > > at the call.
> > > >
> > > > mii_phy_auto() is the source of the "miiaut" wait channel; are the mii
> > > > flags not set right that it's taking the tsleep() path instead of
> > > > timeout_* path?
> > >
> > > Looks like. I don't see a reason why anything using interrupts should
> > > set that flag. So fec/sxie seem to get this wrong.
> > >
> > > arch/armv7/imx/if_fec.c: mii->mii_flags = MIIF_AUTOTSLEEP;
> > > arch/armv7/sunxi/sxie.c: mii->mii_flags = MIIF_AUTOTSLEEP;
> > > dev/usb/if_aue.c: mii->mii_flags = MIIF_AUTOTSLEEP;
> > > dev/usb/if_axe.c: mii->mii_flags = MIIF_AUTOTSLEEP;
> > > dev/usb/if_mos.c: mii->mii_flags = MIIF_AUTOTSLEEP;
> > > dev/usb/if_udav.c: mii->mii_flags = MIIF_AUTOTSLEEP;
> > > dev/usb/if_url.c: mii->mii_flags = MIIF_AUTOTSLEEP;
> > > dev/usb/if_smsc.c: mii->mii_flags = MIIF_AUTOTSLEEP;
> > > dev/usb/if_axen.c: mii->mii_flags = MIIF_AUTOTSLEEP;
> > > dev/usb/if_ure.c: mii->mii_flags = MIIF_AUTOTSLEEP;
> > >
> >
> > I have no hardware with sxie, so here is just the fec diff.
>
> ok kettenis@
Can you check the sxie equivalent on your a10s?
Index: sxie.c
===================================================================
RCS file: /cvs/src/sys/arch/armv7/sunxi/sxie.c,v
retrieving revision 1.22
diff -u -p -r1.22 sxie.c
--- sxie.c 11 Sep 2016 21:44:30 -0000 1.22
+++ sxie.c 22 Oct 2016 05:05:26 -0000
@@ -258,7 +258,6 @@ sxie_attach(struct device *parent, struc
mii->mii_readreg = sxie_miibus_readreg;
mii->mii_writereg = sxie_miibus_writereg;
mii->mii_statchg = sxie_miibus_statchg;
- mii->mii_flags = MIIF_AUTOTSLEEP;
ifmedia_init(&mii->mii_media, 0, sxie_ifm_change, sxie_ifm_status);
mii_attach(self, mii, 0xffffffff, MII_PHY_ANY, MII_OFFSET_ANY, 0);