bge(4) on BCM 5752 A02 panic due to media autoselect

From: LI Xin <delphij_at_delphij.net>
Date: Thu, 31 Aug 2006 01:06:49 +0800
Hi, folks,

Recently one of my colleagues found that BCM 5752 A02 on Dell Latitude
D820 would get "panic: invalid ife->ifm_data (0xa) in mii_phy_setmedia".
 After some investigation I have found that removing BCMR_ANEG from
mii_capabilities in ukphy.c would work around the problem, and it turns
out that without explicitly specifying media type, the code will finally
get to pass the "intentionally invalid index" to mii_phy_setmedia and
trigger an assertion fail.

I have not tested the situation in -STABLE yet, but it was said to work
there, though.  Is there anyone can shed some light to me about how to
debug the issue?  Thanks in advance!

PS. During the debugging I have found that the attached patch can make
"bge0: firmware handshake timeout" issue disappear from the said chip.
Because I do not have Broadcom specification at hand I would like to see
if there is someone to give appropriate review for it.

Cheers,
-- 
Xin LI <delphij_at_delphij.net>	http://www.delphij.net/
FreeBSD - The Power to Serve!

Index: if_bge.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/bge/if_bge.c,v
retrieving revision 1.140
diff -u -r1.140 if_bge.c
--- if_bge.c	24 Aug 2006 14:41:16 -0000	1.140
+++ if_bge.c	29 Aug 2006 06:20:44 -0000
_at__at_ -2313,6 +2313,13 _at__at_
 	    BGE_PCIMISCCTL_INDIRECT_ACCESS|BGE_PCIMISCCTL_MASK_PCI_INTR|
 	BGE_HIF_SWAP_OPTIONS|BGE_PCIMISCCTL_PCISTATE_RW, 4);
 
+	/* XXX: Broadcom Linux driver. */
+	if (sc->bge_asicrev == BGE_ASICREV_BCM5752 ||
+	    sc->bge_asicrev == BGE_ASICREV_BCM5755 ||
+	    sc->bge_asicrev == BGE_ASICREV_BCM5787) {
+		CSR_WRITE_4(sc, BGE_FASTBOOT_PC, 0x0);
+	}
+
 	reset = BGE_MISCCFG_RESET_CORE_CLOCKS|(65<<1);
 
 	/* XXX: Broadcom Linux driver. */
Index: if_bgereg.h
===================================================================
RCS file: /home/ncvs/src/sys/dev/bge/if_bgereg.h,v
retrieving revision 1.52
diff -u -r1.52 if_bgereg.h
--- if_bgereg.h	23 Aug 2006 11:32:54 -0000	1.52
+++ if_bgereg.h	29 Aug 2006 06:32:31 -0000
_at__at_ -1656,6 +1656,7 _at__at_
 #define BGE_EE_CTL			0x6840
 #define BGE_MDI_CTL			0x6844
 #define BGE_EE_DELAY			0x6848
+#define BGE_FASTBOOT_PC			0x6894
 
 /* Mode control register */
 #define BGE_MODECTL_INT_SNDCOAL_ONLY	0x00000001

Received on Wed Aug 30 2006 - 15:07:28 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:59 UTC