From jw@net.in.tum.de  Tue Dec 31 02:19:23 2002
Return-Path: <jw@net.in.tum.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E8FF837B401
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 31 Dec 2002 02:19:23 -0800 (PST)
Received: from falcon.net.informatik.tu-muenchen.de (mnch-d9ba4a62.pool.mediaWays.net [217.186.74.98])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 04F0F43EA9
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 31 Dec 2002 02:19:22 -0800 (PST)
	(envelope-from jw@net.in.tum.de)
Received: from sulaco.ppp.uni-sb.de (localhost.ppp.uni-sb.de [127.0.0.1])
	by sulaco.ppp.uni-sb.de (8.12.6/8.12.6) with ESMTP id gBUE9bHn003949
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 30 Dec 2002 15:09:37 +0100 (CET)
	(envelope-from jw@sulaco.ppp.uni-sb.de)
Received: (from jw@localhost)
	by sulaco.ppp.uni-sb.de (8.12.6/8.12.6/Submit) id gBUE9ZxK003948;
	Mon, 30 Dec 2002 15:09:35 +0100 (CET)
Message-Id: <200212301409.gBUE9ZxK003948@sulaco.ppp.uni-sb.de>
Date: Mon, 30 Dec 2002 15:09:35 +0100 (CET)
From: Joerg Wallerich <jw@net.in.tum.de>
Reply-To: Joerg Wallerich <jw@net.in.tum.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Failure to initialize MII on 3Com NIC results in panic
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         46647
>Category:       kern
>Synopsis:       Failure to initialize MII on 3Com NIC results in panic
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    silby
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 31 02:20:01 PST 2002
>Closed-Date:    Sun Apr 03 10:55:47 EST 2011
>Last-Modified:  Sun Apr 03 10:55:47 EST 2011
>Originator:     Joerg Wallerich <jw@net.in.tum.de>
>Release:        FreeBSD 5.0-RC i386
>Organization:
/
>Environment:
System: FreeBSD sulaco.ppp.uni-sb.de 5.0-RC FreeBSD 5.0-RC #1: Sun Dec 29 17:35:10 CET 2002 root@sulaco.ppp.uni-sb.de:/usr/src/sys/i386/compile/SULACO i386
Hardware: Asus P5A, AMD K6-III, 3Com 3cSOHO100-TX OfficeConnect NIC
>Description:
	System fails to initialize NIC Phys (xlphy0) and doesn't find
        any supported media types. Any attempt to configure the
        interface results in a kernel panic.

        dmesg output:
xl0: <3Com 3cSOHO100-TX OfficeConnect> port 0xb000-0xb07f mem 0xd5000000-0xd500007f irq 10 at device 11.0 on pci0
xl0: Ethernet address: 00:04:76:8c:fb:40
miibus0: <MII bus> on xl0
xlphy0: <3Com internal media interface> on miibus0
xlphy0:  

This appears since revision 1.107 of if_xl.c

>How-To-Repeat:
	Boot, configure interface using 'ifconfig up'

>Fix:

	As workaround I added some of the DELAY(1) lines removed
        from 1.106 back to 1.111 of if_xl.c (see patch). This
        seems to fix the problem.

--- if_xl.c.orig        Sun Dec 29 17:40:43 2002
+++ if_xl.c     Sun Dec 29 17:47:08 2002
@@ -370,7 +370,9 @@
 
        for (i = 0; i < 32; i++) {
                MII_SET(XL_MII_CLK);
+               DELAY(1);
                MII_CLR(XL_MII_CLK);
+               DELAY(1);
        }
 
        return;
@@ -396,7 +398,9 @@
                 } else {
                        MII_CLR(XL_MII_DATA);
                 }
+               DELAY(1);
                MII_CLR(XL_MII_CLK);
+               DELAY(1);
                MII_SET(XL_MII_CLK);
        }
 }



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: arved 
State-Changed-When: Tue Jan 21 08:38:03 PST 2003 
State-Changed-Why:  
I have tested this patch, it fixes my panic described in PR: 47251.  


Responsible-Changed-From-To: freebsd-bugs->silby 
Responsible-Changed-By: arved 
Responsible-Changed-When: Tue Jan 21 08:38:03 PST 2003 
Responsible-Changed-Why:  
Hello silby,  
Can you please commit this patch? 
It is a patch to a commit from you 4 months ago.  
Although this delays may not be required by the MII specification,  
my 3c905B requires them.  

regards  
tilman 

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

From: "Ted Mittelstaedt" <tedm@toybox.placo.com>
To: <bug-followup@FreeBSD.org>, <jw@net.in.tum.de>
Cc:  
Subject: Re: kern/46647: Failure to initialize MII on 3Com NIC results in panic
Date: Sat, 24 Nov 2007 23:51:11 -0800

 It appears this PR should be closed pending feedback from
 the original submitter.  The DELAYS added by
 the patch included from the submitter were added into the
 driver in revision 1.116 as two more MII_SETS along with a
 note in the code, perhaps feedback weas sent to the
 submitter who didn't respond?
State-Changed-From-To: analyzed->closed 
State-Changed-By: eadler 
State-Changed-When: Sun Apr 3 10:55:46 EST 2011 
State-Changed-Why:  
per Ted Mittelstaedt 

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