Re: current amd64 USB problems

From: Eric Anderson <anderson_at_freebsd.org>
Date: Thu, 08 Mar 2007 23:56:30 -0600
On 03/08/07 07:41, Hans Petter Selasky wrote:
> On Thursday 08 March 2007 14:33, Eric Anderson wrote:
>> On 03/02/07 14:16, Hans Petter Selasky wrote:
>>> On Thursday 01 March 2007 13:54, Eric Anderson wrote:
>>>> On 02/28/07 15:52, Rick Mullis wrote:
>>>>> I have a Intel DG965RY mainboard with a Duo Core 2 Processor and 4GB of
>>>>> Ram and I can not get USB working for the life of me. I have been
>>>>> following the maillists and searching Google for weeks now, updating
>>>>> source code and rebuild world and kernel and unfortunately usb is still
>>>>> not working. I keep getting "hub root problem, error=4". When I turn
>>>>> the computer on the USB lights are on and as soon as the usb0 through
>>>>> usb6 comes up the lights go out and the system will not work with any
>>>>> usb device. The error shows up on all usb*. Is there something I am
>>>>> overlooking? This computer only runs FreeBSD 7.0-current and no gui.
>>>>>
>>>>> Please help.
>>>> Yea, I have the same problem.  I spent a ton of time yesterday trying to
>>>> get a Dell PowerEdge 1950 up and running, until I realized what was
>>>> going on.  :(
>>>>
>>>>
>>>> This same hardware with 6.2 looks something like this:
>>>>
>>>> Jan 25 09:43:21  kernel: uhci0: <UHCI (generic) USB controller> port
>>>> 0xcce0-0xccff irq 21 at device 29.0 on pci0
>>>> Jan 25 09:43:21  kernel: uhci0: [GIANT-LOCKED]
>>>> Jan 25 09:43:21  kernel: usb0: <UHCI (generic) USB controller> on uhci0
>>>> Jan 25 09:43:21  kernel: usb0: USB revision 1.0
>>>> Jan 25 09:43:21  kernel: uhub0: Intel UHCI root hub, class 9/0, rev
>>>> 1.00/1.00, addr 1
>>>> Jan 25 09:43:21  kernel: uhub0: 2 ports with 2 removable, self powered
>>>> Jan 25 09:43:21  kernel: uhci1: <UHCI (generic) USB controller> port
>>>> 0xccc0-0xccdf irq 20 at device 29.1 on pci0
>>>> Jan 25 09:43:21  kernel: uhci1: [GIANT-LOCKED]
>>>> Jan 25 09:43:21  kernel: usb1: <UHCI (generic) USB controller> on uhci1
>>>> Jan 25 09:43:21  kernel: usb1: USB revision 1.0
>>>> Jan 25 09:43:21  kernel: uhub1: Intel UHCI root hub, class 9/0, rev
>>>> 1.00/1.00, addr 1
>>>> Jan 25 09:43:21  kernel: uhub1: 2 ports with 2 removable, self powered
>>>> Jan 25 09:43:21  kernel: uhci2: <UHCI (generic) USB controller> port
>>>> 0xcca0-0xccbf irq 21 at device 29.2 on pci0
>>>> Jan 25 09:43:21  kernel: uhci2: [GIANT-LOCKED]
>>>> Jan 25 09:43:21  kernel: usb2: <UHCI (generic) USB controller> on uhci2
>>>> Jan 25 09:43:21  kernel: usb2: USB revision 1.0
>>>> Jan 25 09:43:21  kernel: uhub2: Intel UHCI root hub, class 9/0, rev
>>>> 1.00/1.00, addr 1
>>>> Jan 25 09:43:21  kernel: uhub2: 2 ports with 2 removable, self powered
>>>> Jan 25 09:43:21  kernel: ehci0: <EHCI (generic) USB 2.0 controller> mem
>>>> 0xfc800000-0xfc8003ff irq 21 at device 29.7 on pci0
>>>> Jan 25 09:43:21  kernel: ehci0: [GIANT-LOCKED]
>>>> Jan 25 09:43:21  kernel: usb3: EHCI version 1.0
>>>> Jan 25 09:43:21  kernel: usb3: companion controllers, 2 ports each: usb0
>>>> usb1 usb2
>>>> Jan 25 09:43:21  kernel: usb3: <EHCI (generic) USB 2.0 controller> on
>>>> ehci0 Jan 25 09:43:21  kernel: usb3: USB revision 2.0
>>>> Jan 25 09:43:21  kernel: uhub3: Intel EHCI root hub, class 9/0, rev
>>>> 2.00/1.00, addr 1
>>>> Jan 25 09:43:21  kernel: uhub3: 6 ports with 6 removable, self powered
>>>> Jan 25 09:43:21  kernel: uhub4: vendor 0x413c product 0xa001, class 9/0,
>>>> rev 2.00/0.00, addr 2
>>>> Jan 25 09:43:21  kernel: uhub4: multiple transaction translators
>>>> Jan 25 09:43:21  kernel: uhub4: 2 ports with 2 removable, self powered
>>>> Jan 25 09:43:21  kernel: ukbd0: Dell DRAC5, rev 1.10/0.00, addr 3,
>>>> iclass 3/1
>>>> Jan 25 09:43:21  kernel: kbd2 at ukbd0
>>>> Jan 25 09:43:21  kernel: ums0: Dell DRAC5, rev 1.10/0.00, addr 3, iclass
>>>> 3/1 Jan 25 09:43:21  kernel: ums0: X report 0x0002 not supported
>>>>
>>>>
>>>> And under CURRENT looks like this:
>>>> Feb 27 08:04:47 mail1 kernel: uhci0: <UHCI (generic) USB controller>
>>>> port 0xcce0-0xccff irq 21 at device 29.0 on pci0
>>>> Feb 27 08:04:47 mail1 kernel: uhci0: Reserved 0x20 bytes for rid 0x20
>>>> type 4 at 0xcce0
>>>> Feb 27 08:04:47 mail1 kernel: ioapic0: routing intpin 21 (PCI IRQ 21) to
>>>> vector 53
>>>> Feb 27 08:04:47 mail1 kernel: uhci0: [GIANT-LOCKED]
>>>> Feb 27 08:04:47 mail1 kernel: uhci0: [ITHREAD]
>>>> Feb 27 08:04:47 mail1 kernel: usb0: <UHCI (generic) USB controller> on
>>>> uhci0 Feb 27 08:04:47 mail1 kernel: usb0: USB revision 1.0
>>>> Feb 27 08:04:47 mail1 kernel: usb0: root hub problem, error=4
>>>> Feb 27 08:04:47 mail1 kernel: uhci1: <UHCI (generic) USB controller>
>>>> port 0xccc0-0xccdf irq 20 at device 29.1 on pci0
>>>> Feb 27 08:04:47 mail1 kernel: uhci1: Reserved 0x20 bytes for rid 0x20
>>>> type 4 at 0xccc0
>>>> Feb 27 08:04:47 mail1 kernel: ioapic0: routing intpin 20 (PCI IRQ 20) to
>>>> vector 54
>>>> Feb 27 08:04:47 mail1 kernel: uhci1: [GIANT-LOCKED]
>>>> Feb 27 08:04:47 mail1 kernel: uhci1: [ITHREAD]
>>>> Feb 27 08:04:47 mail1 kernel: usb1: <UHCI (generic) USB controller> on
>>>> uhci1 Feb 27 08:04:47 mail1 kernel: usb1: USB revision 1.0
>>>> Feb 27 08:04:47 mail1 kernel: usb1: root hub problem, error=4
>>>> Feb 27 08:04:47 mail1 kernel: uhci2: <UHCI (generic) USB controller>
>>>> port 0xcca0-0xccbf irq 21 at device 29.2 on pci0
>>>> Feb 27 08:04:47 mail1 kernel: uhci2: Reserved 0x20 bytes for rid 0x20
>>>> type 4 at 0xcca0
>>>> Feb 27 08:04:47 mail1 kernel: uhci2: [GIANT-LOCKED]
>>>> Feb 27 08:04:47 mail1 kernel: uhci2: [ITHREAD]
>>>> Feb 27 08:04:47 mail1 kernel: usb2: <UHCI (generic) USB controller> on
>>>> uhci2 Feb 27 08:04:47 mail1 kernel: usb2: USB revision 1.0
>>>> Feb 27 08:04:47 mail1 kernel: usb2: root hub problem, error=4
>>>> Feb 27 08:04:47 mail1 kernel: ehci0: <EHCI (generic) USB 2.0 controller>
>>>> mem 0xfc800000-0xfc8003ff irq 21 at device 29.7 on pci0
>>>> Feb 27 08:04:47 mail1 kernel: ehci0: Reserved 0x400 bytes for rid 0x10
>>>> type 3 at 0xfc800000
>>>> Feb 27 08:04:47 mail1 kernel: ehci0: [GIANT-LOCKED]
>>>> Feb 27 08:04:47 mail1 kernel: ehci0: [ITHREAD]
>>>> Feb 27 08:04:47 mail1 kernel: usb3: EHCI version 1.0
>>>> Feb 27 08:04:47 mail1 kernel: usb3: companion controllers, 2 ports each:
>>>> usb0 usb1 usb2
>>>> Feb 27 08:04:47 mail1 kernel: usb3: <EHCI (generic) USB 2.0 controller>
>>>> on ehci0
>>>> Feb 27 08:04:47 mail1 kernel: usb3: USB revision 2.0
>>>> Feb 27 08:04:47 mail1 kernel: usb3: root hub problem, error=4
>>>>
>>>> FreeBSD mail1.centtech.com 7.0-CURRENT FreeBSD 7.0-CURRENT #2: Tue Feb
>>>> 27 07:26:28 UTC 2007  .../usr/obj/usr/src/sys/GENERIC  amd64
>>>>
>>>> i386 seems to work fine..
>>> Have you tried the new USB stack?
>>>
>>> http://www.turbocat.net/~hselasky/usb4bsd
>>>
>>> --HPS
>> Breakage:
>>
>> --------------------------------------------------------------
>>
>>  >>> stage 3.2: building everything
>>
>> --------------------------------------------------------------
>> cd /usr/obj/usr/src/sys/GENERIC; MAKEOBJDIRPREFIX=/usr/obj
>> MACHINE_ARCH=amd64  MACHINE=amd64  CPUTYPE=
>> GROFF_BIN_PATH=/usr/obj/usr/src/tmp/legacy/usr/bin
>> GROFF_FONT_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/groff_font
>> GROFF_TMAC_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/tmac
>> _SHLIBDIRPREFIX=/usr/obj/usr/src/tmp  INSTALL="sh
>> /usr/src/tools/install.sh"
>> PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/b
>> in:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:/usr/
>> obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:
>> /usr/bin /usr/obj/usr/src/make.amd64/make KERNEL=kernel all -DNO_MODULES_OBJ
>> cc -c -O2 -frename-registers -pipe -fno-strict-aliasing  -std=c99 -g -Wall
>> -Wredundant-decls -Wnested-externs -Wstrict-prototypes
>> -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef
>> -fformat-extensions -nostdinc -I-  -I. -I/usr/src/sys
>> -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS
>> -include opt_global.h -fno-common -finline-limit=8000 --param
>> inline-unit-growth=100 --param large-function-growth=1000
>> -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387
>> -mno-sse -mno-sse2 -mno-mmx -mno-3dnow  -msoft-float
>> -fno-asynchronous-unwind-tables -ffreestanding -Werror
>> /usr/src/sys/dev/usb/ehci.c
>> cc -c -O2 -frename-registers -pipe -fno-strict-aliasing  -std=c99 -g
>> -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
>> -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef
>> -fformat-extensions -nostdinc -I-  -I. -I/usr/src/sys
>> -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS
>> -include opt_global.h -fno-common -finline-limit=8000 --param
>> inline-unit-growth=100 --param large-function-growth=1000
>> -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387
>> -mno-sse -mno-sse2 -mno-mmx -mno-3dnow  -msoft-float
>> -fno-asynchronous-unwind-tables -ffreestanding -Werror
>> /usr/src/sys/dev/usb/ehci_pci.c
>> /usr/src/sys/dev/usb/ehci_pci.c: In function `ehci_pci_attach':
>> /usr/src/sys/dev/usb/ehci_pci.c:341: warning: passing arg 5 of
>> `bus_setup_intr' from incompatible pointer type
>> /usr/src/sys/dev/usb/ehci_pci.c:341: error: too few arguments to
>> function `bus_setup_intr'
>> *** Error code 1
>>
>> Stop in /usr/obj/usr/src/sys/GENERIC.
>> *** Error code 1
>>
>> Stop in /usr/src.
>> *** Error code 1
>>
>> Stop in /usr/src.
> 
> Yes, they made some changes to the bus_setup_intr API in current. Could you 
> try something like this, insert a NULL argument, to all bus_setup_intr() 
> functions you find under /sys/dev/usb/, like shown below ?
> 
>         error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_TTY,
> -                              si_intr, sc, &ih);
> +                              NULL, si_intr, sc, &ih);
> 
> --HPS


Yes, those changes (only 3) makes it compile and install ok, and now it 
sees the USB devices and works correctly!

So, of course I have to ask: is this planned to be merged into cvs soon? 
  If not, a fix for -CURRENT for these systems should be put in to make 
it work on a lot of systems.

Thanks for the work!
Eric
Received on Fri Mar 09 2007 - 04:56:35 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:06 UTC