NetBSD Problem Report #13092

Received: (qmail 21565 invoked from network); 3 Jun 2001 11:59:09 -0000
Message-Id: <200106031200.f53C0jG00917@arresum.veego.de>
Date: Sun, 3 Jun 2001 14:00:45 +0200 (CEST)
From: bernd@arresum.inka.de (Bernd Ernesti)
Reply-To: bernd@arresum.inka.de (Bernd Ernesti)
To: gnats-bugs@gnats.netbsd.org, toshii@netbsd.org
Subject: wiconfig cause a kernel panic after the recent change to the wi driver
X-Send-Pr-Version: 3.95

>Number:         13092
>Category:       kern
>Synopsis:       wiconfig cause a kernel panic after the recent change to the wi driver
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 03 12:00:01 +0000 2001
>Closed-Date:    Tue Jun 05 01:40:08 +0000 2001
>Last-Modified:  Tue Jun 05 01:40:08 +0000 2001
>Originator:     Bernd Ernesti
>Release:        NetBSD-current 03-Jun-2001 11:00 GMT
>Organization:

>Environment:

System: NetBSD arresum.veego.de 1.5W NetBSD 1.5W (ARRESUM) #590: Sun Jun 3 13:42:42 CEST 2001 bernd@arresum.veego.de:/home/work/obj_i386/src.i386/sys/arch/i386/compile/ARRESUM i386
Architecture: i386
Machine: i386
>Description:
	wiconfig wi0 cause a kernel panic when the card is initialized (ifconfiged).

	Backing out

	rev 1.15 syssrc/sys/dev/ic/wi.c
	rev 1.7 syssrc/sys/dev/ic/wireg.h 

	fixed the panic.

	From the commit log:

>How-To-Repeat:
	configure wi0 with ifconfig and do a wiconfig wi0 after that.
	Now you get this panic:

uvm_fault(0xc041aba0, 0xe664e000, 0, 3) -> e
kernel: page fault trap, code=0
Stopped in pid 537 (wiconfig) at wi_read_record+0x101: repne insw
%
dx,%es:(%edi)
db> t
wi_read_record(c0edd000,e664d984,c011f150,0,e6633900) at wi_read_record+0x101
wi_ioctl(80008000,80008000,80008000,80008000,80008000) at wi_ioctl+0x3d7

	Maybe you also need to use encryption, but I didn't test it without
	encryption.

	Btw, here is the dmesg output:

wi0 at pcmcia0 function 0: Lucent Technologies, WaveLAN/IEEE, Version 01.01
wi0: port 0x440-0x47fpcmcia0: card irq 11
 802.11 address 00:60:1d:xx:xx:xx
wi0: using Lucent chip or unknown chip

>Fix:
	Back out:

	rev 1.15 syssrc/sys/dev/ic/wi.c
	rev 1.7 syssrc/sys/dev/ic/wireg.h 

>Release-Note:
>Audit-Trail:

From: IWAMOTO Toshihiro <iwamoto@sat.t.u-tokyo.ac.jp>
To: bernd@arresum.inka.de (Bernd Ernesti)
Cc: gnats-bugs@gnats.netbsd.org, iwamoto@sat.t.u-tokyo.ac.jp
Subject: Re: kern/13092: wiconfig cause a kernel panic after the recent change to the wi driver
Date: Mon, 04 Jun 2001 00:42:34 +0900

 At Sun, 3 Jun 2001 14:00:45 +0200 (CEST),
 Bernd Ernesti wrote:
 > >Description:
 > 	wiconfig wi0 cause a kernel panic when the card is initialized (ifconfiged).
 > 
 > 	Backing out
 > 
 > 	rev 1.15 syssrc/sys/dev/ic/wi.c
 > 	rev 1.7 syssrc/sys/dev/ic/wireg.h 
 > 
 > 	fixed the panic.

 I couldn't reproduce the panic.  What I did was:

 	<insert the card>
 	# wiconfig wi0 -e 1 -k aaaaa
 	# ifconfig wi0 192.168.0.100
 	# wiconfig wi0

 and

 	<insert the card>
 	# ifconfig wi0 192.168.0.100
 	# wiconfig wi0

 Both worked fine for me.  The former test is done with no WEP capable
 peer and tomorrow I'll try the same test with some WEP capable peer,
 but I'm not very sure I can get a panic that way.

 BTW, could you try if the following patch solves the problem?

 --- wi.c.orig	Sun Jun  3 00:51:28 2001
 +++ wi.c	Mon Jun  4 00:18:43 2001
 @@ -647,7 +647,8 @@

  	/* Now read the data. */
  	ptr = &ltv->wi_val;
 -	CSR_READ_MULTI_STREAM_2(sc, WI_DATA1, ptr, ltv->wi_len - 1);
 +	if (ltv->wi_len > 0)
 +		CSR_READ_MULTI_STREAM_2(sc, WI_DATA1, ptr, ltv->wi_len - 1);

  	if (sc->sc_prism2) {
  		int v;

 --
 IWAMOTO Toshihiro

From: IWAMOTO Toshihiro <iwamoto@sat.t.u-tokyo.ac.jp>
To: bernd@arresum.inka.de (Bernd Ernesti)
Cc: gnats-bugs@gnats.netbsd.org, iwamoto@sat.t.u-tokyo.ac.jp
Subject: Re: kern/13092: wiconfig cause a kernel panic after the recent change to the wi driver
Date: Mon, 04 Jun 2001 00:58:59 +0900

 At Mon, 04 Jun 2001 00:42:34 +0900,
 IWAMOTO Toshihiro wrote:
 > BTW, could you try if the following patch solves the problem?
 > 
 > --- wi.c.orig	Sun Jun  3 00:51:28 2001
 > +++ wi.c	Mon Jun  4 00:18:43 2001
 > @@ -647,7 +647,8 @@
 >  
 >  	/* Now read the data. */
 >  	ptr = &ltv->wi_val;
 > -	CSR_READ_MULTI_STREAM_2(sc, WI_DATA1, ptr, ltv->wi_len - 1);
 > +	if (ltv->wi_len > 0)
 > +		CSR_READ_MULTI_STREAM_2(sc, WI_DATA1, ptr, ltv->wi_len - 1);
 >  
 >  	if (sc->sc_prism2) {
 >  		int v;

 Oops, this should have been as follows.

 --- wi.c.orig	Sun Jun  3 00:51:28 2001
 +++ wi.c	Mon Jun  4 00:18:43 2001
 @@ -647,7 +647,8 @@

  	/* Now read the data. */
  	ptr = &ltv->wi_val;
 -	CSR_READ_MULTI_STREAM_2(sc, WI_DATA1, ptr, ltv->wi_len - 1);
 +	if (ltv->wi_len > 1)
 +		CSR_READ_MULTI_STREAM_2(sc, WI_DATA1, ptr, ltv->wi_len - 1);

  	if (sc->sc_prism2) {
  		int v;


From: Bernd Ernesti <bernd@arresum.inka.de>
To: IWAMOTO Toshihiro <iwamoto@sat.t.u-tokyo.ac.jp>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/13092: wiconfig cause a kernel panic after the recent change to the wi driver
Date: Sun, 3 Jun 2001 22:25:21 +0200

 On Mon, Jun 04, 2001 at 12:58:59AM +0900, IWAMOTO Toshihiro wrote:
 > At Mon, 04 Jun 2001 00:42:34 +0900,
 > IWAMOTO Toshihiro wrote:
 > > BTW, could you try if the following patch solves the problem?
 > > 
 > > --- wi.c.orig	Sun Jun  3 00:51:28 2001
 > > +++ wi.c	Mon Jun  4 00:18:43 2001
 > > @@ -647,7 +647,8 @@
 > >  
 > >  	/* Now read the data. */
 > >  	ptr = &ltv->wi_val;
 > > -	CSR_READ_MULTI_STREAM_2(sc, WI_DATA1, ptr, ltv->wi_len - 1);
 > > +	if (ltv->wi_len > 0)
 > > +		CSR_READ_MULTI_STREAM_2(sc, WI_DATA1, ptr, ltv->wi_len - 1);
 > >  
 > >  	if (sc->sc_prism2) {
 > >  		int v;
 > 
 > Oops, this should have been as follows.

 Your patch fixed my problem.

 Bernd

State-Changed-From-To: open->closed 
State-Changed-By: toshii 
State-Changed-When: Mon Jun 4 18:39:09 PDT 2001 
State-Changed-Why:  
rev. 1.16 of sys/dev/ic/wi.c fixes the problem. 
>Unformatted:
 >Module Name:    syssrc
 >Committed By:   toshii
 >Date:           Sat Jun  2 15:49:17 UTC 2001
 >
 >Modified Files:
 >	syssrc/sys/dev/ic: wi.c wireg.h
 >
 >Log Message:
 >Use bus_space_{read,write}_multi_stream_2 where available.

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.