From nobody@FreeBSD.org  Tue Feb  8 14:48:23 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 12338106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  8 Feb 2011 14:48:23 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id DC8B78FC15
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  8 Feb 2011 14:48:22 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p18EmM9n037030
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 8 Feb 2011 14:48:22 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p18EmM0B037029;
	Tue, 8 Feb 2011 14:48:22 GMT
	(envelope-from nobody)
Message-Id: <201102081448.p18EmM0B037029@red.freebsd.org>
Date: Tue, 8 Feb 2011 14:48:22 GMT
From: Robert Millan <rmh@debian.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: if_msk driver causes kernel panic (fatal trap while in kernel mode)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         154591
>Category:       kern
>Synopsis:       [msk] [panic] if_msk driver causes kernel panic (fatal trap while in kernel mode)
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    yongari
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 08 14:50:08 UTC 2011
>Closed-Date:    Fri Jun 24 00:55:07 UTC 2011
>Last-Modified:  Fri Jun 24 00:55:07 UTC 2011
>Originator:     Robert Millan
>Release:        9-current
>Organization:
individual
>Environment:
>Description:
if_msk driver causes kernel panic (fatal trap while in kernel mode) in one of my machines.

Screenshots of the panic message + backtrace:

http://people.debian.org/~rmh/panic/

>How-To-Repeat:
Happens every time on one of my machines with a Marvell Yukon onboard NIC.

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Feb 10 05:43:45 UTC 2011 
Responsible-Changed-Why:  
reassign. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=154591 
State-Changed-From-To: open->feedback 
State-Changed-By: yongari 
State-Changed-When: Thu Feb 10 18:41:33 UTC 2011 
State-Changed-Why:  
It seems there are two issues here. 
o Station address read by driver was ff:ff:ff:ff:ff:ff 
o PHY attach failure triggered panic 

I have no idea for the first issue. It seems you have 88E8056 Yukon 
Ultra controller which is known to have several stability issues 
with msk(4). Due to lack of hardware I was not able to track down 
the root cause of the issues. 

However I can't reproduce the panic on my box when I patched the 
driver to fail attaching a PHY. By chance are you using VIMAGE 
enabled kernel? If yes, how about removing VIMAGE in your 
configuration and test again? 


Responsible-Changed-From-To: freebsd-net->yongari 
Responsible-Changed-By: yongari 
Responsible-Changed-When: Thu Feb 10 18:41:33 UTC 2011 
Responsible-Changed-Why:  
Grab. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=154591 

From: Marius Strobl <marius@alchemy.franken.de>
To: yongari@freebsd.org
Cc: rmh@debian.org, bug-followup@freebsd.org
Subject: Re: kern/154591: [msk] [panic] if_msk driver causes kernel panic (fatal trap while in kernel mode)
Date: Thu, 10 Feb 2011 20:11:58 +0100

 On Thu, Feb 10, 2011 at 06:43:20PM +0000, yongari@freebsd.org wrote:
 > Synopsis: [msk] [panic] if_msk driver causes kernel panic (fatal trap while in kernel mode)
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: yongari
 > State-Changed-When: Thu Feb 10 18:41:33 UTC 2011
 > State-Changed-Why: 
 > It seems there are two issues here.
 >  o Station address read by driver was ff:ff:ff:ff:ff:ff
 >  o PHY attach failure triggered panic
 > 
 > I have no idea for the first issue. It seems you have 88E8056 Yukon
 > Ultra controller which is known to have several stability issues
 > with msk(4). Due to lack of hardware I was not able to track down
 > the root cause of the issues.
 > 
 > However I can't reproduce the panic on my box when I patched the
 > driver to fail attaching a PHY. By chance are you using VIMAGE
 > enabled kernel? If yes, how about removing VIMAGE in your
 > configuration and test again?
 > 
 
 AFAICT the panic in_pcbpurgeif0() is an old problem caused by
 locks being used before they are initialized further down the
 road when if_detach() is called from the driver attach path
 during boot. At least back in late 2008/early 2009 when I
 reported this problem to bz@ he said he'd understand the root
 cause but neither he nor rwatson@ saw a decent way of solving
 the ordering problem. IIRC that problem was introduced as part
 of VIMAGE-related changes but at least back then I hit it with
 non-VIMAGE kernels.
 
 Marius
 

From: Robert Millan <rmh@debian.org>
To: yongari@freebsd.org
Cc: freebsd-net@freebsd.org, bug-followup@FreeBSD.org
Subject: Re: kern/154591: [msk] [panic] if_msk driver causes kernel panic
 (fatal trap while in kernel mode)
Date: Thu, 10 Feb 2011 22:07:41 +0100

 2011/2/10  <yongari@freebsd.org>:
 > By chance are you using VIMAGE
 > enabled kernel?
 
 No, I used the default amd64/conf/GENERIC from current
 trunk.
 
 -- 
 Robert Millan
