Subject: kern/10331: wi driver needs a power hook (or something)
To: None <gnats-bugs@gnats.netbsd.org>
From: John Hawkinson <jhawk@mit.edu>
List: netbsd-bugs
Date: 06/09/2000 07:06:12
>Number:         10331
>Category:       kern
>Synopsis:       wi driver needs a power hook (or something)
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 09 07:07:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     John Hawkinson
>Release:        Jun  7 2000 12:14
>Organization:
MIT
>Environment:
	
System: NetBSD zorkmid.mit.edu 1.4ZA NetBSD 1.4ZA (ZORKMID-$Revision: 1.13 $) #189: Thu Jun 8 15:45:53 EDT 2000 jhawk@zorkmid.mit.edu:/usr/local/current-src/sys/arch/i386/compile/ZORKMID i386

	Sony VAIO PCG-Z505HE laptop
>Description:
	The wi driver need a power-hook of some sort. I left wi0
ifconfig'd up and hibernated my laptop. A few hours later, I brought
it back; I was running under X and didn't take note of the console.

	The machine was terribly slow. ps reports (after the fact):

root         7  0.0  0.0     0    0 ??  ?<   12:52AM    0:00.10 (ioflush)
root         6  0.0  0.0     0    0 ??  ?<   12:52AM    0:00.06 (reaper)
root         5  0.0  0.0     0    0 ??  ?<   12:52AM    0:00.00 (pagedaemon)
root         4  0.0  0.0     0    0 ??  ?<   12:52AM  307:52.37 (apm0)
root         3  0.0  0.0     0    0 ??  ?<   12:52AM    0:03.09 (cardslot0)
root         2  0.0  0.0     0    0 ??  ?<   12:52AM    0:00.00 (usb0)
root         1  0.0  0.0     0    0 ??  ?<s  12:52AM    0:00.00 init 
jhawk     1705  0.0  0.0     0    0 p0- ?<    9:20AM    0:00.01 ps auxw 

	Looking at the console, I find endless spewings of:

wi0: timeout in wi_seek to ffff/0; last status ffff

	My message buffer filled with 2,472 instances therof. Checking
/var/log/messages, it's sort of weird:

