Re: USB UHCI Problems on 8-Stable

2012-03-17 Thread Hans Petter Selasky
On Saturday 17 March 2012 09:58:53 Holm Tiffe wrote:
 Hi,
 
 The BULK transfer stops by a stall. I suspect the UHCI is receiving more
 data than it can, and is hardware programmed to stop it looks like. I
 can't change that behaviour. It is not a bug in the FreeBSD USB driver I
 think.
 
 Try this patch to /usr/ports/devel/openocd/
 
 make extract patch
 
 ee ./work/openocd-0.5.0/src/jtag/drivers/jlink.c
 
 Uhh, may I use Vi? :-)
 
 Change:
 
 result = jlink_usb_read(jlink, in_length);
 
 Into:
 
 /* must read at least one packet at a time! */
 result = jlink_usb_read(jlink, in_length + ((-in_length)  63));
 
 Then re-compile and try again!
 
 --HPS
 
 Ok, I'll try that patch(~ sunday eavening, I'm out of town currntly),
 but it adresses the problem with openocd. ( which is good anyways).
 I is still a bug in FreeBSD's driver that there is now way to
 wake up the controller again and I think that should be changed.
 (please remember, most Kerenels are running with compiled in drivers, so
 thie singe solution is a reboot to reactivate the controller.
 I dont know that much about USB, but I sure that FreeBSDs behavior in this
 case isn't that what we really want. I think usbconfig -d ugen1.1 reset
 schould be made working..

I will think about it. Currently a suspend and resume will do that, though it 
might be an idea to allow that runtime using usbconfig.

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


USB UHCI Problems on 8-Stable

2012-03-15 Thread Holm Tiffe
Hi,

For some time I had problems with my Cam (Olympus FE-230), it wouldn't get
recognized again after unplugging it from the USB Connector.

Now I have a very similar Problem while trying to get an J-Link V8
compatible Jtag debugger working in conjunction with openocd.
Maybe there are bugs in openocd, but the bigger ones seems to be in
FreeBSDs USB drivers.

In the meantime I've cvs-supped to 8.3PRERELEASE (yesterday) built world
and kernel. I've commented the ?hci drivers out of the kernel config and
set USB_DEBUG.


At fist please Cc me, I'm not on freebsd-usb.

After Loading the uhci module:

Mar 15 13:21:09 unicorn kernel: uhci1: VIA 83C572 USB controller port 
0xd000-0xd01f irq 15 at device 16.1 on pci0
Mar 15 13:21:09 unicorn kernel: uhci1: [ITHREAD]
Mar 15 13:21:09 unicorn kernel: usbus0: 12Mbps Full Speed USB v1.0
Mar 15 13:21:10 unicorn kernel: usb_bus_port_set_device: bus 0xc6e44cf0 
devices[1] = 0xc5608800
Mar 15 13:21:10 unicorn kernel: ugen0.1: VIA at usbus0
Mar 15 13:21:10 unicorn kernel: uhub0: VIA UHCI root HUB, class 9/0, rev 
1.00/1.00, addr 1 on usbus0
Mar 15 13:21:10 unicorn kernel: uhub_attach: depth=0 selfpowered=1, parent=0, 
parent-selfpowered=0
Mar 15 13:21:10 unicorn kernel: uhub_attach: Getting HUB descriptor
Mar 15 13:21:10 unicorn kernel: usb_needs_explore: 
Mar 15 13:21:10 unicorn kernel: usb_needs_explore: No root HUB
Mar 15 13:21:10 unicorn kernel: usbus1: VIA 83C572 USB controller on uhci1
Mar 15 13:21:10 unicorn kernel: usbus1: 12Mbps Full Speed USB v1.0
Mar 15 13:21:10 unicorn kernel: usb_needs_explore: 
Mar 15 13:21:10 unicorn kernel: usb_needs_explore: No root HUB
Mar 15 13:21:10 unicorn kernel: uhci2: VIA 83C572 USB controller port 
0xd400-0xd41f irq 5 at device 16.2 on pci0
Mar 15 13:21:10 unicorn kernel: uhci2: [ITHREAD]
Mar 15 13:21:10 unicorn kernel: usb_bus_port_set_device: bus 0xc6ed4cf0 
devices[1] = 0xc5511c00
Mar 15 13:21:10 unicorn kernel: ugen1.1: VIA at usbus1
Mar 15 13:21:10 unicorn kernel: uhub1: VIA UHCI root HUB, class 9/0, rev 
1.00/1.00, addr 1 on usbus1
Mar 15 13:21:10 unicorn kernel: uhub_attach: depth=0 selfpowered=1, parent=0, 
parent-selfpowered=0
Mar 15 13:21:10 unicorn kernel: uhub_attach: Getting HUB descriptor
Mar 15 13:21:10 unicorn kernel: uhub_attach: turn on port 1 power
Mar 15 13:21:10 unicorn kernel: usb_needs_explore: 
Mar 15 13:21:10 unicorn kernel: usb_needs_explore: No root HUB
Mar 15 13:21:10 unicorn kernel: usbus2: VIA 83C572 USB controller on uhci2
Mar 15 13:21:10 unicorn kernel: usbus2: 12Mbps Full Speed USB v1.0
Mar 15 13:21:10 unicorn kernel: usb_needs_explore: 

...

# usbconfig list
ugen0.1: UHCI root HUB VIA at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen1.1: UHCI root HUB VIA at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen2.1: UHCI root HUB VIA at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
# 

Now connecting the J-Link

Mar 15 13:23:41 unicorn kernel: usb_bus_powerd: Recomputing power masks Mar 15 
13:23:41 unicorn kernel: uhub_explore: udev=0xc5511c00 addr=1
Mar 15 13:23:41 unicorn kernel: uhub_read_port_status: port 1, 
wPortStatus=0x0108, wPortChange=0x, err=USB_ERR_NORMAL_COMPLETION
Mar 15 13:23:41 unicorn kernel: uhub_read_port_status: port 2, 
wPortStatus=0x0109, wPortChange=0x0003, err=USB_ERR_NORMAL_COMPLETION
Mar 15 13:23:41 unicorn kernel: uhub_reattach_port: reattaching port 2
Mar 15 13:23:41 unicorn kernel: uhub_read_port_status: port 2, 
wPortStatus=0x0109, wPortChange=0x, err=USB_ERR_NORMAL_COMPLETION
Mar 15 13:23:41 unicorn kernel: uhub_reattach_port: Port 2 is in Host Mode
Mar 15 13:23:42 unicorn root: Unknown USB device: vendor 0x1366 product 0x0101 
bus uhub1
Mar 15 13:23:42 unicorn kernel: uhub_read_port_status: port 2, 
wPortStatus=0x010b, wPortChange=0x, err=USB_ERR_NORMAL_COMPLETION
Mar 15 13:23:42 unicorn kernel: usbd_transfer_power_ref: Adding type 0 to power 
state
Mar 15 13:23:42 unicorn kernel: usbd_transfer_power_ref: needs power
Mar 15 13:23:42 unicorn kernel: usb_bus_port_set_device: bus 0xc6ed4cf0 
devices[2] = 0xc5602400
Mar 15 13:23:42 unicorn kernel: ugen1.2: SEGGER at usbus1
Mar 15 13:23:42 unicorn kernel: usb_needs_explore: 
Mar 15 13:23:42 unicorn kernel: usb_bus_powerd: bus=0xc6e44cf0
Mar 15 13:23:42 unicorn kernel: usb_bus_powerd: Recomputing power masks
Mar 15 13:23:42 unicorn kernel: uhub_explore: udev=0xc5608800 addr=1
Mar 15 13:23:42 unicorn kernel: uhub_read_port_status: port 1, 
wPortStatus=0x0108, wPortChange=0x, err=USB_ERR_NORMAL_COMPLETION
Mar 15 13:23:42 unicorn kernel: uhub_read_port_status: port 2, 
wPortStatus=0x0108, wPortChange=0x, err=USB_ERR_NORMAL_COMPLETION
Mar 15 13:23:42 unicorn kernel: usb_needs_explore: 

..

# usbconfig list
ugen0.1: UHCI root HUB VIA at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen1.1: UHCI root HUB VIA at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen2.1: UHCI root HUB VIA at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen1.2: J-Link SEGGER at usbus1, cfg=0 md=HOST spd=FULL 

Re: USB UHCI Problems on 8-Stable

2012-03-15 Thread Hans Petter Selasky
On Thursday 15 March 2012 13:48:40 Holm Tiffe wrote:
 Hi,
 
 For some time I had problems with my Cam (Olympus FE-230), it wouldn't get
 recognized again after unplugging it from the USB Connector.
 
 Now I have a very similar Problem while trying to get an J-Link V8
 compatible Jtag debugger working in conjunction with openocd.
 Maybe there are bugs in openocd, but the bigger ones seems to be in
 FreeBSDs USB drivers.
 
 In the meantime I've cvs-supped to 8.3PRERELEASE (yesterday) built world
 and kernel. I've commented the ?hci drivers out of the kernel config and
 set USB_DEBUG.
 
 
 At fist please Cc me, I'm not on freebsd-usb.
 
 After Loading the uhci module:

Hi,

Could you log the USB traffic on the UHCI controller using usbdump ?

It would be interesting to see what is going on.

Have you tried using an external High-Speed HUB?

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: USB UHCI Problems on 8-Stable

2012-03-15 Thread Holm Tiffe
 Hi,
 
 For some time I had problems with my Cam (Olympus FE-230), it wouldn't
get
 recognized again after unplugging it from the USB Connector.
 
 Now I have a very similar Problem while trying to get an J-Link V8
 compatible Jtag debugger working in conjunction with openocd.
 Maybe there are bugs in openocd, but the bigger ones seems to be in
 FreeBSDs USB drivers.
 
 In the meantime I've cvs-supped to 8.3PRERELEASE (yesterday) built world
 and kernel. I've commented the ?hci drivers out of the kernel config and
 set USB_DEBUG.
 
 
 At fist please Cc me, I'm not on freebsd-usb.
 
 After Loading the uhci module:

Hi,

Could you log the USB traffic on the UHCI controller using usbdump ?

It would be interesting to see what is going on.

Have you tried using an external High-Speed HUB?

--HPS


Here is the dump: http://www.tiffe.de/other/usbus1.dump

This is connecting the J-link, starting openocd twice, removing 
and reconnecting the J-link followed by a kldunload uhci.

Can't provide a dump while kldloading since usbdump stops when the driver
is unloaded.

I have no Highspeedr-Hub so this was a direct connect. Results are the same
regardless whcih interface is used.


Regards,

Holm

-- 
  Technik Service u. Handel Tiffe, www.tsht.de, Holm Tiffe, 
 Freiberger Straße 42, 09600 Oberschöna, USt-Id: DE253710583
  www.tsht.de, i...@tsht.de, Fax +49 3731 74200, Mobil: 0172 8790 741
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org