NetBSD Problem Report #24911

Received: (qmail 16584 invoked by uid 605); 25 Mar 2004 20:00:19 -0000
Message-Id: <20040325200017.CC0AA1115A@narn.netbsd.org>
Date: Thu, 25 Mar 2004 20:00:17 +0000 (UTC)
From: werner@bit-1.de
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: werner@bit-1.de
To: gnats-bugs@gnats.NetBSD.org
Subject: bce driver cannot initialize after WinXP has run.
X-Send-Pr-Version: www-1.0

>Number:         24911
>Category:       kern
>Synopsis:       bce driver cannot initialize after WinXP has run.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 25 20:01:00 +0000 2004
>Closed-Date:    Tue Dec 03 08:17:31 +0000 2019
>Last-Modified:  Tue Dec 03 08:17:31 +0000 2019
>Originator:     Werner Backes
>Release:        current
>Organization:
>Environment:
NetBSD firebird 1.6ZK NetBSD 1.6ZK (FIREBIRD) #1: Thu Mar 25 18:39:56 UTC 2004  root@firebird:/usr/obj/sys/arch/i386/compile/FIREBIRD i386

>Description:
This is an ASUS A7V8X with onboard Broadcom BCM4401 ethernet NIC.
When NetBSD is booted after a "hard" power-off (removing the power
plug or using the ATX power supply's power-switch), everything
works fine. The NIC is recognized and works as expected. I can reboot
as often as I like and the NIC still works as long as I only boot
NetBSD. But when I boot Windows XP, it lefts the NIC in a state from
which NetBSD cannot recover it. dmesg shows:


Mar 25 18:58:01 firebird /netbsd: bce0 at pci0 dev 9 function 0: Broadcom BCM4401 10/100 Ethernet
Mar 25 18:58:01 firebird /netbsd: bce0: interrupting at irq 9
Mar 25 18:58:01 firebird /netbsd: ukphy0 at bce0 phy 1: Generic IEEE 802.3u media interface
Mar 25 18:58:01 firebird /netbsd: bce0: Ethernet address 00:e0:18:9c:9f:34
Mar 25 18:58:02 firebird /netbsd: bce0: timed out disabling ethernet mac
Mar 25 18:58:02 firebird /netbsd: bce0: timed out writting pkt filter ctl
Mar 25 18:58:02 firebird /netbsd: bce0: timed out disabling ethernet mac
Mar 25 18:58:02 firebird /netbsd: bce0: timed out writting pkt filter ctl
Mar 25 18:58:02 firebird /netbsd: bce0: timed out disabling ethernet mac
Mar 25 18:58:02 firebird /netbsd: bce0: timed out writting pkt filter ctl

and the link will not come up. The only way get the NIC working again
with NetBSD is to totally remove power from the system. Soft power off
will not work. Booting WinXP several times doesn't make problems, only
NetBSD after XP has this problem. Another thing that seems to be related
to the problem: when switching on the power supply, the NIC has a link,
even if the machine is still "soft" powered off. I think this is to 
support wake on lan. When NetBSD is booted an then shutdown, the link
is still present after soft power off. In contrast, after booting and
shuting down WinXP, the link goes down and that is the state where Net-
BSD cannot initialize the NIC again. Sounds a bit like WinXP does
something nasty here, but I think NetBSD should be able to deal with
this?



>How-To-Repeat:
Boot WinXP on an ASUS A7V8X, boot NetBSD without powering off the machine
in between -> watch error messages during boot or when doing "ifconfig 
bce0 down/up". bce's link never comes up.
>Fix:

>Release-Note:
>Audit-Trail:

From: Werner Backes <werner@bit-1.de>
To: gnats-bugs@NetBSD.org
Cc:  
Subject: Re: kern/24911 patch included
Date: Mon, 26 Apr 2004 02:14:27 +0200

 This is a multi-part message in MIME format.
 --------------030809000508070009000904
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Transfer-Encoding: 7bit

 This patch fixes the bug (and hopefully doesn't create a new one ;).
 The register I access to power on the phy seems o.k.. Broadcom's
 linux driver does the same. But maybe there is a better place within
 if_bce.c where this call could be placed.

 Werner

 --------------030809000508070009000904
 Content-Type: text/plain;
  name="patch-bce"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="patch-bce"

 bash-2.05b# diff if_bce.c if_bce.c.org
 1333,1341c1333,1335
 <       } else { /* internal phy */
 <               if (val & BCE_DC_ER) {  /* clear reset bit if on */
 <                       bus_space_write_4(sc->bce_btag, sc->bce_bhandle, 
 <                                       BCE_DEVCTL, val & ~BCE_DC_ER);
 <               }
 <               /* power on phy */
 <               bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL,
 <                       bus_space_read_4(sc->bce_btag, sc->bce_bhandle, 
 <                               BCE_MACCTL) & ~BCE_EMC_EP);
 ---
 >       } else if (val & BCE_DC_ER) {   /* internal, clear reset bit if on */
 >               bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_DEVCTL,
 >                   val & ~BCE_DC_ER);
 bash-2.05b# diff if_bcereg.h if_bcereg.h.org
 75d74
 < #define BCE_EMC_EP                    0x00000004      /* power down internal phy */


 --------------030809000508070009000904--
