netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tg3: capacitive coupling detection fix
@ 2005-02-11 20:44 Michael Chan
  2005-02-11 21:13 ` David S. Miller
  2005-02-11 21:19 ` john stultz
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Chan @ 2005-02-11 20:44 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, linux-kernel, john stultz

[-- Attachment #1: Type: text/plain, Size: 381 bytes --]

This patch fixes the problem reported in:

http://marc.theaimsgroup.com/?l=linux-kernel&m=110798711911645&w=2


The 5700 link problem was caused by reading uninitialized values in sram and
causing capacitive coupling mode to be enabled by mistake. This patch fixes
the problem by properly validating the sram contents.


Signed-off-by: Michael Chan <mchan@broadcom.com>

[-- Attachment #2: tg3_cap_cpling.patch --]
[-- Type: application/octet-stream, Size: 1313 bytes --]

diff -Nru 2/tg3.c 3/tg3.c
--- 2/tg3.c	2005-02-10 10:22:39.000000000 -0800
+++ 3/tg3.c	2005-02-10 10:26:42.000000000 -0800
@@ -7515,12 +7515,18 @@
 	tg3_read_mem(tp, NIC_SRAM_DATA_SIG, &val);
 	if (val == NIC_SRAM_DATA_SIG_MAGIC) {
 		u32 nic_cfg, led_cfg;
-		u32 nic_phy_id, cfg2;
+		u32 nic_phy_id, ver, cfg2 = 0;
 
 		tg3_read_mem(tp, NIC_SRAM_DATA_CFG, &nic_cfg);
 		tp->nic_sram_data_cfg = nic_cfg;
 
-		tg3_read_mem(tp, NIC_SRAM_DATA_CFG_2, &cfg2);
+		tg3_read_mem(tp, NIC_SRAM_DATA_VER, &ver);
+		ver >>= NIC_SRAM_DATA_VER_SHIFT;
+		if ((GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700) &&
+		    (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701) &&
+		    (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5703) &&
+		    (ver > 0) && (ver < 0x100))
+			tg3_read_mem(tp, NIC_SRAM_DATA_CFG_2, &cfg2);
 
 		eeprom_signature_found = 1;
 
diff -Nru 2/tg3.h 3/tg3.h
--- 2/tg3.h	2005-02-10 10:22:43.000000000 -0800
+++ 3/tg3.h	2005-02-10 10:26:44.000000000 -0800
@@ -1452,6 +1452,9 @@
 #define  NIC_SRAM_DATA_CFG_FIBER_WOL		 0x00004000
 #define  NIC_SRAM_DATA_CFG_NO_GPIO2		 0x00100000
 
+#define NIC_SRAM_DATA_VER			0x00000b5c
+#define  NIC_SRAM_DATA_VER_SHIFT		 16
+
 #define NIC_SRAM_DATA_PHY_ID		0x00000b74
 #define  NIC_SRAM_DATA_PHY_ID1_MASK	 0xffff0000
 #define  NIC_SRAM_DATA_PHY_ID2_MASK	 0x0000ffff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tg3: capacitive coupling detection fix
  2005-02-11 20:44 [PATCH] tg3: capacitive coupling detection fix Michael Chan
@ 2005-02-11 21:13 ` David S. Miller
  2005-02-11 21:19 ` john stultz
  1 sibling, 0 replies; 3+ messages in thread
From: David S. Miller @ 2005-02-11 21:13 UTC (permalink / raw)
  To: Michael Chan; +Cc: netdev, linux-kernel, johnstul

On Fri, 11 Feb 2005 12:44:10 -0800
"Michael Chan" <mchan@broadcom.com> wrote:

> This patch fixes the problem reported in:
> 
> http://marc.theaimsgroup.com/?l=linux-kernel&m=110798711911645&w=2
> 
> The 5700 link problem was caused by reading uninitialized values in sram and
> causing capacitive coupling mode to be enabled by mistake. This patch fixes
> the problem by properly validating the sram contents.
> 
> Signed-off-by: Michael Chan <mchan@broadcom.com>

Applied, thanks a lot Michael.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tg3: capacitive coupling detection fix
  2005-02-11 20:44 [PATCH] tg3: capacitive coupling detection fix Michael Chan
  2005-02-11 21:13 ` David S. Miller
@ 2005-02-11 21:19 ` john stultz
  1 sibling, 0 replies; 3+ messages in thread
From: john stultz @ 2005-02-11 21:19 UTC (permalink / raw)
  To: Michael Chan
  Cc: David S. Miller, netdev, lkml, Chris McDermott, keith maanthey

On Fri, 2005-02-11 at 12:44 -0800, Michael Chan wrote:
> This patch fixes the problem reported in:
> 
> http://marc.theaimsgroup.com/?l=linux-kernel&m=110798711911645&w=2
> 
> 
> The 5700 link problem was caused by reading uninitialized values in sram and
> causing capacitive coupling mode to be enabled by mistake. This patch fixes
> the problem by properly validating the sram contents.

Verified as working on the x440 I was seeing the trouble with.

Thanks!
-john

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-02-11 21:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-11 20:44 [PATCH] tg3: capacitive coupling detection fix Michael Chan
2005-02-11 21:13 ` David S. Miller
2005-02-11 21:19 ` john stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).