Jun  9 08:36:08 zorkmid /netbsd: uhci0: interrupt while not operating ignored
Jun  9 08:36:09 zorkmid /netbsd: uhci0: interrupt while not operating ignored
Jun  9 08:36:09 zorkmid /netbsd: wi0: timeout in wi_seek to ffff/0; last status ffff
Jun  9 08:36:08 zorkmid apmd: system resumed from APM sleep
Jun  9 08:36:15 zorkmid xntpd[216]: sendto(4.2.2.2): No route to host
Jun  9 08:36:16 zorkmid xntpd[216]: sendto(131.119.28.135): No route to host
Jun  9 08:36:20 zorkmid dhclient: Internet Software Consortium DHCP Client V2.0b1pl25+
Jun  9 08:36:20 zorkmid dhclient: Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.
Jun  9 08:36:20 zorkmid dhclient: All rights reserved.
Jun  9 08:36:20 zorkmid dhclient: 
Jun  9 08:36:20 zorkmid dhclient: Please contribute if you find this software useful.
Jun  9 08:36:20 zorkmid dhclient: For info, please visit http://www.isc.org/dhcp-contrib.html
Jun  9 08:36:20 zorkmid dhclient: 
Jun  9 08:36:22 zorkmid dhclient: Listening on BPF/fxp0/08:00:46:06:00:6b
Jun  9 08:36:22 zorkmid dhclient: Sending on   BPF/fxp0/08:00:46:06:00:6b
Jun  9 08:36:22 zorkmid dhclient: Sending on   Socket/fallback/fallback-net
Jun  9 08:36:27 zorkmid dhclient: DHCPDISCOVER on fxp0 to 255.255.255.255 port 67 interval 6
Jun  9 08:36:28 zorkmid dhclient: can't connect to sysconf socket: No such file or directory
Jun  9 08:36:28 zorkmid dhclient: DHCPOFFER from 18.71.0.31
Jun  9 08:36:30 zorkmid dhclient: DHCPREQUEST on fxp0 to 255.255.255.255 port 67
Jun  9 08:36:31 zorkmid dhclient: DHCPACK from 18.71.0.31
Jun  9 08:36:32 zorkmid dhclient: bound to 18.187.1.140 -- renewal in 7200 seconds.
Jun  9 08:36:40 zorkmid last message repeated 126 times
Jun  9 08:37:15 zorkmid xntpd[216]: Connection re-established to 199.94.208.131
Jun  9 08:37:22 zorkmid xntpd[216]: Connection re-established to 4.2.2.2
Jun  9 08:37:23 zorkmid xntpd[216]: Connection re-established to 131.119.28.135
Jun  9 08:38:41 zorkmid last message repeated 602 times
Jun  9 08:46:09 zorkmid apmd: battery status: high. external power status: not connected. estimated battery life 79% (8704 minutes)
Jun  9 08:46:29 zorkmid last message repeated 3091 times
Jun  9 08:46:32 zorkmid /netbsd: wi0: init failed
Jun  9 08:46:36 zorkmid /netbsd: wi0: timeout in wi_seek to fce0/0; last status ffff
Jun  9 08:46:41 zorkmid /netbsd: wi0: timeout in wi_seek to fc07/0; last status ffff
Jun  9 08:46:43 zorkmid /netbsd: wi0: timeout in wi_seek to fc81/0; last status ffff
Jun  9 08:46:48 zorkmid /netbsd: wi0: timeout in wi_seek to fc00/0; last status ffff
Jun  9 08:46:48 zorkmid /netbsd: wi0: timeout in wi_seek to fc83/0; last status ffff
Jun  9 08:46:50 zorkmid /netbsd: wi0: timeout in wi_seek to fc84/0; last status ffff
Jun  9 08:46:55 zorkmid /netbsd: wi0: timeout in wi_seek to fc06/0; last status ffff
Jun  9 08:46:58 zorkmid /netbsd: wi0: timeout in wi_seek to fc09/0; last status ffff
Jun  9 08:46:58 zorkmid /netbsd: wi0: timeout in wi_seek to fc0c/0; last status ffff
Jun  9 08:46:58 zorkmid /netbsd: wi0: timeout in wi_seek to fc04/0; last status ffff
Jun  9 08:47:02 zorkmid /netbsd: wi0: timeout in wi_seek to fc02/0; last status ffff
Jun  9 08:47:07 zorkmid /netbsd: wi0: timeout in wi_seek to fc03/0; last status ffff
Jun  9 08:47:11 zorkmid /netbsd: wi0: timeout in wi_seek to fc0e/0; last status ffff
Jun  9 08:47:14 zorkmid /netbsd: wi0: timeout in wi_seek to fc01/0; last status ffff
Jun  9 08:47:14 zorkmid /netbsd: wi0: timeout in wi_seek to fc20/0; last status ffff
Jun  9 08:47:14 zorkmid /netbsd: wi0: timeout in wi_seek to fcb1/0; last status ffff
Jun  9 08:47:14 zorkmid /netbsd: wi0: timeout in wi_seek to fcb0/0; last status ffff
Jun  9 08:47:14 zorkmid /netbsd: wi0: timeout in wi_seek to fc85/0; last status ffff
Jun  9 08:47:14 zorkmid /netbsd: wi0: timeout in wi_seek to fc80/0; last status ffff
Jun  9 08:47:14 zorkmid /netbsd: wi0: failed to allocate 1594 bytes on NIC
Jun  9 08:47:14 zorkmid /netbsd: wi0: tx buffer allocation failed
Jun  9 08:47:14 zorkmid /netbsd: wi0: failed to allocate 1594 bytes on NIC
Jun  9 08:47:15 zorkmid /netbsd: wi0: mgmt. buffer allocation failed
Jun  9 08:47:16 zorkmid /netbsd: wi0: timeout in wi_seek to ffff/0; last status ffff
Jun  9 08:47:23 zorkmid last message repeated 345 times
Jun  9 08:47:26 zorkmid /netbsd: wi0 detached
Jun  9 08:47:27 zorkmid /netbsd: wi0 at pcmcia0 function 0
Jun  9 08:47:27 zorkmid /netbsd: wi0: address 00:60:1d:1e:73:c9


I presume that somehow syslogd got out of syncand all the "last message
repeated" stuff is reall about the wi_seek stuff.


Incidently, if I run 'wiconfig wi0' with wi0 ifconfig'd down, I get
these kernel printf()s interspersed with the wiconfig output:

wi0: wi_getdef: unknown request 64778
wi0: wi_getdef: unknown request 64833
wi0: wi_getdef: unknown request 64834
wi0: wi_getdef: unknown request 64784
wi0: wi_getdef: unknown request 64961
wi0: wi_getdef: unknown request 64835
wi0: wi_getdef: unknown request 64645
wi0: wi_getdef: unknown request 64836

Surely these should be debug messages or a counter or something
but not a kernel printf. Either that or the driver should detect
that the card is without power and act appropriately.

>How-To-Repeat:
	Leave wi0 up across hibernation.
>Fix:
	WORKAROUND: ifconfig down wi0 before hibernation.

>Release-Note:
>Audit-Trail:
>Unformatted: