NetBSD Problem Report #38757

From hf@spg.tu-darmstadt.de  Mon May 26 10:19:33 2008
Return-Path: <hf@spg.tu-darmstadt.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id DDECA63B880
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 26 May 2008 10:19:32 +0000 (UTC)
Message-Id: <200805261019.m4QAJGcV019910@Gstoder.nt.e-technik.tu-darmstadt.de>
Date: Mon, 26 May 2008 12:19:16 +0200 (CEST)
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Reply-To: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: gnats-bugs@gnats.NetBSD.org
Cc: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Subject: mac68k sm(4) times out
X-Send-Pr-Version: 3.95

>Number:         38757
>Category:       kern
>Synopsis:       mac68k sm(4) times out
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    rjs
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 26 10:20:00 +0000 2008
>Closed-Date:    Sat Sep 27 17:57:16 +0000 2008
>Last-Modified:  Sat Sep 27 17:57:16 +0000 2008
>Originator:     Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
>Release:        NetBSD 4.99.63
>Organization:
-- 
     The ASCII Ribbon Campaign                    Hauke Fath
()     No HTML/RTF in email	        Institut für Nachrichtentechnik
/\     No Word docs in email                     TU Darmstadt
     Respect for open standards              Ruf +49-6151-16-3281
>Environment:


System: NetBSD 4.99.63 (GENERICSBC) #3: Mon May 26 10:55:33 CEST 2008
        hf@Hochstuhl:/var/obj/netbsd-builds/developer/mac68k/sys/arch/mac68k/compile/GENERICSBC
Architecture: m68k
Machine: mac68k
>Description:

	The sm(4) driver on mac68k-current times out when used.

NetBSD 4.99.63 (GENERICSBC) #3: Mon May 26 10:55:33 CEST 2008
        hf@Hochstuhl:/var/obj/netbsd-builds/developer/mac68k/sys/arch/mac68k/compile/GENERICSBC
Apple Macintosh Quadra 650  (68040)
cpu: delay factor 1280
fpu: mc68040
total memory = 136 MB
avail memory = 128 MB

[...]

sm0 at nubus0 slot e: AsanteFAST 10/100 NB
sm0: SMC91C100, revision 0, buffer size: 128 KB
sm0: MAC address 00:00:94:75:93:d9, default media MII
nsphy0 at sm0 phy 5: DP83840 10/100 media interface, rev. 0
nsphy0: 10baseT, 100baseTX, auto

[...]

Adding interface aliases:
Starting dhclient.
sm0: device timeout
sm0: device timeout
sm0: device timeout
sm0: device timeout
sm0: device timeout
sm0: device timeout
PING 130.83.118.126 (130.83.118.126): 56 data bytes

----130.83.118.126 PING Statistics----
1 packets transmitted, 0 packets received, 100.0% packet loss

-- same result with manual configuration.

I am making this "category kern", since the MD Nubus frontend is only a
shim that has not seen changes in a long time. The driver works just
fine on netbsd-4, so whatever rototilling the MI sys/dev/ic/smc91cxx.[ch] has
seen in the meantime is most likely responsible.

>How-To-Repeat:

Boot a 4.99.63 kernel on mac68k equipped with an Asante 10/100 MBit
Nubus card.

>Fix:
	None.

>Release-Note:

>Audit-Trail:
From: Hauke Fath <hf@spg.tu-darmstadt.de>
To: Robert Swindells <rjs@fdy2.demon.co.uk>
Cc: Hauke Fath {TUD} <hf@spg.tu-darmstadt.de>, gnats-bugs@netbsd.org
Subject: Re: kern/38757
Date: Thu, 14 Aug 2008 14:13:31 +0200

 At 20:29 Uhr +0200 13.08.2008, Hauke Fath wrote:
 >--- begin forwarded text
 >
 >From: Robert Swindells <rjs@fdy2.demon.co.uk>
 >To: hauke@Espresso.Rhein-Neckar.de
 >Subject: Re: NetBSD Problem Report #38757
 >Date: Tue, 12 Aug 2008 22:13:40 +0100 (BST)
 >
 >
 >Would you be able to try out the following patch ?


 Works nicely, thanks!

 	hauke


 >Robert Swindells
 >
 >Index: smc91cxx.c
 >===================================================================
 >RCS file: /cvsroot/src/sys/dev/ic/smc91cxx.c,v
 >retrieving revision 1.69
 >diff -u -r1.69 smc91cxx.c
 >--- smc91cxx.c	25 May 2008 16:21:54 -0000	1.69
 >+++ smc91cxx.c	12 Aug 2008 21:02:27 -0000
 >@@ -133,7 +133,6 @@
 >
 >  /* XXX Hardware padding doesn't work yet(?) */
 >  #define	SMC91CXX_SW_PAD
 >-#define	SMC91CXX_NO_BYTE_WRITE
 >
 >  const char *smc91cxx_idstrs[] = {
 >  	NULL,				/* 0 */
 >@@ -773,6 +772,7 @@
 >  	oddbyte = smc91cxx_copy_tx_frame(sc, m);
 >
 >  #ifdef SMC91CXX_SW_PAD
 >+#ifdef SMC91CXX_NO_BYTE_WRITE
 >  #if BYTE_ORDER == LITTLE_ENDIAN
 >  	if (pad > 1 && (pad & 1)) {
 >  		bus_space_write_2(bst, bsh, DATA_REG_W, oddbyte << 0);
 >@@ -784,6 +784,7 @@
 >  		oddbyte = 0;
 >  	}
 >  #endif
 >+#endif
 >
 >  	/*
 >  	 * Push out padding.
 >@@ -794,6 +795,7 @@
 >  	}
 >  #endif
 >
 >+#ifdef SMC91CXX_NO_BYTE_WRITE
 >  	/*
 >  	 * Push out control byte and unused packet byte.  The control byte
 >  	 * is 0, meaning the packet is even lengthed and no special
 >@@ -806,6 +808,10 @@
 >  	bus_space_write_2(bst, bsh, DATA_REG_W,
 >  	    (oddbyte << 8) | (pad ? CTLB_ODD : 0));
 >  #endif
 >+#else
 >+	if (pad)
 >+		bus_space_write_1(bst, bsh, DATA_REG_B, 0);
 >+#endif
 >
 >  	/*
 >  	 * Enable transmit interrupts and let the chip go.  Set a watchdog
 >@@ -913,6 +919,10 @@
 >  			panic("smc91cxx_copy_tx_frame: p != lim");
 >  #endif
 >  	}
 >+#ifndef SMC91CXX_NO_BYTE_WRITE
 >+	if (leftover)
 >+		bus_space_write_1(bst, bsh, DATA_REG_B, dbuf);
 >+#endif
 >  	return dbuf;
 >  }
 >
 >@@ -928,7 +938,10 @@
 >  	bus_space_tag_t bst = sc->sc_bst;
 >  	bus_space_handle_t bsh = sc->sc_bsh;
 >  	u_int8_t mask, interrupts, status;
 >-	u_int16_t packetno, tx_status, card_stats, v;
 >+	u_int16_t packetno, tx_status, card_stats;
 >+#ifdef SMC91CXX_NO_BYTE_WRITE
 >+	u_int16_t v;
 >+#endif
 >
 >  	if ((sc->sc_flags & SMC_FLAGS_ENABLED) == 0 ||
 >  	    !device_is_active(&sc->sc_dev))
 >@@ -939,6 +952,7 @@
 >  	/*
 >  	 * Obtain the current interrupt status and mask.
 >  	 */
 >+#ifdef SMC91CXX_NO_BYTE_WRITE
 >  	v = bus_space_read_2(bst, bsh, INTR_STAT_REG_B);
 >
 >  	/*
 >@@ -953,6 +967,15 @@
 >  	mask = v & 0xff;
 >  #endif
 >  	KDASSERT(mask == sc->sc_intmask);
 >+#else
 >+	mask = bus_space_read_1(bst, bsh, INTR_MASK_REG_B);
 >+
 >+	/*
 >+	 * Get the set of interrupt which occurred and eliminate any
 >+	 * which are not enabled.
 >+	 */
 >+	interrupts = bus_space_read_1(bst, bsh, INTR_STAT_REG_B);
 >+#endif
 >  	status = interrupts & mask;
 >
 >  	/* Ours? */
 >
 >--- end forwarded text

 -- 
       The ASCII Ribbon Campaign                    Hauke Fath
 ()     No HTML/RTF in email            Institut für Nachrichtentechnik
 /\     No Word docs in email                     TU Darmstadt
       Respect for open standards              Ruf +49-6151-16-3281

Responsible-Changed-From-To: kern-bug-people->rjs
Responsible-Changed-By: rjs@NetBSD.org
Responsible-Changed-When: Fri, 15 Aug 2008 12:40:32 +0000
Responsible-Changed-Why:
Working on fix.


From: Robert Swindells <rjs@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/38757 CVS commit: src/sys/dev/ic
Date: Wed,  3 Sep 2008 20:36:24 +0000 (UTC)

 Module Name:	src
 Committed By:	rjs
 Date:		Wed Sep  3 20:36:24 UTC 2008

 Modified Files:
 	src/sys/dev/ic: smc91cxx.c

 Log Message:
 Make it work again for platforms that can do single byte operations.

 Fix to PR kern/38757.


 To generate a diff of this commit:
 cvs rdiff -r1.69 -r1.70 src/sys/dev/ic/smc91cxx.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: rjs@NetBSD.org
State-Changed-When: Wed, 03 Sep 2008 21:02:50 +0000
State-Changed-Why:
Set to feedback.


From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: gnats-bugs@NetBSD.org
Cc: rjs@NetBSD.org, gnats-admin@NetBSD.org
Subject: Re: PR/38757 CVS commit: src/sys/dev/ic
Date: Wed, 24 Sep 2008 21:04:35 +0200

 At 20:40 Uhr +0000 3.9.2008, Robert Swindells wrote:
 > Modified Files:
 > 	src/sys/dev/ic: smc91cxx.c
 >
 > Log Message:
 > Make it work again for platforms that can do single byte operations.
 >
 > Fix to PR kern/38757.

 Works nicely, thanks! The PR can be closed.

 	hauke

 --
 "It's never straight up and down"     (DEVO)


State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 27 Sep 2008 17:57:16 +0000
State-Changed-Why:
Confirmed fixed.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.