NetBSD Problem Report #26895
Received: (qmail 2502 invoked by uid 605); 9 Sep 2004 18:43:28 -0000
Message-Id: <20040909184322.26D2411152@narn.netbsd.org>
Date: Thu, 9 Sep 2004 18:43:22 +0000 (UTC)
From: djb_pizza@ieee.org
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: djb_pizza@ieee.org
To: gnats-bugs@gnats.NetBSD.org
Subject: i386 PS/2 MCA: toggle shared ram causes spurious resets of NIC on WD8013
X-Send-Pr-Version: www-1.0
>Number: 26895
>Category: port-i386
>Synopsis: i386 PS/2 MCA: toggle shared ram causes spurious resets of NIC on WD8013
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: jdolecek
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Sep 09 18:44:00 +0000 2004
>Closed-Date: Sun May 22 17:53:02 +0000 2005
>Last-Modified: Sun May 22 17:53:02 +0000 2005
>Originator: Dave Barnes
>Release: 2.0_BETA
>Organization:
Consult Engr
>Environment:
PS/2 mod 50z with Reply PowerBoard upgrade
>Description:
WE_MEM_ENABLE(wsc) and WE_MEM_DISABLE(wsc) are unnecessary with Microchannel versions of the WD8013 Ethernet Adapters. Use of hese two macros with microchannel adapters can cause spurious resets to occur on the 83c690 NIC chip.
>How-To-Repeat:
Copy a large >1MB file from a fast server to the PS/2. Observe errors:
example:
"rcp anchovy:/netbsd ."
causes poor performance plus these errors:
Sep 8 14:14:43 PS2 /netbsd: we0: length does not match next packet pointer
Sep 8 14:14:43 PS2 /netbsd: we0: len b088 nlen 1d88 start 0c first 39 curr 00 next 23 stop 40
Sep 8 14:14:43 PS2 /netbsd: we0: NIC memory corrupt - invalid packet length 7560
Sep 8 14:14:46 PS2 /netbsd: we0: device timeout
====
Notice that "curr" the current pointer in the 83c690 has been reset to 0. Normally the current pointer goes from 0x0c to 0x40. Further debugging showed that even the on chip ethernet address storage registers that had been written with the the card's MAC address were also cleared to all 0.
>Fix:
The following diff was applied and completely resolved the problem. This diff, though, breaks non-microchannel cards. A microchannel flag needs to be passed to we.c somehow.
OOPS: The diff left something out. Function we_recv_int() in we.c needs to be fixed so it compiles with the WE_MEM_DISABLE/WE_MEM_ENABLE stuff removed.
==================================================================
--- dev/ic/we.c.orig 2004-09-09 13:18:45.000000000 -0500
+++ dev/ic/we.c 2004-09-09 13:18:03.000000000 -0500
@@ -111,10 +111,15 @@
*/
#define WE_DELAY(wsc) delay(3)
+#define DJB
+/* XXXX Disable the Shared Ram stuff for my Microchannel cards */
/*
* Enable card RAM, and 16-bit access.
*/
-#define WE_MEM_ENABLE(wsc) \
+#ifdef DJB
+ #define WE_MEM_ENABLE(wsc)
+#else
+ #define WE_MEM_ENABLE(wsc) \
do { \
if ((wsc)->sc_16bitp) \
bus_space_write_1((wsc)->sc_asict, (wsc)->sc_asich, \
@@ -123,11 +128,15 @@
WE_MSR, wsc->sc_msr_proto | WE_MSR_MENB); \
WE_DELAY((wsc)); \
} while (0)
+#endif
/*
* Disable card RAM, and 16-bit access.
*/
-#define WE_MEM_DISABLE(wsc) \
+#ifdef DJB
+ #define WE_MEM_DISABLE(wsc)
+#else
+ #define WE_MEM_DISABLE(wsc) \
do { \
bus_space_write_1((wsc)->sc_asict, (wsc)->sc_asich, \
WE_MSR, (wsc)->sc_msr_proto); \
@@ -136,6 +145,7 @@
WE_LAAR, (wsc)->sc_laar_proto); \
WE_DELAY((wsc)); \
} while (0)
+#endif
int
we_config(self, wsc, typestr)
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: port-i386-maintainer->jdolecek
Responsible-Changed-By: jdolecek@netbsd.org
Responsible-Changed-When: Thu, 30 Dec 2004 09:21:28 +0000
Responsible-Changed-Why:
I maintain MCA support.
From: Jaromir Dolecek <jdolecek@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: PR/26895 CVS commit: src/sys/dev
Date: Sun, 3 Apr 2005 10:56:59 +0000 (UTC)
Module Name: src
Committed By: jdolecek
Date: Sun Apr 3 10:56:59 UTC 2005
Modified Files:
src/sys/dev/ic: we.c wevar.h
src/sys/dev/isa: if_we_isa.c
src/sys/dev/mca: if_we_mca.c
Log Message:
Make it possible for attachment to specify that the 16bit access shouldn't
be toggled in WE_MEM_{ENABLE|DISABLE} when receiving or transmitting packets.
Use this to switch the toggle off for MCA cards, since it causes NIC resets
there.
Fixes PR kern/26895 by Dave Barnes.
To generate a diff of this commit:
cvs rdiff -r1.6 -r1.7 src/sys/dev/ic/we.c
cvs rdiff -r1.2 -r1.3 src/sys/dev/ic/wevar.h
cvs rdiff -r1.11 -r1.12 src/sys/dev/isa/if_we_isa.c
cvs rdiff -r1.12 -r1.13 src/sys/dev/mca/if_we_mca.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->feedback
State-Changed-By: jdolecek@netbsd.org
State-Changed-When: Sun, 03 Apr 2005 10:58:19 +0000
State-Changed-Why:
I've committed fix for this to the -current kernel, done in a way
so that the reset is omitted only for MCA cards. Can you give it a try
and report if it fixes your problem?
From: wb4kdi <pizza_hq@charter.net>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: port-i386/26895
Date: Sun, 03 Apr 2005 18:31:44 -0500
Thanks. I'll check it out in the next week or so. I have to get the
Microchannel machine put back together.
Also, thanks for adding the stuff for the Tiara LanCard. That card spent
the better part of the last 10 years in the bottom
of my junk box. It was a wonder the thing still worked after all that
time. I'll check the Tiara code out as well.
Dave Barnes
=====
Jaromir Dolecek wrote:
>----- Forwarded message from jdolecek@netbsd.org -----
>
>From: jdolecek@netbsd.org
>To: jdolecek@netbsd.org, netbsd-bugs@netbsd.org,
> gnats-admin@netbsd.org, jdolecek@netbsd.org, djb_pizza@netbsd.org,
> ieee.org@netbsd.org (at)
>Subject: Re: port-i386/26895
>Cc:
>Date: Sun, 3 Apr 2005 10:58:20 +0000 (UTC)
>
>Synopsis: i386 PS/2 MCA: toggle shared ram causes spurious resets of NIC on WD8013
>
>State-Changed-From-To: open->feedback
>State-Changed-By: jdolecek@netbsd.org
>State-Changed-When: Sun, 03 Apr 2005 10:58:19 +0000
>State-Changed-Why:
>I've committed fix for this to the -current kernel, done in a way
>so that the reset is omitted only for MCA cards. Can you give it a try
>and report if it fixes your problem?
>
>
>----- End forwarded message -----
>
>
>
From: wb4kdi <pizza_hq@charter.net>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: port-i386/26895
Date: Sun, 10 Apr 2005 20:16:59 -0500
NetBSD 3.99.3 (2005/01/01 DJB.ps2:2.0) #3: Sat Apr 9 09:54:55 CDT 2005
root@PizzaHut:/usr/src/sys/arch/i386/compile/DJB
total memory = 32380 KB
avail memory = 30120 KB
mainbus0 (root)
cpu0 at mainbus0: (uniprocessor)
cpu0: AMD Am5x86 W/T 133/160 (486-class), id 0x4e4
cpu0: features 1<FPU>
mca0 at mainbus0
we0 at mca0 slot 1 port 0x800-0x81f mem 0xd0000-0xd1fff irq 10:
EtherCard PLUS Elite/A (8013EP/A)
we0: WD8013EP/A Ethernet (16-bit)
we0: Ethernet address 00:00:c0:b3:1c:44
mca0 slot 3: product 0x8eff not configured
...
# ifconfig -a
we0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
address: 00:00:c0:b3:1c:44
media: Ethernet 10base5
inet 10.0.0.99 netmask 0xffffff00 broadcast 10.0.0.255
lo0: flags=8009<UP,LOOPBACK,MULTICAST> mtu 33192
inet 127.0.0.1 netmask 0xff000000
# ping anchovy
PING anchovy (10.0.0.104): 56 data bytes
64 bytes from 10.0.0.104: icmp_seq=0 ttl=255 time=1.944 ms
64 bytes from 10.0.0.104: icmp_seq=1 ttl=255 time=2.133 ms
64 bytes from 10.0.0.104: icmp_seq=2 ttl=255 time=2.131 ms
^C
----anchovy PING Statistics----
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 1.944/2.069/2.133/0.109 ms
# ping -f anchovy
PING anchovy (10.0.0.104): 56 data bytes
.^C
----anchovy PING Statistics----
29868 packets transmitted, 29868 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 1.218/1.364/10.063/0.122 ms
689.7 packets/sec sent, 689.7 packets/sec received
# pwd
/root
# rcp anchovy:/netbsd .
# rcp anchovy:/netbsd .
# rcp anchovy:/netbsd .
======
All fixed! Thanks.
djb
State-Changed-From-To: feedback->closed
State-Changed-By: jdolecek@netbsd.org
State-Changed-When: Sun, 22 May 2005 17:53:02 +0000
State-Changed-Why:
This has been fixed.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.