From anholt@vonnegut.anholt.net  Fri Sep  1 17:28:49 2006
Return-Path: <anholt@vonnegut.anholt.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 819D016A4FB
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  1 Sep 2006 17:28:49 +0000 (UTC)
	(envelope-from anholt@vonnegut.anholt.net)
Received: from vonnegut.anholt.net (69-30-77-85.dq1sn.easystreet.com [69.30.77.85])
	by mx1.FreeBSD.org (Postfix) with ESMTP id AFAE443D46
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  1 Sep 2006 17:28:48 +0000 (GMT)
	(envelope-from anholt@vonnegut.anholt.net)
Received: from vonnegut.anholt.net (localhost [127.0.0.1])
	by vonnegut.anholt.net (8.13.6/8.13.6) with ESMTP id k81HOPO4008862
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 1 Sep 2006 10:24:26 -0700 (PDT)
	(envelope-from anholt@vonnegut.anholt.net)
Received: (from anholt@localhost)
	by vonnegut.anholt.net (8.13.6/8.13.6/Submit) id k81HOO7E008851;
	Fri, 1 Sep 2006 10:24:24 -0700 (PDT)
	(envelope-from anholt)
Message-Id: <200609011724.k81HOO7E008851@vonnegut.anholt.net>
Date: Fri, 1 Sep 2006 10:24:24 -0700 (PDT)
From: Eric Anholt <anholt@freebsd.org>
Reply-To: Eric Anholt <anholt@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: iwi firmware load fails after significant uptime
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         102760
>Category:       kern
>Synopsis:       [iwi] iwi firmware load fails after significant uptime
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 01 17:30:22 GMT 2006
>Closed-Date:    Sat May 17 18:05:55 UTC 2008
>Last-Modified:  Sat May 17 18:05:55 UTC 2008
>Originator:     Eric Anholt
>Release:        FreeBSD 6.1-STABLE i386
>Organization:
>Environment:
System: FreeBSD vonnegut.anholt.net 6.1-STABLE FreeBSD 6.1-STABLE #4: Wed Jul 12 11:59:44 PDT 2006 root@vonnegut.anholt.net:/usr/obj/usr/src/6-stable/sys/MYKERNEL i386


	
>Description:
	My daily routine with my laptop involves using wireless networking at
	home, going to a coffeeshop on a different ssid, or going to work with
	wired ethernet, and coming home.  When I re-dhclient at a new location,
	or sometimes at just random times while using the wireless and
	the connection goes down and up I think, the firmware fails to load and
	I'm stuck with no network connection and dhclient saying "no such
	device" even though it appears in ifconfig.  The dmesg lines that
	appear are:

	Aug 31 08:29:58 vonnegut kernel: iwi0: could not allocate firmware DMA memory

>How-To-Repeat:
	Use iwi for an extended period of time, then re-run dhclient.  "Small"
	system memory probably helps.

>Fix:
	My current workaround is to go to old contigmalloc (which sleeps
	waiting for space to become available) and go kill apps hoping I'll end
	up freeing something contiguous.  Usually I just have to reboot,
	though (kldunloading of iwi results in a panic for me, which will be a
	separate report).

--- dmesg.boot begins here ---
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 #4: Wed Jul 12 11:59:44 PDT 2006
    root@vonnegut.anholt.net:/usr/obj/usr/src/6-stable/sys/MYKERNEL
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Pentium(R) M processor 1.60GHz (598.50-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x6d8  Stepping = 8
  Features=0xafe9fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,TM,PBE>
  Features2=0x180<EST,TM2>
  AMD Features=0x100000<NX>
real memory  = 527368192 (502 MB)
avail memory = 506077184 (482 MB)
kbd1 at kbdmux0
ath_hal: 0.9.17.2 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
acpi0: <PTLTD   RSDT> on motherboard
acpi_bus_number: can't get _ADR
acpi_bus_number: can't get _ADR
acpi0: Power Button (fixed)
acpi_bus_number: can't get _ADR
acpi_bus_number: can't get _ADR
Timecounter "ACPI-safe" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0
acpi_ec0: <Embedded Controller: GPE 0x1d> port 0x62,0x66 on acpi0
cpu0: <ACPI CPU> on acpi0
acpi_perf0: <ACPI CPU Frequency Control> on cpu0
acpi_perf0: failed in PERF_STATUS attach
device_attach: acpi_perf0 attach returned 6
acpi_perf0: <ACPI CPU Frequency Control> on cpu0
acpi_perf0: failed in PERF_STATUS attach
device_attach: acpi_perf0 attach returned 6
acpi_throttle0: <ACPI CPU Throttling> on cpu0
acpi_lid0: <Control Method Lid Switch> on acpi0
battery0: <ACPI Control Method Battery> on acpi0
acpi_acad0: <AC Adapter> on acpi0
acpi_button0: <Power Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
agp0: <Intel 82915GM (915GM GMCH) SVGA controller> port 0x1800-0x1807 mem 0xb0080000-0xb00fffff,0xc0000000-0xcfffffff,0xb0000000-0xb003ffff irq 11 at device 2.0 on pci0
agp0: detected 7932k stolen memory
agp0: aperture size is 256M
pci0: <display> at device 2.1 (no driver attached)
uhci0: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-A> port 0x1820-0x183f irq 10 at device 29.0 on pci0
uhci0: [GIANT-LOCKED]
usb0: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-A> 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: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-B> port 0x1840-0x185f irq 7 at device 29.1 on pci0
uhci1: [GIANT-LOCKED]
usb1: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-B> 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
ehci0: <Intel 82801FB (ICH6) USB 2.0 controller> mem 0xb0040000-0xb00403ff irq 10 at device 29.7 on pci0
ehci0: [GIANT-LOCKED]
usb2: EHCI version 1.0
usb2: companion controllers, 2 ports each: usb0 usb1
usb2: <Intel 82801FB (ICH6) USB 2.0 controller> on ehci0
usb2: USB revision 2.0
uhub2: Intel EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub2: 4 ports with 4 removable, self powered
umass0: Panasonic Optical Drive Controller, rev 2.00/0.00, addr 2
pcib1: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci_link7: BIOS IRQ 3 for 6.5.INTC is invalid
pci6: <ACPI PCI bus> on pcib1
rl0: <RealTek 8139 10/100BaseTX> port 0x3000-0x30ff mem 0xb0100000-0xb01000ff irq 7 at device 1.0 on pci6
miibus0: <MII bus> on rl0
rlphy0: <RealTek internal media interface> on miibus0
rlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
rl0: Ethernet address: 00:0b:97:97:33:3a
iwi0: <Intel(R) PRO/Wireless 2915ABG> mem 0xb0101000-0xb0101fff irq 5 at device 4.0 on pci6
iwi0: Ethernet address: 00:16:6f:73:9c:58
cbb0: <RF5C476 PCI-CardBus Bridge> mem 0xb0102000-0xb0102fff irq 3 at device 5.0 on pci6
cardbus0: <CardBus bus> on cbb0
pccard0: <16-bit PCCard bus> on cbb0
pci6: <base peripheral> at device 5.1 (no driver attached)
pcm0: <Intel ICH6 (82801FB)> port 0x1c00-0x1cff,0x18c0-0x18ff mem 0xb0040800-0xb00409ff,0xb0040400-0xb00404ff irq 9 at device 30.2 on pci0
pcm0: <SigmaTel STAC9750/51 AC97 Codec>
pci0: <simple comms, generic modem> at device 30.3 (no driver attached)
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel ICH6 UDMA100 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x1810-0x181f at device 31.1 on pci0
ata0: <ATA channel 0> on atapci0
ata1: <ATA channel 1> on atapci0
pci0: <serial bus, SMBus> at device 31.3 (no driver attached)
acpi_tz0: <Thermal Zone> on acpi0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> flags 0x2000 irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model Generic PS/2 mouse, device ID 0
pmtimer0 on isa0
orm0: <ISA Option ROMs> at iomem 0xcf800-0xd07ff,0xdc000-0xdffff,0xe0000-0xeffff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
ppc0: parallel port not found.
sio0: configured irq 4 not in bitmap of probed irqs 0
sio0: port may not be enabled
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 8250 or not responding
sio1: configured irq 3 not in bitmap of probed irqs 0
sio1: port may not be enabled
Timecounter "TSC" frequency 598503598 Hz quality 800
Timecounters tick every 1.000 msec
ad0: 57231MB <TOSHIBA MK6034GAX AC101F> at ata0-master UDMA100
hwpmc: TSC/1/0x20<REA> P6/2/0x1fe<USR,SYS,EDG,THR,REA,WRI,INV,QUA>
cd0 at umass-sim0 bus 0 target 0 lun 0
cd0: <MATSHITA UJDA757 DVD/CDRW 1.50> Removable CD-ROM SCSI-0 device 
cd0: 40.000MB/s transfers
cd0: Attempt to query device size failed: NOT READY, Medium not present
Trying to mount root from ufs:/dev/ad0s1a
--- dmesg.boot ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: matteo 
State-Changed-When: Sab 17 Mag 2008 10:51:16 UTC 
State-Changed-Why:  
Can you experience this problem on newer FreeBSD versions too? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=102760 
State-Changed-From-To: feedback->closed 
State-Changed-By: anholt 
State-Changed-When: Sat May 17 18:04:40 UTC 2008 
State-Changed-Why:  
I thought this had been closed.  It was fixed with: 

commit 47b82a7f674e803139104be78d9fe2e3495be857 
Author: jhb <jhb> 
Date:   Wed Mar 21 18:40:31 2007 +0000 

Fix an off-by-one error in iwi_init_fw_dma().  It didn't reuse the existing 
DMA memory for a firmware load if it was the exact size needed, thus in the 
common case the driver was constantly free'ing and reallocating the DMA 
buffer and it would eventually begin to fail.  With this fix, iwi0 reuses 
the same buffer the entire time and no longer fails to load the firmware 
after the machine has been up for a while. 

MFC after:  1 week 


http://www.freebsd.org/cgi/query-pr.cgi?pr=102760 
>Unformatted:
