NetBSD Problem Report #6460

Received: (qmail 11559 invoked from network); 19 Nov 1998 15:12:31 -0000
Message-Id: <199811191511.KAA14038@doppelganger.old-oak.net>
Date: Thu, 19 Nov 1998 10:11:54 -0500 (EST)
From: rafal@mediaone.net
Reply-To: rafal@mediaone.net
To: gnats-bugs@gnats.netbsd.org
Subject: ne2000.c logs needless "ne200_writemem failed to complete" messages
X-Send-Pr-Version: 3.95

>Number:         6460
>Category:       kern
>Synopsis:       ne2000.c logs needless "ne200_writemem failed to complete" msgs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 19 07:20:00 +0000 1998
>Closed-Date:    Fri Dec 18 21:51:05 +0000 1998
>Last-Modified:  Fri Dec 18 21:51:13 +0000 1998
>Originator:     Rafal Boni
>Release:        Nov 15, 98 -current
>Organization:
lack thereof
>Environment:
	1.3H on x86 as of 11/15/98
	DEC VP765 laptop
	SVEC/Hawking technologies PCMCIA ethernet card (ne2000-compat)

>Description:
	ne2000.c logs "ne2000_writemem failed to complete" messages, leading
	one to believe the hardware is failing, when the failure case is
	actually expected in certain cases.

>How-To-Repeat:
	Boot 1.3H on my DEC laptop with el-cheapo PCMCIA ethernet card.
	Get a "ne2000_writemem failed to complete" message while the kernel
	probes the PCMCIA network card.  Wonder whether the hardware is
	bad (which it isn't... It works just peachy after the probe, as 
	well as in NT)

>Fix:

Two options:

(1) Selectively disable the "ne2000_writemem failed to complete" message,
    depending on whether we expect it to fail.  Patch to do this is
    attached below:

(2) Always disable the message, as it seems to be used only during the probe,
    and therefore probably expected to fail more than not.

I'm going with (1), because you can still achieve the same end as (2) without
the big-hammer approach.  I only pass the 'quiet' flag to ne200_writemem in
one place (the one place where the failure really is expected, which is also
the same place I was getting ther message from)

--- ne2000.c	Thu Nov 19 09:48:14 1998
+++ ne2000.c.rkb	Thu Nov 19 09:43:47 1998
@@ -88,7 +88,8 @@
 int	ne2000_test_mem __P((struct dp8390_softc *));

 void	ne2000_writemem __P((bus_space_tag_t, bus_space_handle_t,
-	    bus_space_tag_t, bus_space_handle_t, u_int8_t *, int, size_t, int));
+	    bus_space_tag_t, bus_space_handle_t, u_int8_t *, int, size_t, 
+	    int, int));
 void	ne2000_readmem __P((bus_space_tag_t, bus_space_handle_t,
 	    bus_space_tag_t, bus_space_handle_t, int, u_int8_t *, size_t, int));

@@ -163,7 +164,7 @@
 		/* Search for the start of RAM. */
 		for (x = 1; x < 256; x++) {
 			ne2000_writemem(nict, nich, asict, asich, pbuf0,
-			    x << ED_PAGE_SHIFT, ED_PAGE_SIZE, useword);
+			    x << ED_PAGE_SHIFT, ED_PAGE_SIZE, useword, 0);
 			ne2000_readmem(nict, nich, asict, asich,
 			    x << ED_PAGE_SHIFT, tbuf, ED_PAGE_SIZE, useword);
 			if (bcmp(pbuf0, tbuf, ED_PAGE_SIZE) == 0) {
@@ -171,7 +172,7 @@
 					pbuf[i] = 255 - x;
 				ne2000_writemem(nict, nich, asict, asich,
 				    pbuf, x << ED_PAGE_SHIFT, ED_PAGE_SIZE,
-				    useword);
+				    useword, 0);
 				ne2000_readmem(nict, nich, asict, asich,
 				    x << ED_PAGE_SHIFT, tbuf, ED_PAGE_SIZE,
 				    useword);
@@ -192,7 +193,7 @@
 		/* Search for the end of RAM. */
 		for (++x; x < 256; x++) {
 			ne2000_writemem(nict, nich, asict, asich, pbuf0,
-			    x << ED_PAGE_SHIFT, ED_PAGE_SIZE, useword);
+			    x << ED_PAGE_SHIFT, ED_PAGE_SIZE, useword, 0);
 			ne2000_readmem(nict, nich, asict, asich,
 			    x << ED_PAGE_SHIFT, tbuf, ED_PAGE_SIZE, useword);
 			if (bcmp(pbuf0, tbuf, ED_PAGE_SIZE) == 0) {
@@ -200,7 +201,7 @@
 					pbuf[i] = 255 - x;
 				ne2000_writemem(nict, nich, asict, asich,
 				    pbuf, x << ED_PAGE_SHIFT, ED_PAGE_SIZE,
-				    useword);
+				    useword, 0);
 				ne2000_readmem(nict, nich, asict, asich,
 				    x << ED_PAGE_SHIFT, tbuf, ED_PAGE_SIZE,
 				    useword);
@@ -362,7 +363,7 @@
 	 * board is an NE2000.
 	 */
 	ne2000_writemem(nict, nich, asict, asich, test_pattern, 8192,
-	    sizeof(test_pattern), 0);
+	    sizeof(test_pattern), 0, 1);
 	ne2000_readmem(nict, nich, asict, asich, 8192, test_buffer,
 	    sizeof(test_buffer), 0);

@@ -380,7 +381,7 @@
 		 * then we don't know what this board is.
 		 */
 		ne2000_writemem(nict, nich, asict, asich, test_pattern, 16384,
-		    sizeof(test_pattern), 1);
+		    sizeof(test_pattern), 1, 0);
 		ne2000_readmem(nict, nich, asict, asich, 16384, test_buffer,
 		    sizeof(test_buffer), 1);

@@ -660,7 +661,7 @@
  * used in the probe routine to test the memory.  'len' must be even.
  */
 void
-ne2000_writemem(nict, nich, asict, asich, src, dst, len, useword)
+ne2000_writemem(nict, nich, asict, asich, src, dst, len, useword, quiet)
 	bus_space_tag_t nict;
 	bus_space_handle_t nich;
 	bus_space_tag_t asict;
@@ -669,6 +670,7 @@
 	int dst;
 	size_t len;
 	int useword;
+	int quiet;
 {
 	int maxwait = 100;	/* about 120us */

@@ -708,6 +710,6 @@
 	while (((bus_space_read_1(nict, nich, ED_P0_ISR) & ED_ISR_RDC) !=
 	    ED_ISR_RDC) && --maxwait);

-	if (maxwait == 0)
+	if (!quiet && maxwait == 0)
 		printf("ne2000_writemem: failed to complete\n");
 }
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: thorpej 
State-Changed-When: Fri Dec 18 13:51:05 PST 1998 
State-Changed-Why:  
Fixed.  Thanks! 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(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.