Bug 31659

Summary: USB controller driver will die after some hours/heavy load.
Product: Base System Reporter: sehh <sehh>
Component: kernAssignee: freebsd-usb (Nobody) <usb>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.4-RELEASE   
Hardware: Any   
OS: Any   

Description sehh 2001-10-31 12:10:01 UTC
The USB kernel driver will die. It happens after
about 20 or so hours, of full processing.

I'm using an Alcatel SpeedTouch ADSL USB modem,
and after 20 hours of been connected and using
full bandwidth, the kernel will report:

/kernel: usb0: host controller process error
/kernel: usb0: host controller halted

The last message is repeated forever on the console.

Machine info:
IBM ThinkPad 600E
366mhz 64meg ram 10gig hd.

How-To-Repeat: Not very easy to repeat, you need to have some
high speed USB device (ADSL style) and to have
it working for 20 or so hours.
Comment 1 dhathome 2002-01-21 22:02:49 UTC
I can duplicate this
and on a much more recent version ...

uname:
FreeBSD pizza.house 4.5-RC FreeBSD 4.5-RC #0: Wed Jan 16 21:22:20 GMT 
2002     dave@pizza.house:/usr/src/sys/compile/GENERIC  i386

cvsuped:
from RELENG_4 on 2002.01.14.00.00.00

dmesg:
Copyright (c) 1992-2002 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 4.5-RC #0: Wed Jan 16 21:22:20 GMT 2002
     dave@pizza.house:/usr/src/sys/compile/GENERIC
Timecounter "i8254"  frequency 1193182 Hz
CPU: Pentium III/Pentium III Xeon/Celeron (697.88-MHz 686-class CPU)
   Origin = "GenuineIntel"  Id = 0x683  Stepping = 3
   Features=0x387f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PA
T,PSE36,PN,MMX,FXSR,SSE>
real memory  = 267124736 (260864K bytes)
avail memory = 255029248 (249052K bytes)
Preloaded elf kernel "kernel" at 0xc0491000.
Pentium Pro MTRR support enabled
md0: Malloc disk
Using $PIR table, 10 entries at 0xc00f3230
npx0: <math processor> on motherboard
npx0: INT 16 interface
pcib0: <Intel 82810E (i810E GMCH) Host To Hub bridge> on motherboard
pci0: <PCI bus> on pcib0
pci0: <Intel 82810E (i810E GMCH) SVGA controller> at 1.0 irq 11
pcib1: <Intel 82801AA (ICH) Hub to PCI bridge> at device 30.0 on pci0
pci1: <PCI bus> on pcib1
fxp0: <Intel Pro 10/100B/100+ Ethernet> port 0xde80-0xdebf mem 
0xff700000-0xff7f
ffff,0xff8fe000-0xff8fefff irq 9 at device 1.0 on pci1
fxp0: Ethernet address 00:d0:b7:b5:ef:4d
inphy0: <i82555 10/100 media interface> on miibus0
inphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
pci1: <unknown card> (vendor=0x1274, dev=0x1371) at 7.0 irq 10
isab0: <Intel 82801AA (ICH) PCI to LPC bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel ICH ATA66 controller> port 0xffa0-0xffaf at device 31.1 on pci0
ata0: at 0x1f0 irq 14 on atapci0
ata1: at 0x170 irq 15 on atapci0
uhci0: <Intel 82801AA (ICH) USB controller> port 0xef80-0xef9f irq 9 at 
device 3
1.2 on pci0
usb0: <Intel 82801AA (ICH) USB controller> 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
ugen0: ALCATEL Speed Touch USB , rev 1.10/0.00, addr 2
pci0: <unknown card> (vendor=0x8086, dev=0x2413) at 31.3 irq 0
orm0: <Option ROMs> at iomem 0xc0000-0xc7fff,0xc8000-0xc8fff on isa0
fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: Generic chipset (EPP/NIBBLE) in COMPATIBLE mode
plip0: <PLIP network interface> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
ata1-slave: ata_command: timeout waiting for intr
ata1-slave: identify failed
ad0: 19536MB <ST320423A> [39693/16/63] at ata0-master UDMA66
ad1: 95562MB <Maxtor 4W100H6> [194158/16/63] at ata0-slave UDMA66
acd0: CDROM <CD-224E> at ata1-master using PIO4

