On Tue, Oct 18, 2016 at 09:20:08AM +1100, Jonathan Gray wrote:
> 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.
> 
> Index: if_fec.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/armv7/imx/if_fec.c,v
> retrieving revision 1.18
> diff -u -p -r1.18 if_fec.c
> --- if_fec.c  22 Sep 2016 12:43:22 -0000      1.18
> +++ if_fec.c  17 Oct 2016 00:46:49 -0000
> @@ -413,7 +413,6 @@ fec_attach(struct device *parent, struct
>       mii->mii_readreg = fec_miibus_readreg;
>       mii->mii_writereg = fec_miibus_writereg;
>       mii->mii_statchg = fec_miibus_statchg;
> -     mii->mii_flags = MIIF_AUTOTSLEEP;
>  
>       ifmedia_init(&mii->mii_media, 0, fec_ifmedia_upd, fec_ifmedia_sts);
>       mii_attach(self, mii, 0xffffffff, MII_PHY_ANY, MII_OFFSET_ANY, 0);

Thanks. I've put it in my Sabre Lite's kernel.
-- 
Matthieu Herrb

Attachment: signature.asc
Description: PGP signature

Reply via email to