From nobody@FreeBSD.org  Sat Nov 24 20:12:22 2007
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 EAF2916A419
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 24 Nov 2007 20:12:22 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id D954D13C45D
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 24 Nov 2007 20:12:22 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id lAOKCLld042738
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 24 Nov 2007 20:12:21 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id lAOKCL7M042733;
	Sat, 24 Nov 2007 20:12:21 GMT
	(envelope-from nobody)
Message-Id: <200711242012.lAOKCL7M042733@www.freebsd.org>
Date: Sat, 24 Nov 2007 20:12:21 GMT
From: Oleg <supportsobaka@mail.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bce driver shows "no carrier" on Intel SBXD132 blade (based on IBM HS21)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         118238
>Category:       kern
>Synopsis:       [bce] [patch] bce driver shows "no carrier" on Intel SBXD132 blade (based on IBM HS21)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    yongari
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 24 20:20:02 UTC 2007
>Closed-Date:    Tue Sep 21 20:20:04 UTC 2010
>Last-Modified:  Tue Sep 21 20:20:04 UTC 2010
>Originator:     Oleg
>Release:        6.3-prerelease
>Organization:
>Environment:
6.3-prerelease, kernel with miibus without any NICs driver
loaded module if_bce.ko 
>Description:
ifconfig bce0 report:

bce0: flags=8847<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=3b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU>
        inet 172.0.0.199 netmask 0xffffff00 broadcast 172.0.0.255
        ether 00:1a:64:33:29:c7
        media: Ethernet autoselect (none)
        status: no carrier


Try to set
#ifconfig bce0 media 1000baseSX mediaopt full-duplex

bce0: flags=8847<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=3b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU>
        inet 172.0.0.199 netmask 0xffffff00 broadcast 172.0.0.255
        ether 00:1a:64:33:29:c7
        media: Ethernet 1000baseSX <full-duplex> (none)
        status: no carrier

---

#pciconf -lv

bce1@pci6:0:0: class=0x020000 .... rev=0x12
NetXtreme II BCM5708S Gigabit Ethernet

...
BCM5715 Broadcom dual gigabit, pci bridge

#dmesg|grep bce

bce0: <Broadcom NetXtreme II BCM5708 1000Base-SX (B2)>
...
bce0: ASIC (0x057081021); Rev (B2); ..


 
>How-To-Repeat:
Install freebsd 6.3-prerelease on Intel SBXD132 (or IBM HS21 may be too)
blade with Broadcom NetXtreme II BMC5708S B2
>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: benno 
State-Changed-When: Sun Nov 25 09:33:28 UTC 2007 
State-Changed-Why:  
I have a patch for this but it needs tidying up before it gets put in to the 
tree. 

Essentially the problem here is a conjunction between some strangeness on 
Broadcom's part and mishandling of same by brgphy.  The PHY in use here uses 
non-standard registers to indicate link state.  brgphy will query them, but 
it waits for the standard registers to indicate state first, which appears to 
be the wrong thing to do. 

Commenting out some lines in brgphy (those to do with the brgphy_status_exit 
goto label) bandaids the problem but I'd like to tidy up the logic a bit 
more. 


Responsible-Changed-From-To: freebsd-bugs->benno 
Responsible-Changed-By: benno 
Responsible-Changed-When: Sun Nov 25 09:33:28 UTC 2007 
Responsible-Changed-Why:  
I have a patch for brgphy that fixes this but it needs work before it goes in 
to the tree. 

This problem results fro the conjunction of some oddness in Broadcom's silicon 
and mishandling of said oddness by brgphy.  The PHY on these parts uses 
non-standard registers to report link status but brgphy waits until the 
standard registers come ready before testing them which appears to be a bad 
idea. 

Commenting out the "goto brgphy_status_exit;" line in brgphy cuts around the 
problem but I'd like to fix the actual logic. 

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

From: CQ CQ de Jason <jason@FreeBSD.csie.nctu.edu.tw>
To: bug-followup@FreeBSD.org, supportsobaka@mail.ru, benno@FreeBSD.org
Cc:  
Subject: Re: kern/118238: [bce] bce driver shows "no carrier" on Intel
	SBXD132 blade (based on IBM HS21)
