NetBSD Problem Report #30549

From hauke@Espresso.Rhein-Neckar.DE  Sat Jun 18 15:05:12 2005
Return-Path: <hauke@Espresso.Rhein-Neckar.DE>
Received: from la3serv.rninet.de (la3serv.rninet.de [62.225.55.3])
	by narn.netbsd.org (Postfix) with ESMTP id 093C263B116
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 18 Jun 2005 15:05:11 +0000 (UTC)
Message-Id: <200506181449.j5IEnjQJ001651@pizza.causeuse.org>
Date: Sat, 18 Jun 2005 16:49:46 +0200 (CEST)
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Reply-To: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: gnats-bugs@netbsd.org
Cc: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Subject: wi(4) fails to initialise card 
X-Send-Pr-Version: 3.95

>Number:         30549
>Category:       kern
>Synopsis:       wi(4) fails to initialise card on netbsd-3
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 18 15:06:00 +0000 2005
>Last-Modified:  Tue Jul 05 07:30:04 +0000 2005
>Originator:     Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
>Release:        NetBSD 3.0_BETA
>Organization:
Falling Raindrops
>Environment:


System: NetBSD pizza.causeuse.org 3.0_BETA NetBSD 3.0_BETA (PIZZA) #1: Wed Jun 8 23:27:04 CEST 2005 hauke@pizza.causeuse.org:/usr/src/sys/arch/sparc/compile/PIZZA sparc
Architecture: sparc
Machine: sparc
>Description:

netbsd-3 seems to have broken my nell/wi-combo:

NetBSD 3.0_BETA (PIZZA) #1: Wed Jun  8 23:27:04 CEST 2005
        hauke@pizza.causeuse.org:/usr/src/sys/arch/sparc/compile/PIZZA

[...]

nell0 at sbus0 slot 0 offset 0x0 level 4 (ipl 7) level 7 (ipl 13): rev 1
pcmcia0 at nell0 socket 0
wi0 at pcmcia0 function 0: <NETGEAR MA401RA Wireless PC, Card, ISL37300P,
Eval-RevA>
wi0: 802.11 address 00:09:5b:54:f1:e5
wi0: using RF:PRISM2.5 MAC:ISL3873B(PCMCIA)
wi0: Intersil Firmware: Primary (1.1.1), Station (1.7.4)
wi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
pcmcia1 at nell0 socket 1

[...]

Configuring network interfaces: wi0stray interrupt ipl 0x7 pc=0xf015c7fc
npc=0xf015c800 psr=400001c4<S,PS>
stray interrupt ipl 0x7 pc=0xf015c7f0 npc=0xf015c7f4 psr=400001c4<S,PS>
wi0: command timed out, cmd=0x2, arg=0x0
wi0: command timed out, cmd=0x0, arg=0x0
wi0: wi_cmd: busy bit won't clear.
wi0: wi_cmd: busy bit won't clear.
wi0: wi_cmd: busy bit won't clear.
wi0: wi_cmd: busy bit won't clear.
wi0: init failed
wi0: interface not running
wi0: wi_cmd: busy bit won't clear.
ifconfig: wi0: wi_cmd: busy bit won't clear.
SIOCS80211NWKEY: Connection timed out
wi0: wi_cmd: busy bit won't clear.
wi0: wi_cmd: busy bit won't clear.
wi0: wi_cmd: busy bit won't clear.
wi0: wi_cmd: busy bit won't clear.
wi0: wi_cmd: busy bit won't clear.
wi0: wi_cmd: busy bit won't clear.
wi0: init failed
wi0: interface not running
wi0: wi_cmd: busy bit won't clear.
ifconfig: SIOCSIFMEDIA: Connection timed out
wi0: wi_cmd: busy bit won't clear.
wiconfig: SIOCSWAVELAN: Connection timed out
 hme0 bridge0wi0: wi_cmd: busy bit won't clear.
 pppoe0.
Adding interface aliases:

[...]

Re-plugging and manually ifconfig(8)uring the card brings it up
with nothing but the usual "stray interrupt" messages.

My Powerbook sees the card's station ID, but does not manage to get an
IP via DHCP.

Setup:


[hauke@pizza] /etc # cat ifconfig.bridge0
!brconfig $int add hme0 add wi0
up
[hauke@pizza] /etc # cat ifconfig.wi0
# $Id: ifconfig.wi0,v 1.4 2004/08/29 14:53:16 hauke Exp hauke $
#
# Set up wlan accesspoint

# Be an accesspoint
up chan 11 nwid Forstquelle nwkey "1234567890123" mediaopt hostap
!/usr/sbin/wiconfig $int -A2
[hauke@pizza] /etc #


-- note that I always had to 'ifconfig wi0 down' and then do the
ifconfig/wiconfig dance manually, or the Powerbook would not be able
to get IP connectivity. But now is different.

Starting from scratch by removing the bridge(4), setting up wi0
manually and adding it to the bridge brings back ip connectivity most
of the time. When it finally works, it keeps working.

The machine runs a netbsd-3 build from 18 May with a slightly newer
kernel (see above).

>How-To-Repeat:

Set up a wireless LAN access-point on sparc with a nell(4) pcmcia
adapter and a wi(4) card (prism based). Notice that after a netbsd-3
update, the kernel fails to properly set up the wi(4) card.

>Fix:
	Yes, please.

	Workaround: Unplugging and re-plugging the card, and setting
	up the interface and thge bridge freshly makes it work most of
	the time.

>Audit-Trail:
From: Rudi Ludwig <rudihl@gmx.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: re: kern/30549
Date: Tue, 5 Jul 2005 00:30:24 +0200

 This is a multi-part message in MIME format.

 --Multipart=_Tue__5_Jul_2005_00_30_24_+0200_C0Zj_S0Fj7uCsBre
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit


 I got similar problems on my ibook G3 (macppc). Initializing the WLAN at
 boot time only worked every once in a while. Most of the time I got

 ...
 command timed out
 ...
 busy bit won't clear
 ...

 I applied three minor changes. Rebootet several times and wi0
 initialized w/o problems. Probably needs some more testing.

 /rudi


 --Multipart=_Tue__5_Jul_2005_00_30_24_+0200_C0Zj_S0Fj7uCsBre
 Content-Type: application/octet-stream;
  name="wi.c.patch"
 Content-Disposition: attachment;
  filename="wi.c.patch"
 Content-Transfer-Encoding: base64

 KioqIHNyYy9zeXMvZGV2L2ljL3dpLmMJTW9uIEp1bCAgNCAyMzozNToxMyAyMDA1Ci0tLSBzcmMv
 c3lzL2Rldi9pYy93aS5jLm9yaWcJTW9uIEp1bCAgNCAxNjowMzoyNyAyMDA1CioqKioqKioqKioq
 KioqKgoqKiogMSw2ICoqKioKICAvKg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tZCA9PSBXSV9DTURfSU5JKSB7CiAgCQkvKiBYWFg6IHNob3VsZCBzbGVl
 cCBoZXJlLiAqLwohIAkJREVMQVkoMjAwKjEwMDApOwogIAl9CiAgCXJjID0gd2lfY21kX3dhaXQo
 c2MsIGNtZCwgdmFsMCk7Ci0tLSAyNTgzLDI1ODcgLS0tLQogIAlpZiAoY21kID09IFdJX0NNRF9J
 TkkpIHsKICAJCS8qIFhYWDogc2hvdWxkIHNsZWVwIGhlcmUuICovCiEgCQlERUxBWSgxMDAqMTAw
 MCk7CiAgCX0KICAJcmMgPSB3aV9jbWRfd2FpdChzYywgY21kLCB2YWwwKTsK

 --Multipart=_Tue__5_Jul_2005_00_30_24_+0200_C0Zj_S0Fj7uCsBre
 Content-Type: application/octet-stream;
  name="wireg.h.patch"
 Content-Disposition: attachment;
  filename="wireg.h.patch"
 Content-Transfer-Encoding: base64

 KioqIHNyYy9zeXMvZGV2L2ljL3dpcmVnLmgJTW9uIEp1bCAgNCAyMzoxNzo0OCAyMDA1Ci0tLSBz
 cmMvc3lzL2Rldi9pYy93aXJlZy5oLm9yaWcJTW9uIEp1bCAgNCAyMzoxNzozNiAyMDA1CioqKioq
 KioqKioqKioqKgoqKiogMzgsNDIgKioqKgogICAqLwogIAohICNkZWZpbmUgV0lfREVMQVkgICAg
 ICAgOAogICNkZWZpbmUgV0lfVElNRU9VVCAgICAgKDUwMDAwMC9XSV9ERUxBWSkgICAgICAgLyog
 NTAwIG1zICovCiAgCi0tLSAzOCw0MiAtLS0tCiAgICovCiAgCiEgI2RlZmluZSBXSV9ERUxBWSAg
 ICAgICA1CiAgI2RlZmluZSBXSV9USU1FT1VUICAgICAoNTAwMDAwL1dJX0RFTEFZKSAgICAgICAv
 KiA1MDAgbXMgKi8KICAK

 --Multipart=_Tue__5_Jul_2005_00_30_24_+0200_C0Zj_S0Fj7uCsBre--