from /var/log/messages:
Jan 21 19:05:46 pizza /kernel: usb0: host controller process error
Jan 21 19:05:46 pizza /kernel: usb0: host controller halted
Jan 21 19:06:29 pizza last message repeated 3 times
Jan 21 19:08:32 pizza last message repeated 14 times
etc...
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 2002-01-31 13:06:51 UTC
Responsible Changed
From-To: freebsd-bugs->n_hibma

Over to maintainer.
Comment 3 david 2002-07-11 17:00:44 UTC
I use the following code to restart the USB after this occurence.
It seems to work OK for me.

Any comments?


*** /usr/src/sys/dev/usb/uhci.c Tue Oct 31 23:23:29 2000
--- usb/uhci.c  Wed Jul 10 12:22:54 2002
***************
*** 962,970 ****
                       USBDEVNAME(sc->sc_bus.bdev));
        }
        if (status & UHCI_STS_HCH) {
!               /* no acknowledge needed */
!               printf("%s: host controller halted\n",=20
!                      USBDEVNAME(sc->sc_bus.bdev));
        }
 =20
        if (ack)        /* acknowledge the ints */
--- 962,990 ----
                       USBDEVNAME(sc->sc_bus.bdev));
        }
        if (status & UHCI_STS_HCH) {
!                 int s;
!  =20
!                 /* no acknowledge needed */
!                 printf("%s: host controller halted\n",=20
!                        USBDEVNAME(sc->sc_bus.bdev));
! =20
!                 /* Try to restart */
!                 printf("DCRH: Restarting USB controller\n");
!                 s =3D splusb();
!                 sc->sc_bus.use_polling++; /* Switch to polling in case =
curproc=3DNULL */
!  =20
!                 UWRITE2(sc, UHCI_STS, 0xFFFF);  /* ack pending =
interrupts */
!                 uhci_run(sc, 0);                /* stop the controller =
*/
!                 UWRITE2(sc, UHCI_INTR, 0);      /* disable interrupts =
*/
!                 uhci_busreset(sc);
!                 UWRITE2(sc, UHCI_INTR, UHCI_INTR_TOCRCIE | =
UHCI_INTR_RIE |
!                         UHCI_INTR_IOCE | UHCI_INTR_SPIE);       /* =
enable interrupts */
!                 UHCICMD(sc, UHCI_CMD_MAXP); /* Assume 64 byte packets =
at frame end */
!                 uhci_run(sc, 1);               /* and here we go... */
!                 sc->sc_bus.use_polling--;
!                 splx(s);
!                 ack =3D 0;
!                 printf("DCRH: USB controller restarted\n");
        }
 =20
        if (ack)        /* acknowledge the ints */


intY has scanned this email for all known viruses (www.inty.com)
Comment 4 joe freebsd_committer freebsd_triage 2003-10-14 09:20:27 UTC
State Changed
From-To: open->analyzed

This is definitely bug in the USB stack.  The author is recommended to try 
the patch at http://www.josef-k.net/misc/RELENG_4-USB-20031005.patch.gz, or 
to wait until after 4.9 has been released when this will be committed to -stable. 


Comment 5 joe freebsd_committer freebsd_triage 2003-10-14 09:20:27 UTC
Responsible Changed
From-To: n_hibma->joe

This is definitely bug in the USB stack.  The author is recommended to try 
the patch at http://www.josef-k.net/misc/RELENG_4-USB-20031005.patch.gz, or 
to wait until after 4.9 has been released when this will be committed to -stable.
Comment 6 andre post 2004-05-11 12:13:01 UTC
This usb driver memory leak is also observed in 5.x
kernels. I have submitted a PR for this (kern/66324).
Could the drivers in the 5.x branch be updated with
the proposed patch?


	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover
Comment 7 joe freebsd_committer freebsd_triage 2004-11-10 10:54:30 UTC
Responsible Changed
From-To: joe->freebsd-usb

Hand this over to the usb mailling list.
Comment 8 Julian Elischer 2005-01-04 05:59:56 UTC
I this still a problem for you?

http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/31659
Comment 9 sehh 2005-01-04 16:47:08 UTC
I can't confirm if this bug still exists or not, since i've moved to a DSL router/hub instead.
Comment 10 Julian Elischer freebsd_committer freebsd_triage 2005-01-10 03:50:40 UTC
State Changed
From-To: analyzed->closed

I believe this to have been fixed during the stack upgrade. 
Unable to confirm the continued existance of the bug.