Date: Sun, 9 Dec 2007 08:54:34 +0800

 Dear Friends,
 
 I am facing the same problem here. The facilities I am using is
 1) IBM BladeCenter Chassis
    http://www-03.ibm.com/systems/bladecenter/chassis/bladechassis/
 2) HS21 server
    http://www-03.ibm.com/systems/bladecenter/hs21/index.html
 3) Nortel layer2 switch installed in the chassis and as the bce0 connected
    by HS21
    http://www-03.ibm.com/systems/bladecenter/switch/switch_ethernet_overview.html
 4) Nortel layer7 switch installed in the chassis and as the bce1 connected
    by HS21
    http://www-03.ibm.com/systems/bladecenter/switch/switch_ethernet_overview.html
 
 After installing FreeBSD 6.3BETA or 7.0BETA on the HS21 server, the first
 network interface (bce0) which connects to the Nortel layer2 switch works
 normally, and the speed tested by FTP can up to 40MB/s.
 
 However, the second network interface (bce1) which connects to the Nortel
 layer 7 switch always shows "no carrier" when using ifconfig. This is the 
 exact the same situation as PR 118238. After applying the patch suggested, 
 by commenting out the brgphy_status_exit in brgphy.c, status of bce1 became
 "active". Unfortunately, using FTP to test the speed of the interface only
 reached around 400KB/s. So we think that the the patch to comment 
 brgphy_status_exit out is only a partial solution that solves the "no carrier"
 problem but the performance issue still remains open.
 
 We appreciate for your effort very much and wish to see the solution soon.
 
 Sincerely,
 Jason Chang
 

From: CQ CQ de Jason <jason@FreeBSD.csie.nctu.edu.tw>
To: bug-followup@FreeBSD.org, supportsobaka@mail.ru, benno@FreeBSD.org
Cc:  
Subject: Re: kern/118238: [bce] bce driver shows "no carrier" on Intel
	SBXD132 blade (based on IBM HS21)
Date: Tue, 11 Dec 2007 15:58:19 +0800

 Dear Friends,
 
 For my previous report, it seems that bce will negotiate to half-duplex
 mode when connect to Nortel Layer 7 switch.
 
 After changing to full-duplex mode manually, it works normally!
 
 Thanks very much for everyone's help!
 
 Sincerely,
 Jason Chang

From: Daniel Bond <db@nsn.no>
To: bug-followup@FreeBSD.org,
 supportsobaka@mail.ru
Cc: davidch@broadcom.com
Subject: Re: kern/118238: [bce] bce driver shows "no carrier" on Intel SBXD132 blade (based on IBM HS21)
Date: Mon, 6 Oct 2008 18:30:13 +0200

 --Apple-Mail-51-190277308
 Content-Type: text/plain;
 	charset=US-ASCII;
 	format=flowed;
 	delsp=yes
 Content-Transfer-Encoding: 7bit
 
 I needed to install a IBM HS21 blade, met this problem, and cooked up  
 a patch based on benno's (very much appreciated),
 the only difference is that it tests for the BCM5708S card, before  
 skipping "goto label_that_only_calls_return();", which should make it  
 safer to include in the tree (?).
 
 I would very much like to see this in a upcoming release, as it would  
 ease the administration of our strictly GENERIC HS20/HS21 environment.
 
 As a side-note for people installing HS21 blades, if you are getting  
 errors of the kind:
 mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x01 Depth 65
 
 set tags to "Depth -1", ie: /sbin/camcontrol tags 0:0:0 -N 64
 
 
 
 I will happily continue to kill SLES in favour of FreeBSD on our  
 HS21's in the time forward :-)
 
 
 --Apple-Mail-51-190277308
 Content-Disposition: attachment;
 	filename=freebsd-brgphy.c-bce5708S-autonegotiation.diff
 Content-Type: application/octet-stream;
 	x-mac-hide-extension=yes;
 	x-unix-mode=0644;
 	name="freebsd-brgphy.c-bce5708S-autonegotiation.diff"
 Content-Transfer-Encoding: 7bit
 
 --- /sys/dev/mii/brgphy.c.orig	2008-10-06 14:45:19.000000000 +0200
 +++ /sys/dev/mii/brgphy.c	2008-10-06 16:54:33.000000000 +0200
 @@ -489,6 +489,11 @@
  	struct mii_data *mii = sc->mii_pdata;
  	int aux, bmcr, bmsr, anar, anlpar, xstat, val;
  
 +	struct bce_softc *bce_sc = NULL;
 +
 +	if (strcmp(mii->mii_ifp->if_dname, "bce") == 0) {
 +		bce_sc = mii->mii_ifp->if_softc;
 +	} 
  
  	mii->mii_media_status = IFM_AVALID;
  	mii->mii_media_active = IFM_ETHER;
 @@ -509,7 +514,13 @@
  	    (bmsr & BRGPHY_BMSR_ACOMP) == 0) {
  		/* Erg, still trying, I guess... */
  		mii->mii_media_active |= IFM_NONE;
 -		goto brgphy_status_exit;
 +
 +		if (!bce_sc) 
 +			goto brgphy_status_exit; /* not a bce-card */ 
 +
 +		if (pci_get_vendor(bce_sc->bce_dev) == BCOM_VENDORID && pci_get_device(bce_sc->bce_dev) != BRCM_DEVICEID_BCM5708S)
 +			goto brgphy_status_exit; /* skipping return here, makes BCM5708S happy */ 
 +
  	}
  
  	/* Autoneg is enabled and complete, link should be up. */
 
 --Apple-Mail-51-190277308
 Content-Type: text/plain;
 	charset=US-ASCII;
 	format=flowed
 Content-Transfer-Encoding: 7bit
 
 
 
 
 
 The patch can also be downloaded from: http://danielbond.org/patches/freebsd-brgphy.c-bce5708S-autonegotiation.diff
 
 
 
 
 
 Best Regards / Med vennlig hilsen
 
 NSN ASA
 
 
 Daniel Bond
 --Apple-Mail-51-190277308--