From: Rudi Ludwig <rudihl@gmx.de>
To: gnats-bugs@NetBSD.org
Cc: rudihl@gmx.de
Subject: re: kern/30549
Date: Tue, 5 Jul 2005 09:25:40 +0200

 This is a multi-part message in MIME format.

 --Multipart=_Tue__5_Jul_2005_09_25_40_+0200_pk1n/Mu4ME7Xssur
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit


 Looks like gnats doesn't like base64 encoded attachments, although
 they are plain text.

 When looking at the code again, I disliked starting
 with zero delay when waiting for the busy bit to clear. Thus a minor
 change there.

 Please test and report. I am not a commiter, so it will take someone
 else to get this into the kernel (if its a real fix, and doesn't just
 work okay for me)

 /rudi

 --Multipart=_Tue__5_Jul_2005_09_25_40_+0200_pk1n/Mu4ME7Xssur
 Content-Type: application/octet-stream;
  name="wi.c.patch"
 Content-Disposition: attachment;
  filename="wi.c.patch"
 Content-Transfer-Encoding: quoted-printable

 *** src/sys/dev/ic/wi.c	Mon Jul  4 23:35:13 2005
 --- src/sys/dev/ic/wi.c.orig	Mon Jul  4 16:03:27 2005
 ***************
 *** 1,6 ****
   /*	$NetBSD: wi.c,v 1.194 2005/01/17 01:48:56 dyoung Exp $	*/
 - /* kern/30549 2005/7/5 by rl */
 - /* L2536: increasing delay time when waiting for the busy bit to clear */
 - /* L2587: changed delay after wi_com_ini from 100ms to 200ms	*/
  =20
   /*-
 --- 1,3 ----
 ***************
 *** 2535,2542 ****
  =20
   	/* wait for the busy bit to clear */
 ! 	for (i =3D 500; i > 0; i--) {	/* 1s total */
   		if ((CSR_READ_2(sc, WI_COMMAND) & WI_CMD_BUSY) =3D=3D 0)
   			break;
 ! 		DELAY(8*(512-i)); /* increasing delay times */
   	}
   	if (i =3D=3D 0) {
 --- 2532,2539 ----
  =20
   	/* wait for the busy bit to clear */
 ! 	for (i =3D 500; i > 0; i--) {	/* 5s */
   		if ((CSR_READ_2(sc, WI_COMMAND) & WI_CMD_BUSY) =3D=3D 0)
   			break;
 ! 		DELAY(1000);	/* 1 m sec */
   	}
   	if (i =3D=3D 0) {
 ***************
 *** 2586,2590 ****
   	if (cmd =3D=3D WI_CMD_INI) {
   		/* XXX: should sleep here. */
 ! 		DELAY(200*1000);
   	}
   	rc =3D wi_cmd_wait(sc, cmd, val0);
 --- 2583,2587 ----
   	if (cmd =3D=3D WI_CMD_INI) {
   		/* XXX: should sleep here. */
 ! 		DELAY(100*1000);
   	}
   	rc =3D wi_cmd_wait(sc, cmd, val0);

 --Multipart=_Tue__5_Jul_2005_09_25_40_+0200_pk1n/Mu4ME7Xssur
 Content-Type: application/octet-stream;
  name="wireg.h.patch"
 Content-Disposition: attachment;
  filename="wireg.h.patch"
 Content-Transfer-Encoding: quoted-printable

 *** src/sys/dev/ic/wireg.h	Mon Jul  4 23:17:48 2005
 --- src/sys/dev/ic/wireg.h.orig	Mon Jul  4 23:17:36 2005
 ***************
 *** 38,42 ****
    */
  =20
 ! #define WI_DELAY       8
   #define WI_TIMEOUT     (500000/WI_DELAY)       /* 500 ms */
  =20
 --- 38,42 ----
    */
  =20
 ! #define WI_DELAY       5
   #define WI_TIMEOUT     (500000/WI_DELAY)       /* 500 ms */
  =20

 --Multipart=_Tue__5_Jul_2005_09_25_40_+0200_pk1n/Mu4ME7Xssur--

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