From owner-freebsd-mobile@FreeBSD.ORG Sat Jul 29 15:34:20 2006 Return-Path: X-Original-To: freebsd-mobile@freebsd.org Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2003216A4DA; Sat, 29 Jul 2006 15:34:20 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8BDD743D58; Sat, 29 Jul 2006 15:34:19 +0000 (GMT) (envelope-from sam@errno.com) Received: from [10.0.0.248] (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id k6TFYFi7005795 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 29 Jul 2006 08:34:18 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <44CB7FF7.3070805@errno.com> Date: Sat, 29 Jul 2006 08:34:15 -0700 From: Sam Leffler User-Agent: Thunderbird 1.5.0.4 (X11/20060724) MIME-Version: 1.0 To: =?ISO-8859-1?Q?Erik_N=F8rgaard?= References: <44C8D7FE.4080108@locolomo.org> <44C905D3.4040208@locolomo.org> <200607271739.48433.jhb@freebsd.org> <44CA2CA1.3040801@locolomo.org> <44CA36FF.9070404@errno.com> <44CA3FD7.9040506@locolomo.org> <44CA556C.9080208@errno.com> <44CB5843.9030301@locolomo.org> In-Reply-To: <44CB5843.9030301@locolomo.org> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: Don Wilde , freebsd-mobile@freebsd.org Subject: Re: Problem (maybe a solution) loading iwi firmware: firmware_get: failed to load firmware image iwi_bss X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jul 2006 15:34:20 -0000 Erik Nørgaard wrote: > Sam Leffler wrote: >> Erik Nørgaard wrote: >> If you do: >> >> kldload if_iwi >> kldload iwi_bss >> >> and then run kldstat do you see the iwi_bss.ko loaded? > > Yes > >> The above complaint means that iwi hit some problem loading the iwi_bss >> image. Typically this is because the file cannot be located on the >> filesystem but if you can manually load it then that should make it >> available regardless of where you have it sitting in the filesystem. >> Past that you need the debug knob to find out why iwi's request is >> failing. It appears noone's yet added such a knob to the firmware(9) >> code so one can only guess. > > That's what led me into try to figure out where it gets the firmware > from in my first mail. > >>> iwi_newstate: INIT -> INIT flags 0x0 >>> iwi0: timeout waiting for iwi_bss firmware initialization to complete >>> iwi0: could not load boot firmware iwi_bss >>> iwi_newstate: INIT -> INIT flags 0x0 >> Ok, this looks more useful. It seems your card simply didn't start up >> fast enough (hopefully). Try editing the driver to increase the time it >> waits for the firmware to startup. Looks like it's line 2516 of >> if_iwi.c; change "hz" to something like 10*hz (10 seconds) and see if >> that helps. I've heard some complaints of problems like this. > > Ok, thanks, I tried. Actually I tried setting it to both 10 and 100 just > in case. But no luck. > > Replay of the attempt below, it seems that it makes no difference if > if_iwi or iwi_bss is loaded first. Also, setting debug.iwi=1 seems > only to add the iwi_newstate lines. I tried to set it to 2 to see if > that would produce more output but no. (the complete dmesg after boot is > at the end of the mail). > > photon# kldload if_iwi > photon# kldload iwi_bss > > iwi0: mem 0xb0107000-0xb0107fff irq 10 at > device 10.0 on pci6 > iwi0: Ethernet address: 00:16:6f:93:c9:75 > > photon# kldstat > > Id Refs Address Size Name > 6 1 0xc4e03000 d000 if_iwi.ko > 7 1 0xc4e11000 30000 iwi_bss.ko > > photon# ifconfig iwi0 10.35.4.64/24 ssid MYAP > photon# ifconfig > > iwi0: flags=8802 mtu 1500 > inet 10.35.4.64 netmask 0xffffff00 broadcast 10.35.4.255 > ether 00:16:6f:93:c9:75 > media: IEEE 802.11 Wireless Ethernet autoselect > status: no carrier > ssid MYAP channel 1 > authmode OPEN privacy OFF txpowmax 100 protmode CTS > > photon# dmesg > > Interrupt storm detected on "irq5:"; throttling interrupt source > iwi0: timeout waiting for iwi_bss firmware initialization to complete > iwi0: could not load boot firmware iwi_bss > > photon# kldunload iwi_bss > photon# kldload iwi_bss > photon# ifconfig iwi0 10.35.4.64/24 ssid MYAP channel 6 > photon# ifconfig > > iwi0: flags=8802 mtu 1500 > inet 10.35.4.64 netmask 0xffffff00 broadcast 10.35.4.255 > ether 00:16:6f:93:c9:75 > media: IEEE 802.11 Wireless Ethernet autoselect > status: no carrier > ssid MYAP channel 1 > authmode OPEN privacy OFF txpowmax 100 protmode CTS > > photon# dmesg > > iwi0: timeout waiting for iwi_bss firmware initialization to complete > iwi0: could not load boot firmware iwi_bss > > photon# kldstat > Id Refs Address Size Name > 6 1 0xc4e03000 d000 if_iwi.ko > 7 1 0xc4e11000 30000 iwi_bss.ko > photon# sysctl debug.iwi=1 > debug.iwi: 0 -> 1 > photon# ifconfig iwi0 10.35.4.64/24 ssid MYAP channel 6 > photon# dmesg > > iwi_newstate: INIT -> INIT flags 0x0 > firmware_get: failed to load firmware image iwi_bss > iwi0: could not load firmware > iwi_newstate: INIT -> INIT flags 0x0 > > photon# ifconfig iwi0 down > photon# ifconfig > > iwi0: flags=8802 mtu 1500 > inet 10.35.4.64 netmask 0xffffff00 broadcast 10.35.4.255 > ether 00:16:6f:93:c9:75 > media: IEEE 802.11 Wireless Ethernet autoselect > status: no carrier > ssid MYAP channel 1 > authmode OPEN privacy OFF txpowmax 100 protmode CTS > > photon# ifconfig iwi0 up > photon# ifconfig > > iwi0: flags=8802 mtu 1500 > inet 10.35.4.64 netmask 0xffffff00 broadcast 10.35.4.255 > inet6 fe80::216:6fff:fe93:c975%iwi0 prefixlen 64 scopeid 0x4 > ether 00:16:6f:93:c9:75 > media: IEEE 802.11 Wireless Ethernet autoselect > status: no carrier > ssid MYAP channel 1 > authmode OPEN privacy OFF txpowmax 100 protmode CTS > > photon# ifconfig iwi0 10.35.4.64/24 ssid MYAP channel 6 > photon# ifconfig > > iwi0: flags=8802 mtu 1500 > inet6 fe80::216:6fff:fe93:c975%iwi0 prefixlen 64 scopeid 0x4 > inet 10.35.4.64 netmask 0xffffff00 broadcast 10.35.4.255 > ether 00:16:6f:93:c9:75 > media: IEEE 802.11 Wireless Ethernet autoselect > status: no carrier > ssid MYAP channel 1 > authmode OPEN privacy OFF txpowmax 100 protmode CTS > > photon# dmesg > > iwi_newstate: INIT -> INIT flags 0x0 > firmware_get: failed to load firmware image iwi_bss > iwi0: could not load firmware > iwi_newstate: INIT -> INIT flags 0x0 > iwi_newstate: INIT -> INIT flags 0x0 > firmware_get: failed to load firmware image iwi_bss > iwi0: could not load firmware > iwi_newstate: INIT -> INIT flags 0x0 > > photon# kldunload if_iwi > photon# dmesg > > iwi0: detached > > photon# kldstat > > Id Refs Address Size Name > 7 1 0xc4e11000 30000 iwi_bss.ko > > photon# kldunload iwi_bss > > photon# kldstat > Id Refs Address Size Name > > photon# kldload iwi_bss > photon# kldload if_iwi > photon# ifconfig > > iwi0: flags=8802 mtu 1500 > ether 00:16:6f:93:c9:75 > media: IEEE 802.11 Wireless Ethernet autoselect > status: no carrier > ssid "" channel 1 > authmode OPEN privacy OFF txpowmax 100 protmode CTS > > photon# kldstat > > Id Refs Address Size Name > 7 1 0xc4e11000 30000 iwi_bss.ko > 8 1 0xc4e03000 d000 if_iwi.ko > > photon# dmesg > > iwi0: mem 0xb0107000-0xb0107fff irq 10 at > device 10.0 on pci6 > iwi0: Ethernet address: 00:16:6f:93:c9:75 > > photon# ifconfig iwi0 10.35.4.64/24 ssid MYAP channel 6 > dphoton# ifconfig > > iwi0: flags=8802 mtu 1500 > inet 10.35.4.64 netmask 0xffffff00 broadcast 10.35.4.255 > ether 00:16:6f:93:c9:75 > media: IEEE 802.11 Wireless Ethernet autoselect > status: no carrier > ssid MYAP channel 1 > authmode OPEN privacy OFF txpowmax 100 protmode CTS > > photon# dmesg > > iwi0: mem 0xb0107000-0xb0107fff irq 10 at > device 10.0 on pci6 > iwi0: Ethernet address: 00:16:6f:93:c9:75 > iwi0: timeout waiting for iwi_bss firmware initialization to complete > iwi0: could not load boot firmware iwi_bss > > ... gave up. The above was with a custom kernel where I removed > everything that did not seem necessary, keeping "device firmware" and > "device wlan". I have just tried also with a GENERIC kernel and there is > no difference at all. > > Trying to load/unload too many times can cause the system to crash hard > - no nice page fault or kernel trap or anything, just a hard reboot. In > /var/log/messages I found this: > > loaded if_iwi & iwi_bss for the n'th time, in this run, the if_iwi was > modified to wait 100 sec: > > Jul 28 22:42:41 photon kernel: iwi0: mem > 0xb01070 > 00-0xb0107fff irq 10 at device 10.0 on pci6 > Jul 28 22:42:41 photon kernel: iwi0: Ethernet address: 00:16:6f:93:c9:75 > > ifconfig > > Jul 28 22:43:06 photon kernel: iwi_newstate: INIT -> INIT flags 0x0 > Jul 28 22:43:52 photon kernel: Setting MAC address to 00:16:6f:93:c9:75 > Jul 28 22:43:52 photon kernel: Configuring adapter > Jul 28 22:43:52 photon kernel: Setting power mode to 0 > Jul 28 22:43:52 photon kernel: Setting RTS threshold to 2346 > Jul 28 22:43:52 photon kernel: Setting fragmentation threshold to 2346 > Jul 28 22:43:52 photon kernel: Setting .11bg supported rates (12) > Jul 28 22:43:52 photon kernel: Setting .11a supported rates (0) > Jul 28 22:43:52 photon kernel: Setting desired ESSID to "ChuecaWireless" > Jul 28 22:43:52 photon kernel: Setting initialization vector to 1368112666 > Jul 28 22:43:52 photon kernel: Setting wep key index 0 len 0 > Jul 28 22:43:52 photon kernel: Setting wep key index 1 len 0 > Jul 28 22:43:52 photon kernel: Setting wep key index 2 len 0 > Jul 28 22:43:52 photon kernel: Setting wep key index 3 len 0 > Jul 28 22:43:52 photon kernel: Enabling adapter > Jul 28 22:43:52 photon kernel: iwi_newstate: INIT -> SCAN flags 0x5 > Jul 28 22:43:52 photon kernel: iwi_newstate: SCAN -> SCAN flags 0x3 > Jul 28 22:43:52 photon kernel: Start scanning > Jul 28 22:43:58 photon kernel: iwi0: scan stuck > Jul 28 22:43:58 photon kernel: iwi_newstate: SCAN -> INIT flags 0x0 > > reload if_iwi > > Jul 28 22:45:17 photon kernel: iwi_newstate: INIT -> INIT flags 0x4 > Jul 28 22:45:17 photon kernel: iwi0: detached > Jul 28 22:45:32 photon kernel: iwi0: mem > 0xb01070 > 00-0xb0107fff irq 10 at device 10.0 on pci6 > Jul 28 22:45:32 photon kernel: iwi0: Ethernet address: 00:16:6f:93:c9:75 > > crash. So, something is happening, the if_iwi seems to do what it can. I > keep thinking that a conflict in the devices irq or other parameters may > cause it to fail, the irq storm when the interface is first brought up > seems to indicate such conflict. > > Any ideas how to test this? Are there any things that I can do to shed > more light on the hardware/device config? > > Thanks, Erik > > Full dmesg after boot: > > Copyright (c) 1992-2006 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > The Regents of the University of California. All rights reserved. > FreeBSD 6.1-STABLE #1: Fri Jul 28 22:58:11 CEST 2006 > norgaard@photon.:/usr/obj/usr/src/sys/VAIO > Timecounter "i8254" frequency 1193182 Hz quality 0 > CPU: Intel(R) Pentium(R) M processor 1.73GHz (1729.02-MHz 686-class CPU) > Origin = "GenuineIntel" Id = 0x6d8 Stepping = 8 > > Features=0xafe9fbff > Features2=0x180 > AMD Features=0x100000 > real memory = 1063845888 (1014 MB) > avail memory = 1036279808 (988 MB) > kbd1 at kbdmux0 > cpu0 on motherboard > pcib0: pcibus 0 on motherboard > pci0: on pcib0 > agp0: port 0x1800-0x1807 > mem 0xb0080000-0xb00fffff,0xc0000000-0xcfffffff,0xb0040000-0xb007ffff > irq 10 at device 2.0 on pci0 > agp0: detected 7932k stolen memory > agp0: aperture size is 256M > drmsub0: : (child of agp_i810.c) on agp0 > info: [drm] AGP at 0xb0080000 0MB > info: [drm] Initialized i915 1.4.0 20060119 > pci0: at device 2.1 (no driver attached) > pci0: at device 27.0 (no driver attached) > uhci0: port > 0x1820-0x183f irq 5 at device 29.0 on pci0 > uhci0: [GIANT-LOCKED] > usb0: on uhci0 > usb0: USB revision 1.0 > uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 > uhub0: 2 ports with 2 removable, self powered > uhci1: port > 0x1840-0x185f irq 10 at device 29.1 on pci0 > uhci1: [GIANT-LOCKED] > usb1: on uhci1 > usb1: USB revision 1.0 > uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 > uhub1: 2 ports with 2 removable, self powered > pci0: at device 29.7 (no driver attached) > pcib1: at device 30.0 on pci0 > pci6: on pcib1 > rl0: port 0x2000-0x20ff mem > 0xb0104000-0xb01040ff irq 10 at device 8.0 on pci6 > miibus0: on rl0 > rlphy0: on miibus0 > rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto > rl0: Ethernet address: 00:13:a9:44:44:a8 > cbb0: mem 0xb0105000-0xb0105fff irq 10 at device > 9.0 on pci6 > cardbus0: on cbb0 > pccard0: <16-bit PCCard bus> on cbb0 > pci6: at device 9.2 (no driver attached) > pci6: at device 9.3 (no driver attached) > pci6: at device 10.0 (no driver attached) > isab0: at device 31.0 on pci0 > isa0: on isab0 > atapci0: port > 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x1870-0x187f at device 31.2 on pci0 > atapci0: failed to enable memory mapping! > ata0: on atapci0 > ata1: on atapci0 > ichsmb0: port 0x18a0-0x18bf irq 10 at device 31.3 on pci0 > ichsmb0: [GIANT-LOCKED] > smbus0: on ichsmb0 > smb0: on smbus0 > orm0: at iomem > 0xc0000-0xcffff,0xd0000-0xd0fff,0xdb800-0xdbfff,0xdc000-0xdffff on isa0 > atkbdc0: at port 0x60,0x64 on isa0 > atkbd0: irq 1 on atkbdc0 > kbd0 at atkbd0 > atkbd0: [GIANT-LOCKED] > psm0: irq 12 on atkbdc0 > psm0: [GIANT-LOCKED] > psm0: model GlidePoint, device ID 0 > sc0: at flags 0x100 on isa0 > sc0: VGA <16 virtual consoles, flags=0x300> > vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 > unknown: can't assign resources (port) > speaker0: at port 0x61 on isa0 > unknown: can't assign resources (memory) > unknown: can't assign resources (memory) > unknown: can't assign resources (memory) > unknown: can't assign resources (irq) > Timecounter "TSC" frequency 1729015465 Hz quality 800 > Timecounters tick every 1.000 msec > ad0: 95396MB at ata0-master SATA150 > acd0: DVDR at ata1-master UDMA33 > Trying to mount root from ufs:/dev/ad0s1a It sounds like an irq routing problem. The device is assigned irq 10 but it appears interrupts are coming in on irq5. This would explain why you don't get notified the firmware bringup completed. I can't help w/ the interrupt problem. Sam