From: "David Christensen" <davidch@broadcom.com>
To: "Daniel Bond" <db@nsn.no>,
	"bug-followup@FreeBSD.org" <bug-followup@FreeBSD.org>,
	"supportsobaka@mail.ru" <supportsobaka@mail.ru>
Cc:  
Subject: RE: kern/118238: [bce] bce driver shows "no carrier" on Intel
 SBXD132 blade (based on IBM HS21)
Date: Tue, 7 Oct 2008 12:58:37 -0700

 > I needed to install a IBM HS21 blade, met this problem, and cooked up
 > a patch based on benno's (very much appreciated),
 > the only difference is that it tests for the BCM5708S card, before
 > skipping "goto label_that_only_calls_return();", which should make it
 > safer to include in the tree (?).
 >
 > I would very much like to see this in a upcoming release, as it would
 > ease the administration of our strictly GENERIC HS20/HS21 environment.
 
 I'm travelling for another week and I'll look at the patch when I get
 back to the office.  Are you using forced speeds?  The real fix is that
 I need to implement proper support for forced link speeds.
 
 Dave
 

From: Cristi Magherusan <Cristi.Magherusan@net.utcluj.ro>
To: bug-followup@FreeBSD.org, supportsobaka@mail.ru
Cc:  
Subject: Re: kern/118238: [bce] bce driver shows "no carrier" on Intel
 SBXD132 blade (based on IBM HS21)
Date: Fri, 20 Feb 2009 20:28:23 +0200

 --=-h/IecbeycVH/EalvLtZ/
 Content-Type: text/plain; charset="UTF-8"
 Content-Transfer-Encoding: quoted-printable
 
 Hello,
 
 It seems that this bug is still open, and the solution is not yet in the
 tree. I'll check the patch and see if it works. Can someone please
 commit it if it proves to work fine, or are there more test cases
 needed?
 
 Best regards,
 Cristi
 
 --=20
 Ing. Cristi M=C4=83gheru=C8=99an, System/Network Engineer
 Technical University of Cluj-Napoca, Romania
 http://cc.utcluj.ro  +40264 401247
 
 --=-h/IecbeycVH/EalvLtZ/
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: This is a digitally signed message part
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.9 (GNU/Linux)
 
 iEYEABECAAYFAkme9j4ACgkQfwrBISYVZFVNsACbBUUMId6KiQRUP+t44zHBhZxN
 yusAnjVT3aWszZzUoh8bsp+GSca/nsE7
 =Uy5v
 -----END PGP SIGNATURE-----
 
 --=-h/IecbeycVH/EalvLtZ/--
 
Responsible-Changed-From-To: benno->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue May 12 22:42:45 UTC 2009 
Responsible-Changed-Why:  
Reassign this to freebsd-net, to try to get it some attention before 8.0. 

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

From: "Max V. Irgiznov" <m.irgiznov@uljanovsk.comstar-r.ru>
To: <bug-followup@FreeBSD.org>,
	<supportsobaka@mail.ru>