From: "SAITOH Masanobu" <msaitoh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/24911 CVS commit: src/sys/dev/pci
Date: Fri, 18 Oct 2019 23:08:29 +0000

 Module Name:	src
 Committed By:	msaitoh
 Date:		Fri Oct 18 23:08:29 UTC 2019

 Modified Files:
 	src/sys/dev/pci: if_bce.c if_bcereg.h

 Log Message:
 From OpenBSD:
  - Mark ETHERCAP_VLAN_MTU.
  - Clear the powerdown mode. Fixes PR kern/24911 reported by Werner Backes.
  - Set proper LED modes.


 To generate a diff of this commit:
 cvs rdiff -u -r1.55 -r1.56 src/sys/dev/pci/if_bce.c
 cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/if_bcereg.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/24911 CVS commit: [netbsd-9] src/sys/dev/pci
Date: Wed, 23 Oct 2019 19:38:52 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Wed Oct 23 19:38:52 UTC 2019

 Modified Files:
 	src/sys/dev/pci [netbsd-9]: if_bce.c if_bcereg.h

 Log Message:
 Pull up following revision(s) (requested by msaitoh in ticket #370):

 	sys/dev/pci/if_bce.c: revision 1.55
 	sys/dev/pci/if_bce.c: revision 1.56
 	sys/dev/pci/if_bcereg.h: revision 1.5

 - Add missing splnet()/splx() around mii_tick(). Same as OpenBSD rev. 1.23
 - Use device_printf() instead of aprint_error_dev)() in bce_watchdog().
 - Remove unnecessary inclusion.

 From OpenBSD:
  - Mark ETHERCAP_VLAN_MTU.
  - Clear the powerdown mode. Fixes PR kern/24911 reported by Werner Backes.
  - Set proper LED modes.


 To generate a diff of this commit:
 cvs rdiff -u -r1.52 -r1.52.2.1 src/sys/dev/pci/if_bce.c
 cvs rdiff -u -r1.4 -r1.4.170.1 src/sys/dev/pci/if_bcereg.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/24911 CVS commit: [netbsd-8] src/sys/dev/pci
Date: Thu, 24 Oct 2019 16:03:38 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Thu Oct 24 16:03:38 UTC 2019

 Modified Files:
 	src/sys/dev/pci [netbsd-8]: if_bce.c if_bcereg.h

 Log Message:
 Pull up following revision(s) (requested by msaitoh in ticket #1415):

 	sys/dev/pci/if_bce.c: revision 1.55
 	sys/dev/pci/if_bce.c: revision 1.56
 	sys/dev/pci/if_bcereg.h: revision 1.5

 - Add missing splnet()/splx() around mii_tick(). Same as OpenBSD rev. 1.23
 - Use device_printf() instead of aprint_error_dev)() in bce_watchdog().
 - Remove unnecessary inclusion.

  -

 From OpenBSD:
  - Mark ETHERCAP_VLAN_MTU.
  - Clear the powerdown mode. Fixes PR kern/24911 reported by Werner Backes.
  - Set proper LED modes.


 To generate a diff of this commit:
 cvs rdiff -u -r1.46 -r1.46.4.1 src/sys/dev/pci/if_bce.c
 cvs rdiff -u -r1.4 -r1.4.156.1 src/sys/dev/pci/if_bcereg.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: msaitoh@NetBSD.org
State-Changed-When: Tue, 03 Dec 2019 08:17:31 +0000
State-Changed-Why:
This problem should be fixed in if_bce.c rev. 1.56.
Thanks.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.45 2018/12/21 14:23:33 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.