From nobody@FreeBSD.org  Mon May 14 13:25:27 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id BB3C716A402
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 14 May 2007 13:25:27 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id AB15313C45E
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 14 May 2007 13:25:27 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l4EDPRS8090807
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 14 May 2007 13:25:27 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l4EDKPZ6085940;
	Mon, 14 May 2007 13:20:25 GMT
	(envelope-from nobody)
Message-Id: <200705141320.l4EDKPZ6085940@www.freebsd.org>
Date: Mon, 14 May 2007 13:20:25 GMT
From: Keve Nagy<keve.mail.poliod.hu@FreeBSD.org (at) (dot) (dot)>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Kernel panic upon if_pcn module load on a Netfinity 5000
X-Send-Pr-Version: www-3.0

>Number:         112654
>Category:       kern
>Synopsis:       [pcn] Kernel panic upon if_pcn module load on a Netfinity 5000
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    marius
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 14 13:30:03 GMT 2007
>Closed-Date:    Sun Feb 10 16:16:32 UTC 2008
>Last-Modified:  Sun Feb 10 16:16:32 UTC 2008
>Originator:     Keve Nagy
>Release:        FreeBSD/i386 6.2-RELEASE-p4
>Organization:
N/A
>Environment:
FreeBSD/i386 6.2-RELEASE-p4, IBM Netfinity 5000 2x500MHz PIII CPU with 512MB RAM.
>Description:
I experienced a serious trouble with the if_pcn.ko kernel module under
FreeBSD/i386 6.2-RELEASE-p4 on an IBM Netfinity 5000 (dual PIII). This
machine has an integrated ethernet port on the main board.

Upon loading the if_pcn ethernet driver module, if the RJ45 cable is
connected then some sort of kernel panic occurs and the system stops/
reboots. However, with the RJ45 cable being disconnected from the
integrated ethernet socket the if_pcn driver loads perfectly fine and
then the cable can be connected and the interface be used with no
problems at all.

This happens regardless of the if_pcn driver being compiled into the
kernel or being loaded from loader.conf or simply from the command
line with kldload. Same behaviour under 6.2-RELEASE and 6.2-RELEASE-p3,
6.2-RELEASE-p4.

(1) This below is displayed on boot just before the panic occurs:

pcn0: <AMD PCnet/PCI 10/100BaseTX> port 0x2180-0x219f mem 0xfebfdc00-0xfebfdc1f irq 17 at device 9.0 on pci0
pcn0: Chip ID 2624 (Am79C972)
miibus3: <MII bus> on pcn0
ukphy0: <Generic IEEE 802.3u media interface> on miibus3
ukphy0:
ifmedia_set: no match for 0x0/0xfffffff
panic: ifmedia_set
cpuid = 0
Uptime: 29m57s
Cannot dump. No dump device defined.
Automatic reboot in 15 seconds - press a key on the console to abort

(2) This below is the corresponding screen message when there is no cable
connected to the interface:

pcn0: <AMD PCnet/PCI 10/100BaseTX> port 0x2180-0x219f mem 0xfebfdc00-0xfebfdc1f irq 17 at device 9.0 on pci0
pcn0: Chip ID 2624 (Am79C972)
miibus3: <MII bus> on pcn0
ukphy0: <Generic IEEE 802.3u media interface> on miibus3
ukphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
pcn0: Ethernet address: 00:06:29:50:d9:9e

With the RJ45 ethernet cable disconnected, the driver module loads fine
and the interface can be used as usual. Here is the ifconfig pcn0 output
on my Netfinity 5000 right after the module is successfully loaded with
the cable disconnected:

pcn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
	ether 00:06:29:50:d9:9e
	media: Ethernet autoselect (none)
	status: no carrier

Now the cable can be connected and pcn0 works as any usual ethernet interface:

pcn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
	ether 00:06:29:50:d9:9e
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active

I also tested this hardware with a Debian based Linux distro (uhu-linux 2.0):
uname -a
Linux localhost 2.6.17.6-10 #1 SMP Mon Aug 21 11:06:08 CEST 2006 i686 UHU-Linux

This is what its dmesg showed after booting with the cable being CONNECTED:

..
[17179618.492000] pcnet32.c:v1.32 18.Mar.2006 tsbogend@alpha.franken.de
[17179618.492000] ACPI: PCI Interrupt Link [LKNE] enabled at IRQ 17
[17179618.492000] ACPI: PCI Interrupt 0000:00:09.0[A] -> Link [LKNE] -> GSI 17 (level, low) -> IRQ 209
[17179618.492000] pcnet32: PCnet/FAST+ 79C972 at 0x2180, 00 06 29 50 d9 9e
[17179618.496000]     tx_start_pt(0x0c00):~220 bytes, BCR18(9a61):BurstWrEn BurstRdEn NoUFlow 
[17179618.496000]     SRAMSIZE=0x1700, SRAM_BND=0x0800, assigned IRQ 209.
[17179618.496000] pcnet32: Found PHY 2000:5c10 at address 1.
[17179618.496000] eth3: registered as PCnet/FAST+ 79C972
[17179618.496000] pcnet32: 1 cards_found.
[17179619.152000] Floppy drive(s): fd0 is 1.44M
[17179619.168000] FDC 0 is a National Semiconductor PC87306
[17179619.240000] Capability LSM initialized
[17179619.288000] fuse init (API version 7.6)
[17179619.356000] loop: loaded (max 8 devices)
[17179619.472000] Adding 289160k swap on /dev/sda2.  Priority:-1 extents:1 across:289160k
[17179619.732000] EXT3 FS on sda1, internal journal
[17179629.656000] eth3: link up, 100Mbps, full-duplex
..

Summary: On my Netfinity 5000 if the ethernet cable is connected while
the if_pcn module loads, a kernel panic happens. The same driver loads
fine when there is no cable connected, and then the interface can be
used as expected.

On a Debian based Linux distro, the same interface with the cable
connected causes no trouble at all.
>How-To-Repeat:
Get an IBM Netfinity 5000, connect the on-board ethernet inetrface to a
network switch or hub, boot the FreeBSD 6.2-RELEASE CD and see the kernel
panic!
>Fix:
My current workaround is to make sure that whenever the if_pcn driver
loads, there is no cable connected to this interface. For this reason I
missed out this driver from my custom kernel, and only load the module
manually once I am certain that the cable is not connected.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: remko 
Responsible-Changed-When: Wed May 16 14:20:04 UTC 2007 
Responsible-Changed-Why:  
This is something networking related, reassign to networking. 

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

From: Marius Strobl <marius@alchemy.franken.de>
To: bug-followup@FreeBSD.org, keve@mail.poliod.hu
Cc:  
Subject: Re: kern/112654: [pcn] Kernel panic upon if_pcn module load on a Netfinity 5000
Date: Wed, 16 May 2007 19:59:01 +0200

 I think this was fixed as part of src/sys/pci/if_pcn.c rev. 1.81/1.69.2.7
 and src/sys/dev/mii/nsphy.c rev. 1.26/1.23.2.3. Could you please give a
 current FreeBSD-CURRENT or -STABLE a try?

From: Nagy Keve <keve@mail.duf.hu>
To: bug-followup@FreeBSD.org,
 Marius Strobl <marius@alchemy.franken.de>
Cc:  
Subject: Re: kern/112654: [pcn] Kernel panic upon if_pcn module load on a Netfinity 5000
Date: Tue, 22 May 2007 19:39:03 +0200

 > From:  Marius Strobl <marius@alchemy.franken.de>
 > Date:  Wed, 16 May 2007 19:59:01 +0200
 > I think this was fixed as part of src/sys/pci/if_pcn.c rev.  
 > 1.81/1.69.2.7
 > and src/sys/dev/mii/nsphy.c rev. 1.26/1.23.2.3. Could you please  
 > give a
 > current FreeBSD-CURRENT or -STABLE a try?
 
 Suggested test was carried out on 22-MAY-2007.
 System source was synced to RELENG_6 via cvsup, and buildworld +  
 buildkernel + installworld + installkernel was completed.
 The new 6.2-STABLE system generates the same kernel panic problem as  
 described originally.
 
 Regards,
 Keve
 

From: Nagy Keve <keve@mail.duf.hu>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/112654: [pcn] Kernel panic upon if_pcn module load on a Netfinity 5000
Date: Fri, 29 Jun 2007 22:21:39 +0200

 I ran a few tests today.
 Tried a Gentoo Linux LiveCD, NetBSD Live! 2007 live-CD (based on  
 NetBSD 4.0 BETA) and OpenBSD 4.1.
 Each of these loaded the pcn card driver with the cable being plugged  
 in, no errors reported, no kernel panics.
 
 Regards,
 Keve

From: "Andy Farkas" <chuzzwassa@gmail.com>
To: bug-followup@FreeBSD.org, keve.mail.poliod.hu@FreeBSD.org
Cc:  
Subject: Re: kern/112654: [pcn] Kernel panic upon if_pcn module load on a Netfinity 5000
Date: Sun, 22 Jul 2007 03:28:33 +1000

 Panic also happens on FreeBSD 7.0-CURRENT (built Sat Jul  7 06:52:24 EST 2007).
 
 Mentioned was a possible fix in src/sys/dev/mii/nsphy.c, but note that
 ukphy is being used.
 
 -andyf

From: "Nagy Keve" <keve@mail.duf.hu>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: kern/112654: [pcn] Kernel panic upon if_pcn module load on a Netfinity 5000
Date: Thu, 22 Nov 2007 13:03:25 +0100

 I rebuilt the test system yesterday, after a cvsup to RELENG_6.
 
 uname -a
 FreeBSD netfinity.serverpark.local 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #3=
 : Wed Nov 21 14:48:51 CET 2007     root@netfinity.serverpark.local:/usr/o=
 bj/usr/src/sys/Nf5K  i386
 
 /usr/src/sys/dev/mii/ukphy.c
 $NetBSD: ukphy.c,v 1.2 1999/04/23 04:24:32 thorpej Exp $
 
 /usr/src/sys/pci/if_pcn.c
 $FreeBSD: src/sys/pci/if_pcn.c,v 1.69.2.7 2007/02/25 19:02:01 marius Exp $
 
 The problem still exists, with the RJ45 cable being connected a kernel pani=
 c occurs when the if_pcn driver loads.
 This makes it impossible to remotely turn this system on (Wake on Lan).
 
 Could somebody please have a look at this issue!
 I can provide shell access to this test system if that helps, and I am also=
  happy to assist locally.
 
 

From: "Andy Farkas" <chuzzwassa@gmail.com>
To: bug-followup@freebsd.org, keve.mail.poliod.hu@freebsd.org
Cc:  
Subject: Re: kern/112654: [pcn] [patch] Kernel panic upon if_pcn module load on a Netfinity 5000
Date: Thu, 13 Dec 2007 06:26:18 +1000

 This patch will fix the panic when loading if_pcn. It causes mii to
 use nsphy rather than ukphy.
 
 I am running FreeBSD 7.0-BETA4 but it should apply to RELENG_6 ok.
 
 $FreeBSD: src/sys/dev/mii/nsphy.c,v 1.28 2007/01/12 22:27:46 marius Exp $
 
 --- /sys/dev/mii/nsphy.c-orig   2007-12-12 06:12:28.644008301 +1000
 +++ /sys/dev/mii/nsphy.c        2007-12-12 22:10:08.535150808 +1000
 @@ -121,6 +121,7 @@
 
  static const struct mii_phydesc nsphys[] = {
         MII_PHY_DESC(NATSEMI, DP83840),
 +       MII_PHY_DESC(NATSEMI, DP83843),
         MII_PHY_END
  };
 
 dmesg.boot now shows:
 
 pcn0: <AMD PCnet/PCI 10/100BaseTX> port 0x2180-0x219f mem
 0xfebfcc00-0xfebfcc1f irq 17 at device 9.0 on pci0
 pcn0: Chip ID 2624 (Am79C972)
 miibus0: <MII bus> on pcn0
 nsphy0: <DP83843 10/100 media interface> PHY 1 on miibus0
 nsphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 ukphy0: <Generic IEEE 802.3u media interface> PHY 31 on miibus0
 ukphy0:  10baseT, 10baseT-FDX, auto
 pcn0: using obsoleted if_watchdog interface
 pcn0: Ethernet address: 00:06:29:57:27:70
 pcn0: [ITHREAD]
 
 ps. hope gmail doesn't mangle the patch too much.
 
 -andyf

From: "Nagy Keve" <keve@mail.duf.hu>
To: bug-followup@freebsd.org
Cc: chuzzwassa@gmail.com
Subject: Re: kern/112654: [pcn] Kernel panic upon if_pcn module load on a Netfinity 5000
Date: Tue, 18 Dec 2007 13:30:31 +0100

 Src synced to RELENG_6 today via CVSup.
 $NetBSD: nsphy.c,v 1.18 1999/07/14 23:57:36 thorpej Exp $
 I still have v1.18 of nsphy.c dating back to 1999, unlike the version 1.28 =
 Andy seemed to have in FreeBSD 7 which shows a date of 2007.
 
 Inserted the suggested new line manually. Rebuilt the kernel, rebooted the =
 system.
 
 The good news: The if_pcn module loads without kernel panic even while the =
 RJ45 cable is connected.
 
 The bad news: The pcn interface can no longer recognize a connected cable. =
 It always shows:
 =09status: no carrier
 
 SUMMARY: UNSUITABLE PATCH - The issue is still open.
 
 

From: "Nagy Keve" <keve@mail.duf.hu>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: kern/112654: [pcn] Kernel panic upon if_pcn module load on a Netfinity 5000
Date: Mon, 14 Jan 2008 09:06:42 +0100

 An important update is that my earlier conclusion regarding the patch was f=
 lawed.
 The patch DOES WORK on RELENG_6, it gets rid of the kernel panic upon loadi=
 ng the module and it DOES FIND the appropriate cable media connected. I a=
 m still unable to explain what caused the "no carrier" issue during my ea=
 rlier attempts with this patch.
 So the concept is proved, this could be a proper fix if we can get the pcn =
 driver to use ns_phy instead of uk_phy. With the current patch both ns_ph=
 y and uk_phy shows up in dmesg, and I would rather see ns_phy only.
 
 

From: wforms@Safe-mail.net
To: bug-followup@freebsd.org
Cc: "Andy Farkas" <chuzzwassa@gmail.com>
Subject: Re: kern/112654: [pcn] Kernel panic upon if_pcn module load on a Netfinity 5000
Date: Fri, 18 Jan 2008 20:40:26 +0100

 It seems that my duf/poliod webmail client messes up these messages, so I'll try to submit from here instead.
 
 I run another test today, checking out what OpenBSD says when the network card driver loads. Interestingly it seems that the OpenBSD people did something similar to Andy's suggestion, as dmesg shows traces of both ukphy and nsphy. I am posting the relevant bit of OpenBSD dmesg in the hope that somebody way smarter than me will find it more useful than I did. :-)
 
 OpenBSD 4.1 on my crappy Netfinity 5000:
 ...
 pcn0 at pci0 dev 9 function 0 "AMD 79c970 PCnet-PCI" rev 0x36, Am79c972, rev 6: irq 11, address 00:06:29:50:xx:xx
 nsphyter0 at pcn0 phy 1: DP83843 10/100 PHY, rev. 0
 ukphy0 at pcn0 phy 31: Generic IEEE 802.3u media interface, rev. 1: OUI 0x00001a, model 0x0001
 ...
 
 Best regards,
 Keve Nagy * Debrecen * Hungary

From: Marius Strobl <marius@alchemy.franken.de>
To: Nagy Keve <keve@mail.duf.hu>, wforms@Safe-mail.net,
        bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/112654: [pcn] Kernel panic upon if_pcn module load on a Netfinity 5000
Date: Sun, 20 Jan 2008 21:37:55 +0100

 On Mon, Jan 14, 2008 at 08:10:02AM +0000, Nagy Keve wrote:
 > 
 > An important update is that my earlier conclusion regarding the patch was f=
 > lawed.
 > The patch DOES WORK on RELENG_6, it gets rid of the kernel panic upon loadi=
 > ng the module and it DOES FIND the appropriate cable media connected. I a=
 > m still unable to explain what caused the "no carrier" issue during my ea=
 > rlier attempts with this patch.
 
 That probably was because of nsphy(4) not being the correct driver
 in order to determine the link status of this PHY.
 
 > So the concept is proved, this could be a proper fix if we can get the pcn =
 > driver to use ns_phy instead of uk_phy. With the current patch both ns_ph=
 > y and uk_phy shows up in dmesg, and I would rather see ns_phy only.
 >  
 
 Could you please give a kernel built with the patch at:
 http://people.freebsd.org/~marius/nsphyter.diff
 or for RELENG_6:
 http://people.freebsd.org/~marius/nsphyter.diff_RELENG_6
 instead of the patch for nsphy(4) a try?
 
 Marius
 

From: wforms@Safe-mail.net
To: bug-followup@freebsd.org
Cc: marius@alchemy.franken.de, "Andy Farkas" <chuzzwassa@gmail.com>
Subject: Re: kern/112654: [pcn] Kernel panic upon if_pcn module load on a Netfinity 5000
Date: Tue, 22 Jan 2008 19:23:17 +0100

 New test was carried out today using Marius' patch (and not using Andy's patch at the same time).
 The new kernel re-introduces the original problem, loading the if_pcn driver while the RJ45 cable is connected results in a kernel panic and the system reboots. While the cable is disconnected the if_pcn module loads fine, after which the cable can be plugged back and the card can be used as expected.
 
 ### Here is what shows up upon "kldload if_pcn" while the cable is unplugged ###
 pcn0: <AMD PCnet/PCI 10/100BaseTX> port 0x2180-0x219f mem 0xfebff800-0xfebff81f
 irq 17 at device 9.0 on pci0
 pcn0: Chip ID 2624 (Am79C972)
 miibus5: <MII bus> on pcn0
 nsphyter0: <DP83843 10/100 media interface> on miibus5
 nsphyter0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 ukphy0: <Generic IEEE 802.3u media interface> on miibus5
 ukphy0:  10baseT, 10baseT-FDX, auto
 pcn0: Ethernet address: 00:06:29:50:d9:9e
 
 ### At that point ifconfig says: ###
 root@netfinity ~# ifconfig pcn0
 pcn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
         ether 00:06:29:50:d9:9e
         media: Ethernet autoselect (none)
         status: no carrier
 ### Then I connect the RJ45 cable coming from the switch and: ###
 root@netfinity ~# ifconfig pcn0
 pcn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
         ether 00:06:29:50:d9:9e
         media: Ethernet autoselect (100baseTX <full-duplex>)
         status: active
 root@netfinity ~#
 
 
 ### Now here is what "kldload if_pcn" does while the cable is connected: ###
 pcn0: <AMD PCnet/PCI 10/100BaseTX> port 0x2180-0x219f mem 0xfebff800-0xfebff81f
 irq 17 at device 9.0 on pci0
 pcn0: Chip ID 2624 (Am79C972)
 miibus5: <MII bus> on pcn0
 nsphyter0: <DP83843 10/100 media interface> on miibus5
 nsphyter0: no media present
 ifmedia_set: no match for 0x0/0xfffffff
 panic: ifmedia_set
 
 Regards,
 Keve

From: Marius Strobl <marius@alchemy.franken.de>
To: bug-followup@freebsd.org
Cc: Andy Farkas <chuzzwassa@gmail.com>, wforms@Safe-mail.net
Subject: Re: kern/112654: [pcn] Kernel panic upon if_pcn module load on a Netfinity 5000
Date: Tue, 22 Jan 2008 20:43:48 +0100

 On Tue, Jan 22, 2008 at 07:23:17PM +0100, wforms@Safe-mail.net wrote:
 > New test was carried out today using Marius' patch (and not using Andy's patch at the same time).
 > The new kernel re-introduces the original problem, loading the if_pcn driver while the RJ45 cable is connected results in a kernel panic and the system reboots. While the cable is disconnected the if_pcn module loads fine, after which the cable can be plugged back and the card can be used as expected.
 > 
 > ### Here is what shows up upon "kldload if_pcn" while the cable is unplugged ###
 > pcn0: <AMD PCnet/PCI 10/100BaseTX> port 0x2180-0x219f mem 0xfebff800-0xfebff81f
 > irq 17 at device 9.0 on pci0
 > pcn0: Chip ID 2624 (Am79C972)
 > miibus5: <MII bus> on pcn0
 > nsphyter0: <DP83843 10/100 media interface> on miibus5
 > nsphyter0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 > ukphy0: <Generic IEEE 802.3u media interface> on miibus5
 > ukphy0:  10baseT, 10baseT-FDX, auto
 > pcn0: Ethernet address: 00:06:29:50:d9:9e
 > 
 > ### At that point ifconfig says: ###
 > root@netfinity ~# ifconfig pcn0
 > pcn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
 >         ether 00:06:29:50:d9:9e
 >         media: Ethernet autoselect (none)
 >         status: no carrier
 > ### Then I connect the RJ45 cable coming from the switch and: ###
 > root@netfinity ~# ifconfig pcn0
 > pcn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
 >         ether 00:06:29:50:d9:9e
 >         media: Ethernet autoselect (100baseTX <full-duplex>)
 >         status: active
 > root@netfinity ~#
 > 
 > 
 > ### Now here is what "kldload if_pcn" does while the cable is connected: ###
 > pcn0: <AMD PCnet/PCI 10/100BaseTX> port 0x2180-0x219f mem 0xfebff800-0xfebff81f
 > irq 17 at device 9.0 on pci0
 > pcn0: Chip ID 2624 (Am79C972)
 > miibus5: <MII bus> on pcn0
 > nsphyter0: <DP83843 10/100 media interface> on miibus5
 > nsphyter0: no media present
 > ifmedia_set: no match for 0x0/0xfffffff
 > panic: ifmedia_set
 > 
 
 Could you please:
 1) try again with the nsphyter patch already in place and
    http://people.freebsd.org/~marius/nsphyter.c
    copied on top of the existing src/sys/dev/mii/nsphyter.c?
    The new one uses the reset function from nsphy(4), which is about
    the only thing I can think of making the difference that a nsphy(4)
    hacked to attach to the DP83843 doesn't panic.
 2) In case it also panics with the nsphyter.c provide a backtrace.
 
 Thanks,
 Marius
 

From: wforms@Safe-mail.net
To: bug-followup@FreeBSD.org
Cc: marius@alchemy.franken.de, chuzzwassa@gmail.com
Subject: Re: kern/112654: [pcn] Kernel panic upon if_pcn module load on a Netfinity 5000
Date: Wed, 23 Jan 2008 16:47:23 +0100

 BINGO!
 Adding this latest nsphyter.c edition of Marius to his former patchset resulted =
 in a reliably working pcn driver. So whatever you tried there Marius, is the =
 key to the kernel panic problem I reported this PR for. The kernel I built =
 with your latest update now loads the if_pcn module without the kernel panic, =
 regardless of the RJ45 cable being connected or disconnected, and the pcn0 =
 adapter reliably recognizes the presence of the cable. The adapter worked fine =
 for basic network testings.
 
 I do not know how ready you consider the current code to be the final fix for =
 my PR, or if you need to incorporate the things we just learnt here into a =
 larger and more uniformly written patch before it can migrate to the src system. =
 I also do not know if a proper fix for FreeBSD 6 needs to be much different =
 than for FreeBSD 7, I only recognized that your RELENG_6 patchset introduced =
 this new nsphyter thing which did not exist in 6.x before. So I am uncertain =
 how much of this are you or the FreeBSD Team willing_to/can inject into RELENG_6 =
 about now. However, judging from your latest followup I assume that there may =
 not be necessarry to add nsphyter to RELENG_6 just now, because a simplified =
 fix implementing this latest reset function change of yours in the good old =
 ukphy section of the current 6.3-STABLE code might be perfectly good enough =
 for the time being.
 But this is not for me to decide, I simply mentioned this as a possible option.
 
 Anyway, GOOD JOB guys!
 Thank you!
 
 P.S.: That backtrace thing I should have given you in case your patch does =
 not work, is unknown for me. I assume it may be usefull to know this in the =
 future and I am happy to improve my knowledge, so if you can point me to a =
 page where I can learn what that is, I would appreciate it.
Responsible-Changed-From-To: freebsd-net->marius 
Responsible-Changed-By: marius 
Responsible-Changed-When: Wed Jan 23 21:53:19 UTC 2008 
Responsible-Changed-Why:  

grab 

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

From: Marius Strobl <marius@alchemy.franken.de>
To: wforms@Safe-mail.net
Cc: bug-followup@FreeBSD.org, chuzzwassa@gmail.com
Subject: Re: kern/112654: [pcn] Kernel panic upon if_pcn module load on a Netfinity 5000
Date: Wed, 23 Jan 2008 23:06:34 +0100

 On Wed, Jan 23, 2008 at 04:47:23PM +0100, wforms@Safe-mail.net wrote:
 > BINGO!
 > Adding this latest nsphyter.c edition of Marius to his former patchset resulted in a reliably working pcn driver. So whatever you tried there Marius, is the key to the kernel panic problem I reported this PR for. The kernel I built with your latest update now loads the if_pcn module without the kernel panic, regardless of the RJ45 cable being connected or disconnected, and the pcn0 adapter reliably recognizes the presence of the cable. The adapter worked fine for basic network testings.
 > 
 > I do not know how ready you consider the current code to be the final fix for my PR, or if you need to incorporate the things we just learnt here into a larger and more uniformly written patch before it can migrate to the src system. I also do not know if a proper fix for FreeBSD 6 needs to be much different than for FreeBSD 7, I only recognized that your RELENG_6 patchset introduced this new nsphyter thing which did not exist in 6.x before. So I am uncertain how much of this are you or the FreeBSD Team  willing_to/can inject into RELENG_6 about now. However, judging from your latest followup I assume that there may not be necessarry to add nsphyter to RELENG_6 just now, because a simplified fix implementing this latest reset function change of yours in the good old ukphy section of the current 6.3-STABLE code might be perfectly good enough for the time being.
 > But this is not for me to decide, I simply mentioned this as a possible option.
 
 That reset function isn't appropriate for use by drivers other
 than those for the Nation Semciconductor famility of PHYs which
 share these specific quirks.
 I just need someone to verify that nsphyter(4) also works correctly
 with DP83815, then I can commit it to HEAD and say 2 weeks later
 to RELENG_7 and RELENG_6. There's no difference in nsphyter(4)
 itself between the HEAD and RELENG_6 versions of the patch, we
 just use a different syntax in src/sys/conf/files (which specifies
 what source files are compiled into the kernel) in HEAD/RELENG_7
 than in RELENG_6 and the context in src/sys/modules/mii/Makefile
 is different.
 
 Marius
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/112654: commit references a PR
Date: Sun, 27 Jan 2008 01:10:47 +0000 (UTC)

 marius      2008-01-27 01:10:41 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/conf             files 
     sys/dev/mii          miidevs 
     sys/modules/mii      Makefile 
   Added files:
     sys/dev/mii          nsphyter.c nsphyterreg.h 
   Log:
   Add a driver for the National Semiconductor DP83815, DP83843 and
   DP83847 PHYs. The main reason for using a specific driver for these
   PHYs are reset quirks similar to the nsphy(4) driven DP83840A.
   
   PR:             112654
   Obtained from:  NetBSD
   MFC after:      2 weeks
   Thanks to:      mlaier for testing w/ DP83815
   
   Revision  Changes    Path
   1.1266    +1 -0      src/sys/conf/files
   1.48      +2 -0      src/sys/dev/mii/miidevs
   1.1       +341 -0    src/sys/dev/mii/nsphyter.c (new)
   1.1       +186 -0    src/sys/dev/mii/nsphyterreg.h (new)
   1.32      +1 -1      src/sys/modules/mii/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/112654: commit references a PR