Cc:  
Subject: Re: kern/118238: [bce] [patch] bce driver shows "no carrier" on Intel SBXD132 blade (based on IBM HS21)
Date: Tue, 24 Nov 2009 18:09:43 +0300

 This bug still exist in FreeBSD 8.0-RELEASE #0: Tue Nov 24 17:24:49 UTC 2009
 root@:/usr/obj/usr/src/sys/GENERIC  amd64
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/118238: commit references a PR
Date: Wed, 10 Mar 2010 05:19:23 +0000 (UTC)

 Author: sobomax
 Date: Wed Mar 10 05:19:14 2010
 New Revision: 204941
 URL: http://svn.freebsd.org/changeset/base/204941
 
 Log:
   Provide workaround for the ages old bug affecting certain BCM5708S
   chip revision often found in the blades and resulting in interfaces
   not sensing carrier signal. Looking at all problem reports it
   appears that it only affects some very specific silicon revision
   (ASIC (0x57081021); Rev (B2)) and version of the PHY that
   supports 1000baseSX-FDX media only. Therefore, narrow the scope of
   workaround to combination of that revision and media type. Given
   that the first report on this issue is dated back to 2007, there is
   not much hope that this issue will ever be properly resolved.
   
   Among affected systems are IBM HS21, Intel SBXD132 and HP BL460c.
   
   PR:		118238, 122551, 140970
   MFC after:	1 month
 
 Modified:
   head/sys/dev/mii/brgphy.c
 
 Modified: head/sys/dev/mii/brgphy.c
 ==============================================================================
 --- head/sys/dev/mii/brgphy.c	Wed Mar 10 05:06:47 2010	(r204940)
 +++ head/sys/dev/mii/brgphy.c	Wed Mar 10 05:19:14 2010	(r204941)
 @@ -66,14 +66,17 @@ __FBSDID("$FreeBSD$");
  static int brgphy_probe(device_t);
  static int brgphy_attach(device_t);
  
 +#define BCM5708S_BAD_CHIPID	0x57081021
 +
  struct brgphy_softc {
  	struct mii_softc mii_sc;
  	int mii_oui;
  	int mii_model;
  	int mii_rev;
  	int serdes_flags;	/* Keeps track of the serdes type used */
 -#define BRGPHY_5706S	0x0001
 -#define BRGPHY_5708S	0x0002
 +#define BRGPHY_5706S		0x0001
 +#define BRGPHY_5708S		0x0002
 +#define BRGPHY_NOANWAIT		0x0004
  	int bce_phy_flags;	/* PHY flags transferred from the MAC driver */
  };
  
 @@ -291,6 +294,19 @@ brgphy_attach(device_t dev)
  		if (bce_sc && (bce_sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG)) {
  			ADD(IFM_MAKEWORD(IFM_ETHER, IFM_2500_SX, IFM_FDX, sc->mii_inst), 0);
  			printf("2500baseSX-FDX, ");
 +		} else if ((bsc->serdes_flags & BRGPHY_5708S) && bce_sc &&
 +		    (bce_sc->bce_chipid == BCM5708S_BAD_CHIPID)) {
 +			/*
 +			 * There appears to be certain silicon revision
 +			 * usually used in blades that is having issues with
 +			 * this driver wating for the auto-negotiation to
 +			 * complete. This happens with a specific chip id
 +			 * only and when the 1000baseSX-FDX is the only
 +			 * mode. Workaround this issue since it's unlikely
 +			 * to be ever addressed.
 +			 */
 +			printf("auto-neg workaround, ");
 +			bsc->serdes_flags |= BRGPHY_NOANWAIT;
  		}
  	}
  
 @@ -544,7 +560,8 @@ brgphy_status(struct mii_softc *sc)
  
  	/* Autoneg is still in progress. */
  	if ((bmcr & BRGPHY_BMCR_AUTOEN) &&
 -	    (bmsr & BRGPHY_BMSR_ACOMP) == 0) {
 +	    (bmsr & BRGPHY_BMSR_ACOMP) == 0 &&
 +	    (bsc->serdes_flags & BRGPHY_NOANWAIT) == 0) {
  		/* Erg, still trying, I guess... */
  		mii->mii_media_active |= IFM_NONE;
  		goto brgphy_status_exit;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/118238: commit references a PR
Date: Thu, 25 Mar 2010 23:38:29 +0000 (UTC)

 Author: sobomax
 Date: Thu Mar 25 23:38:10 2010
 New Revision: 205657
 URL: http://svn.freebsd.org/changeset/base/205657
 
 Log:
   MFC: workaround no-carrier issue on IBM HS21.
   
   PR:		118238
 
 Modified:
   stable/8/sys/dev/mii/brgphy.c
 Directory Properties:
   stable/8/sys/dev/mii/   (props changed)
 
 Modified: stable/8/sys/dev/mii/brgphy.c
 ==============================================================================
 --- stable/8/sys/dev/mii/brgphy.c	Thu Mar 25 22:41:01 2010	(r205656)
 +++ stable/8/sys/dev/mii/brgphy.c	Thu Mar 25 23:38:10 2010	(r205657)
 @@ -72,8 +72,9 @@ struct brgphy_softc {
  	int mii_model;
  	int mii_rev;
  	int serdes_flags;	/* Keeps track of the serdes type used */
 -#define BRGPHY_5706S	0x0001
 -#define BRGPHY_5708S	0x0002
 +#define BRGPHY_5706S		0x0001
 +#define BRGPHY_5708S		0x0002
 +#define BRGPHY_NOANWAIT		0x0004
  	int bce_phy_flags;	/* PHY flags transferred from the MAC driver */
  };
  
 @@ -142,6 +143,23 @@ static const struct mii_phydesc brgphys[
  	MII_PHY_END
  };
  
 +#define HS21_PRODUCT_ID	"IBM eServer BladeCenter HS21"
 +#define HS21_BCM_CHIPID	0x57081021
 +
 +static int
 +detect_hs21(struct bce_softc *bce_sc)
 +{
 +	char *sysenv;
 +
 +	if (bce_sc->bce_chipid != HS21_BCM_CHIPID)
 +		return (0);
 +	sysenv = getenv("smbios.system.product");
 +	if (sysenv == NULL)
 +		return (0);
 +	if (strncmp(sysenv, HS21_PRODUCT_ID, strlen(HS21_PRODUCT_ID)) != 0)
 +		return (0);
 +	return (1);
 +}
  
  /* Search for our PHY in the list of known PHYs */
  static int
 @@ -291,6 +309,19 @@ brgphy_attach(device_t dev)
  		if (bce_sc && (bce_sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG)) {
  			ADD(IFM_MAKEWORD(IFM_ETHER, IFM_2500_SX, IFM_FDX, sc->mii_inst), 0);
  			printf("2500baseSX-FDX, ");
 +		} else if ((bsc->serdes_flags & BRGPHY_5708S) && bce_sc &&
 +		    (detect_hs21(bce_sc) != 0)) {
 +			/*
 +			 * There appears to be certain silicon revision
 +			 * in IBM HS21 blades that is having issues with
 +			 * this driver wating for the auto-negotiation to
 +			 * complete. This happens with a specific chip id
 +			 * only and when the 1000baseSX-FDX is the only
 +			 * mode. Workaround this issue since it's unlikely
 +			 * to be ever addressed.
 +			 */
 +			printf("auto-neg workaround, ");
 +			bsc->serdes_flags |= BRGPHY_NOANWAIT;
  		}
  	}
  
 @@ -544,7 +575,8 @@ brgphy_status(struct mii_softc *sc)
  
  	/* Autoneg is still in progress. */
  	if ((bmcr & BRGPHY_BMCR_AUTOEN) &&
 -	    (bmsr & BRGPHY_BMSR_ACOMP) == 0) {
 +	    (bmsr & BRGPHY_BMSR_ACOMP) == 0 &&
 +	    (bsc->serdes_flags & BRGPHY_NOANWAIT) == 0) {
  		/* Erg, still trying, I guess... */
  		mii->mii_media_active |= IFM_NONE;
  		goto brgphy_status_exit;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/118238: commit references a PR
Date: Fri, 26 Mar 2010 00:05:54 +0000 (UTC)

 Author: sobomax
 Date: Fri Mar 26 00:05:42 2010
 New Revision: 205658
 URL: http://svn.freebsd.org/changeset/base/205658
 
 Log:
   MFC: workaround no-carrier issue on IBM HS21.
   
   PR:		118238
 
 Modified:
   stable/7/sys/dev/mii/brgphy.c
 Directory Properties:
   stable/7/sys/dev/mii/   (props changed)
 
 Modified: stable/7/sys/dev/mii/brgphy.c
 ==============================================================================
 --- stable/7/sys/dev/mii/brgphy.c	Thu Mar 25 23:38:10 2010	(r205657)
 +++ stable/7/sys/dev/mii/brgphy.c	Fri Mar 26 00:05:42 2010	(r205658)
 @@ -72,8 +72,9 @@ struct brgphy_softc {
  	int mii_model;
  	int mii_rev;
  	int serdes_flags;	/* Keeps track of the serdes type used */
 -#define BRGPHY_5706S	0x0001
 -#define BRGPHY_5708S	0x0002
 +#define BRGPHY_5706S		0x0001
 +#define BRGPHY_5708S		0x0002
 +#define BRGPHY_NOANWAIT		0x0004
  	int bce_phy_flags;	/* PHY flags transferred from the MAC driver */
  };
  
 @@ -142,6 +143,23 @@ static const struct mii_phydesc brgphys[
  	MII_PHY_END
  };
  
 +#define HS21_PRODUCT_ID	"IBM eServer BladeCenter HS21"
 +#define HS21_BCM_CHIPID	0x57081021
 +
 +static int
 +detect_hs21(struct bce_softc *bce_sc)
 +{
 +	char *sysenv;
 +
 +	if (bce_sc->bce_chipid != HS21_BCM_CHIPID)
 +		return (0);
 +	sysenv = getenv("smbios.system.product");
 +	if (sysenv == NULL)
 +		return (0);
 +	if (strncmp(sysenv, HS21_PRODUCT_ID, strlen(HS21_PRODUCT_ID)) != 0)
 +		return (0);
 +	return (1);
 +}
  
  /* Search for our PHY in the list of known PHYs */
  static int
 @@ -291,6 +309,19 @@ brgphy_attach(device_t dev)
  		if (bce_sc && (bce_sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG)) {
  			ADD(IFM_MAKEWORD(IFM_ETHER, IFM_2500_SX, IFM_FDX, sc->mii_inst), 0);
  			printf("2500baseSX-FDX, ");
 +		} else if ((bsc->serdes_flags & BRGPHY_5708S) && bce_sc &&
 +		    (detect_hs21(bce_sc) != 0)) {
 +			/*
 +			 * There appears to be certain silicon revision
 +			 * in IBM HS21 blades that is having issues with
 +			 * this driver wating for the auto-negotiation to
 +			 * complete. This happens with a specific chip id
 +			 * only and when the 1000baseSX-FDX is the only
 +			 * mode. Workaround this issue since it's unlikely
 +			 * to be ever addressed.
 +			 */
 +			printf("auto-neg workaround, ");
 +			bsc->serdes_flags |= BRGPHY_NOANWAIT;
  		}
  	}
  
 @@ -532,7 +563,8 @@ brgphy_status(struct mii_softc *sc)
  
  	/* Autoneg is still in progress. */
  	if ((bmcr & BRGPHY_BMCR_AUTOEN) &&
 -	    (bmsr & BRGPHY_BMSR_ACOMP) == 0) {
 +	    (bmsr & BRGPHY_BMSR_ACOMP) == 0 &&
 +	    (bsc->serdes_flags & BRGPHY_NOANWAIT) == 0) {
  		/* Erg, still trying, I guess... */
  		mii->mii_media_active |= IFM_NONE;
  		goto brgphy_status_exit;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
Responsible-Changed-From-To: freebsd-net->yongar 
Responsible-Changed-By: andre 
Responsible-Changed-When: Mon Aug 23 18:12:14 UTC 2010 
Responsible-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=118238 
Responsible-Changed-From-To: yongar->yongari 
Responsible-Changed-By: andre 
Responsible-Changed-When: Mon Aug 23 18:12:44 UTC 2010 
Responsible-Changed-Why:  
Over to expert. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118238 
State-Changed-From-To: analyzed->feedback 
State-Changed-By: yongari 
State-Changed-When: Tue Sep 21 18:37:24 UTC 2010 
State-Changed-Why:  
Is it still issue on FreeBSD 8.1-RELEASE? 
There was a attempt to fix the issue(r204941) and it was included 
to 8.1-RELEASE. If you still see the same issue please let me know. 
I have other patch to try. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118238 
State-Changed-From-To: feedback->closed 
State-Changed-By: yongari 
State-Changed-When: Tue Sep 21 20:19:41 UTC 2010 
State-Changed-Why:  
Submitter confirms recent FreeBSD release works without problems. 
Thanks for reporting and testing. 

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