From nobody@FreeBSD.org  Tue Jul 30 13:10:35 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 9D5D459F
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Jul 2013 13:10:35 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 8A42221FD
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Jul 2013 13:10:35 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r6UDAZAC015176
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Jul 2013 13:10:35 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r6UDAZ8R015171;
	Tue, 30 Jul 2013 13:10:35 GMT
	(envelope-from nobody)
Message-Id: <201307301310.r6UDAZ8R015171@oldred.freebsd.org>
Date: Tue, 30 Jul 2013 13:10:35 GMT
From: Andrew Yong <andrew@0x.sg>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Fix for BCM57780 LEDs in if_bge.c
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         180948
>Category:       kern
>Synopsis:       [bge] [patch] Fix for BCM57780 LEDs in if_bge.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    yongari
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 30 13:20:00 UTC 2013
>Closed-Date:    Wed Nov 06 08:41:35 UTC 2013
>Last-Modified:  Wed Nov 06 08:41:35 UTC 2013
>Originator:     Andrew Yong
>Release:        8.3-RELEASE
>Organization:
-
>Environment:
FreeBSD edge.0x.sg 8.3-RELEASE-p8 FreeBSD 8.3-RELEASE-p8 #1: Mon Jul 29 16:54:59 EDT 2013     root@snapshots-8_3-amd64.builders.pfsense.org:/usr/obj.pfSense/usr/pfSensesrc/src/sys/pfSense_SMP.8  amd64
>Description:
Activity and Link LEDs do not work on BCM57780 NICs.
>How-To-Repeat:
Load bge modules. LEDs remain non-functional after warm reboot.
>Fix:
Fixed in HEAD: http://svnweb.freebsd.org/base/head/sys/dev/bge/if_bge.c?r1=251733&r2=252227

Patch against 8.3-RELENG:
--- if_bge.c	2013-07-30 21:01:07.000000000 +0800
+++ if_bge.c	2013-07-30 21:01:27.000000000 +0800
@@ -2030,7 +2030,7 @@
 	CSR_WRITE_4(sc, BGE_MAC_MODE, val);
 
 	/* Set misc. local control, enable interrupts on attentions */
-	CSR_WRITE_4(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN);
+	BGE_SETBIT(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN);
 
 #ifdef notdef
 	/* Assert GPIO pins for PHY reset */

Patch attached with submission follows:

--- if_bge.c.head	2013-07-30 21:01:07.000000000 +0800
+++ if_bge.c	2013-07-30 21:01:27.000000000 +0800
@@ -2030,7 +2030,7 @@
 	CSR_WRITE_4(sc, BGE_MAC_MODE, val);
 
 	/* Set misc. local control, enable interrupts on attentions */
-	CSR_WRITE_4(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN);
+	BGE_SETBIT(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN);
 
 #ifdef notdef
 	/* Assert GPIO pins for PHY reset */

>Release-Note:
>Audit-Trail:

From: Andrew Yong <andrew@0x.sg>
To: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org
Cc:  
Subject: Re: misc/180948: Fix for BCM57780 LEDs in if_bge.c
Date: Tue, 30 Jul 2013 21:28:24 +0800

 --001a1133232e6448f204e2ba9587
 Content-Type: text/plain; charset=ISO-8859-1
 
 Apologies. This patch is against /base/release/8.3.0/sys/dev/bge/if_bge.c
 and was backported from HEAD.
 
 It can be patched against almost every branch, incl. 8.3.0 RELENG
 
 
 On Tue, Jul 30, 2013 at 9:20 PM, <FreeBSD-gnats-submit@freebsd.org> wrote:
 
 > Thank you very much for your problem report.
 > It has the internal identification `misc/180948'.
 > The individual assigned to look at your
 > report is: freebsd-bugs.
 >
 > You can access the state of your problem report at any time
 > via this link:
 >
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=180948
 >
 > >Category:       misc
 > >Responsible:    freebsd-bugs
 > >Synopsis:       Fix for BCM57780 LEDs in if_bge.c
 > >Arrival-Date:   Tue Jul 30 13:20:00 UTC 2013
 >
 
 --001a1133232e6448f204e2ba9587
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 <div dir=3D"ltr">Apologies. This patch is against=A0/base/release/8.3.0/sys=
 /dev/bge/if_bge.c and was backported from HEAD.<div><br></div><div>It can b=
 e patched against almost every branch, incl. 8.3.0 RELENG</div></div><div c=
 lass=3D"gmail_extra">
 <br><br><div class=3D"gmail_quote">On Tue, Jul 30, 2013 at 9:20 PM,  <span =
 dir=3D"ltr">&lt;<a href=3D"mailto:FreeBSD-gnats-submit@freebsd.org" target=
 =3D"_blank">FreeBSD-gnats-submit@freebsd.org</a>&gt;</span> wrote:<br><bloc=
 kquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #cc=
 c solid;padding-left:1ex">
 Thank you very much for your problem report.<br>
 It has the internal identification `misc/180948&#39;.<br>
 The individual assigned to look at your<br>
 report is: freebsd-bugs.<br>
 <br>
 You can access the state of your problem report at any time<br>
 via this link:<br>
 <br>
 <a href=3D"http://www.freebsd.org/cgi/query-pr.cgi?pr=3D180948" target=3D"_=
 blank">http://www.freebsd.org/cgi/query-pr.cgi?pr=3D180948</a><br>
 <br>
 &gt;Category: =A0 =A0 =A0 misc<br>
 &gt;Responsible: =A0 =A0freebsd-bugs<br>
 &gt;Synopsis: =A0 =A0 =A0 Fix for BCM57780 LEDs in if_bge.c<br>
 &gt;Arrival-Date: =A0 Tue Jul 30 13:20:00 UTC 2013<br>
 </blockquote></div><br></div>
 
 --001a1133232e6448f204e2ba9587--
Responsible-Changed-From-To: freebsd-bugs->yongari 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Aug 2 02:57:47 UTC 2013 
Responsible-Changed-Why:  
This is a request for MFC of r252227 by yongari. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=180948 
State-Changed-From-To: open->patched 
State-Changed-By: linimon 
State-Changed-When: Fri Aug 2 02:59:10 UTC 2013 
State-Changed-Why:  
Probably should set this as 'patched'. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=180948 
State-Changed-From-To: patched->closed 
State-Changed-By: yongari 
State-Changed-When: Wed Nov 6 08:41:07 UTC 2013 
State-Changed-Why:  
Close, the change was merged to stable. 

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