Date: Sun, 10 Feb 2008 16:02:35 +0000 (UTC)

 marius      2008-02-10 16:02:30 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     sys/conf             files 
     sys/dev/mii          miidevs 
     sys/modules/mii      Makefile 
   Added files:           (Branch: RELENG_7)
     sys/dev/mii          nsphyter.c nsphyterreg.h 
   Log:
   MFC: conf/files 1.1266; dev/mii/miidevs 1.48; dev/mii/nsphyter.c 1.1;
        dev/mii/nsphyterreg.h 1.1; modules/mii/Makefile 1.32
   
   Add a driver for the National Semiconductor DP83815, DP83843 and
   DP83847 PHYs.
   
   PR:     112654
   
   Revision    Changes    Path
   1.1243.2.3  +1 -0      src/sys/conf/files
   1.46.2.2    +2 -0      src/sys/dev/mii/miidevs
   1.1.2.1     +341 -0    src/sys/dev/mii/nsphyter.c (new)
   1.1.2.1     +186 -0    src/sys/dev/mii/nsphyterreg.h (new)
   1.30.2.2    +1 -1      src/sys/modules/mii/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/112654: commit references a PR
Date: Sun, 10 Feb 2008 16:02:55 +0000 (UTC)

 marius      2008-02-10 16:02:50 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     sys/conf             files 
     sys/dev/mii          miidevs 
     sys/modules/mii      Makefile 
   Added files:           (Branch: RELENG_6)
     sys/dev/mii          nsphyter.c nsphyterreg.h 
   Log:
   MFC: conf/files 1.1266; dev/mii/miidevs 1.48; dev/mii/nsphyter.c 1.1;
        dev/mii/nsphyterreg.h 1.1; modules/mii/Makefile 1.32
   
   Add a driver for the National Semiconductor DP83815, DP83843 and
   DP83847 PHYs.
   
   PR:     112654
   
   Revision     Changes    Path
   1.1031.2.71  +2 -0      src/sys/conf/files
   1.30.2.12    +2 -0      src/sys/dev/mii/miidevs
   1.1.4.1      +341 -0    src/sys/dev/mii/nsphyter.c (new)
   1.1.4.1      +186 -0    src/sys/dev/mii/nsphyterreg.h (new)
   1.26.8.3     +1 -1      src/sys/modules/mii/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: marius 
State-Changed-When: Sun Feb 10 16:15:43 UTC 2008 
State-Changed-Why:  

Close; thanks for your patience. 

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