State-Changed-From-To: feedback->open 
State-Changed-By: yongari 
State-Changed-When: Sat Feb 12 22:49:37 UTC 2011 
State-Changed-Why:  
Feedback received. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=154591 
State-Changed-From-To: open->feedback 
State-Changed-By: yongari 
State-Changed-When: Sun May 29 23:34:17 UTC 2011 
State-Changed-Why:  
I received positive reports from msk(4) users who are suffering 
from msk(4) instability and I think this issue also might be fixed 
in latest msk(4) in HEAD. 
For your easy testing, I've back-ported msk(4) of HEAD to 
8.2-RELEASE. Please download the two files at the following URL and 
rebuild kernel. Make sure to you cold-start your box before 
rebooting to new kernel(i.e. unplug power cable and wait 10-20 
seconds and boot). 
http://people.freebsd.org/~yongari/msk/8.2R/if_msk.c 
http://people.freebsd.org/~yongari/msk/8.2R/if_mskreg.h 


http://www.freebsd.org/cgi/query-pr.cgi?pr=154591 

From: Robert Millan <rmh@debian.org>
To: yongari@freebsd.org, bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/154591: [msk] [panic] if_msk driver causes kernel panic
 (fatal trap while in kernel mode)
Date: Thu, 2 Jun 2011 16:19:23 +0200

 2011/5/30  <yongari@freebsd.org>:
 > Synopsis: [msk] [panic] if_msk driver causes kernel panic (fatal trap while in kernel mode)
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: yongari
 > State-Changed-When: Sun May 29 23:34:17 UTC 2011
 > State-Changed-Why:
 > I received positive reports from msk(4) users who are suffering
 > from msk(4) instability and I think this issue also might be fixed
 > in latest msk(4) in HEAD.
 > For your easy testing, I've back-ported msk(4) of HEAD to
 > 8.2-RELEASE. Please download the two files at the following URL and
 > rebuild kernel. Make sure to you cold-start your box before
 > rebooting to new kernel(i.e. unplug power cable and wait 10-20
 > seconds and boot).
 > http://people.freebsd.org/~yongari/msk/8.2R/if_msk.c
 > http://people.freebsd.org/~yongari/msk/8.2R/if_mskreg.h
 
 I rebuilt with your files and it doesn't panic anymore.  Thank you!
 
 -- 
 Robert Millan
State-Changed-From-To: feedback->patched 
State-Changed-By: yongari 
State-Changed-When: Thu Jun 2 16:41:41 UTC 2011 
State-Changed-Why:  
Fixed in HEAD. 
Thanks for testing! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=154591 

From: Robert Millan <rmh@debian.org>
To: yongari@freebsd.org, bug-followup@freebsd.org, freebsd-net@freebsd.org
Cc:  
Subject: Re: kern/154591: [msk] [panic] if_msk driver causes kernel panic
 (fatal trap while in kernel mode)
Date: Sun, 12 Jun 2011 14:15:30 +0200

 Btw will this be MFC'ed?
 
 2011/6/2  <yongari@freebsd.org>:
 > Synopsis: [msk] [panic] if_msk driver causes kernel panic (fatal trap while in kernel mode)
 >
 > State-Changed-From-To: feedback->patched
 > State-Changed-By: yongari
 > State-Changed-When: Thu Jun 2 16:41:41 UTC 2011
 > State-Changed-Why:
 > Fixed in HEAD.
 > Thanks for testing!
 >
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=154591
 >
 
 
 
 -- 
 Robert Millan

From: YongHyeon PYUN <pyunyh@gmail.com>
To: Robert Millan <rmh@debian.org>
Cc: yongari@freebsd.org, bug-followup@freebsd.org, freebsd-net@freebsd.org
Subject: Re: kern/154591: [msk] [panic] if_msk driver causes kernel panic (fatal trap while in kernel mode)
Date: Tue, 21 Jun 2011 18:59:33 -0700

 On Sun, Jun 12, 2011 at 02:15:30PM +0200, Robert Millan wrote:
 > Btw will this be MFC'ed?
 > 
 
 MFC to both stable/8 and stable/7 done.
 
 > 2011/6/2  <yongari@freebsd.org>:
 > > Synopsis: [msk] [panic] if_msk driver causes kernel panic (fatal trap while in kernel mode)
 > >
 > > State-Changed-From-To: feedback->patched
 > > State-Changed-By: yongari
 > > State-Changed-When: Thu Jun 2 16:41:41 UTC 2011
 > > State-Changed-Why:
 > > Fixed in HEAD.
 > > Thanks for testing!
 > >
 > > http://www.freebsd.org/cgi/query-pr.cgi?pr=154591
 > >
 > 
 > 
 > 
 > -- 
 > Robert Millan
State-Changed-From-To: patched->closed 
State-Changed-By: yongari 
State-Changed-When: Fri Jun 24 00:54:41 UTC 2011 
State-Changed-Why:  
Fix merged to both stable/8 and stable/7. If you encounter the 
issue again please open a new PR. 
Thanks for reporting! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=154591 
>Unformatted:
