Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 May 2008 17:15:40 +0200 (CEST)
From:      "David Imhoff" <dimhoff_devel@xs4all.nl>
To:        freebsd-usb@freebsd.org
Subject:   Re: UGEN stall problems
Message-ID:  <18416.83.160.27.115.1210259740.squirrel@webmail.xs4all.nl>

next in thread | raw e-mail | index | archive | help
Hi,

First of all i think i found 2 related bugs:
 - usb/71417: [ugen] Cryptoflex e-gate USB token (ugen0) communication...
 - usb/83863: [ugen] Communication problem between opensc/openct via
   USB...
Both bugs describe similar communication problems but with an Cryptoflex
e-gate USB token. Both haven't been resolved.

I analyzed the logging a bit more and i noticed something strange. When the
usbd_do_request_flags_pipe() function detects a STALL on an endpoint it 
tries to obtain the device status with a GET_STATUS request, this is the 
last request you see in the logging. Both devices react a little odd:
 - eToken: The GET_STATUS request stall's, What i understood from the
   USB spec's this isn't possible.
 - mIdentity: The returned status indicates the endpoint isn't stalled at
   all.

I also increased the UHCI debugging and found that with eToken the TD that
stalls is first NAK'ed. Below i added the logging of a success full command
for the eToken and a unsuccessful. The only differences are the NAK.
I saw more NAK's but only if the last TD is an IN token and is NAK'ed, the
 endpoint gets stalled.

I hope this extra information is useful.

David

Sucessfull command:
--------------------
 uhci_device_control type=0x40, request=0x06, wValue=0x0000, wIndex=0x0000
len=9, addr=2, endpt=0
 uhci_alloc_std_chain: addr=2 endpt=0 len=9 speed=2 flags=0x6
 uhci_alloc_std_chain: maxp=64 ntd=1
 uhci_alloc_std_chain: nexttog=0
 uhci_device_request: before transfer
 TD(0xc2ed4240) at 1f402240 = link=0x1f4021e4 status=0x18800000
token=0x00e0022d buffer=0x033a6c40
 1f4021e4<VF> 18800000<ACTIVE>,errcnt=3,actlen=1
pid=2d,addr=2,endpt=0,D=0,maxlen=8
 TD(0xc2ed41e0) at 1f4021e0 = link=0x1f402214 status=0x388003ff
token=0x010802e1 buffer=0x1f5d9300
 1f402214<VF> 388003ff<ACTIVE,SPD>,errcnt=3,actlen=0
pid=e1,addr=2,endpt=0,D=1,maxlen=9
 TD(0xc2ed4210) at 1f402210 = link=0x00000001 status=0x19800000
token=0xffe80269 buffer=0x00000000
 1<T> 19800000<ACTIVE,IOC>,errcnt=3,actlen=1
pid=69,addr=2,endpt=0,D=1,maxlen=0
 uhci_add_ctrl: sqh=0xc2ed5da0
 uhci_enter_ctl_q: follow from [0]
 TD(0xc2ed2f90) at 1f400f90 = link=0x1f401f62 status=0x02000000
token=0x00000000 buffer=0x00000000
 1f401f62<Q> 2000000<ISO>,errcnt=0,actlen=1
pid=00,addr=0,endpt=0,D=0,maxlen=1
 QH(0xc2ed3f60) at 1f401f60: hlink=1f401f82 elink=00000001
 QH(0xc2ed3f60) at 1f401f60: hlink=1f401f82 elink=00000001
 QH(0xc2ed3f80) at 1f401f80: hlink=1f401fa2 elink=00000001
 QH(0xc2ed3fa0) at 1f401fa0: hlink=1f403da2 elink=00000001
 QH(0xc2ed5da0) at 1f403da0: hlink=1f401fc2 elink=00000001
 QH(0xc2ed3fc0) at 1f401fc0: hlink=1f401fe2 elink=00000001
 QH(0xc2ed3fe0) at 1f401fe0: hlink=00000001 elink=1f400fc0
 Enqueued QH:
 QH(0xc2ed5da0) at 1f403da0: hlink=1f401fc2 elink=00000001
 TD(0xc2ed4240) at 1f402240 = link=0x1f4021e4 status=0x18000007
token=0x00e0022d buffer=0x033a6c40
 1f4021e4<VF> 18000007,errcnt=3,actlen=8 pid=2d,addr=2,endpt=0,D=0,maxlen=8
 TD(0xc2ed41e0) at 1f4021e0 = link=0x1f402214 status=0x38000008
token=0x010802e1 buffer=0x1f5d9300
 1f402214<VF> 38000008<SPD>,errcnt=3,actlen=9
pid=e1,addr=2,endpt=0,D=1,maxlen=9
 TD(0xc2ed4210) at 1f402210 = link=0x00000001 status=0x190007ff
token=0xffe80269 buffer=0x00000000
 1<T> 190007ff<IOC>,errcnt=3,actlen=0 pid=69,addr=2,endpt=0,D=1,maxlen=0
 usb1: uhci_softintr (0)
 uhci_check_intr: ii=0xc2edab78 done
 uhci_idone: ii=0xc2edab78
 uhci_idone: ii=0xc2edab78, xfer=0xc2edaa00, pipe=0xc515ce00 ready
 TD(0xc2ed4240) at 1f402240 = link=0x1f4021e4 status=0x18000007
token=0x00e0022d buffer=0x033a6c40
 1f4021e4<VF> 18000007,errcnt=3,actlen=8 pid=2d,addr=2,endpt=0,D=0,maxlen=8
 TD(0xc2ed41e0) at 1f4021e0 = link=0x1f402214 status=0x38000008
token=0x010802e1 buffer=0x1f5d9300
 1f402214<VF> 38000008<SPD>,errcnt=3,actlen=9
pid=e1,addr=2,endpt=0,D=1,maxlen=9
 TD(0xc2ed4210) at 1f402210 = link=0x00000001 status=0x190007ff
token=0xffe80269 buffer=0x00000000
 1<T> 190007ff<IOC>,errcnt=3,actlen=0 pid=69,addr=2,endpt=0,D=1,maxlen=0
 uhci_idone: actlen=9, status=0x0
 uhci_remove_hs_ctrl: sqh=0xc2ed5da0
 uhci_device_ctrl_done: length=9
 uhci_idone: ii=0xc2edab78 done


Unsucessfull command:
--------------------
 uhci_device_control type=0x40, request=0x06, wValue=0x0000, wIndex=0x0000
len=9, addr=2, endpt=0
 uhci_alloc_std_chain: addr=2 endpt=0 len=9 speed=2 flags=0x6
 uhci_alloc_std_chain: maxp=64 ntd=1
 uhci_alloc_std_chain: nexttog=0
 uhci_device_request: before transfer
 TD(0xc2ed4240) at 1f402240 = link=0x1f4021e4 status=0x18800000
token=0x00e0022d buffer=0x033a6c40
 1f4021e4<VF> 18800000<ACTIVE>,errcnt=3,actlen=1
pid=2d,addr=2,endpt=0,D=0,maxlen=8
 TD(0xc2ed41e0) at 1f4021e0 = link=0x1f402214 status=0x388003ff
token=0x010802e1 buffer=0x0d6516b0
 1f402214<VF> 388003ff<ACTIVE,SPD>,errcnt=3,actlen=0
pid=e1,addr=2,endpt=0,D=1,maxlen=9
 TD(0xc2ed4210) at 1f402210 = link=0x00000001 status=0x19800000
token=0xffe80269 buffer=0x00000000
 1<T> 19800000<ACTIVE,IOC>,errcnt=3,actlen=1
pid=69,addr=2,endpt=0,D=1,maxlen=0
 uhci_add_ctrl: sqh=0xc2ed5da0
 uhci_enter_ctl_q: follow from [0]
 TD(0xc2ed2f90) at 1f400f90 = link=0x1f401f62 status=0x02000000
token=0x00000000 buffer=0x00000000
 1f401f62<Q> 2000000<ISO>,errcnt=0,actlen=1
pid=00,addr=0,endpt=0,D=0,maxlen=1
 QH(0xc2ed3f60) at 1f401f60: hlink=1f401f82 elink=00000001
 QH(0xc2ed3f60) at 1f401f60: hlink=1f401f82 elink=00000001
 QH(0xc2ed3f80) at 1f401f80: hlink=1f401fa2 elink=00000001
 QH(0xc2ed3fa0) at 1f401fa0: hlink=1f403da2 elink=00000001
 QH(0xc2ed5da0) at 1f403da0: hlink=1f401fc2 elink=1f402214
 QH(0xc2ed3fc0) at 1f401fc0: hlink=1f401fe2 elink=00000001
 QH(0xc2ed3fe0) at 1f401fe0: hlink=00000001 elink=1f400fc0
 Enqueued QH:
 QH(0xc2ed5da0) at 1f403da0: hlink=1f401fc2 elink=1f402214
 TD(0xc2ed4240) at 1f402240 = link=0x1f4021e4 status=0x18000007
token=0x00e0022d buffer=0x033a6c40
 1f4021e4<VF> 18000007,errcnt=3,actlen=8 pid=2d,addr=2,endpt=0,D=0,maxlen=8
 TD(0xc2ed41e0) at 1f4021e0 = link=0x1f402214 status=0x38000008
token=0x010802e1 buffer=0x0d6516b0
 1f402214<VF> 38000008<SPD>,errcnt=3,actlen=9
pid=e1,addr=2,endpt=0,D=1,maxlen=9
 TD(0xc2ed4210) at 1f402210 = link=0x00000001 status=0x198807ff
token=0xffe80269 buffer=0x00000000
 1<T> 198807ff<NAK,ACTIVE,IOC>,errcnt=3,actlen=0
pid=69,addr=2,endpt=0,D=1,maxlen=0
 usb1: uhci_softintr (0)
 uhci_check_intr: ii=0xc2edab78 done
 uhci_idone: ii=0xc2edab78
 uhci_idone: ii=0xc2edab78, xfer=0xc2edaa00, pipe=0xc515ce00 ready
 TD(0xc2ed4240) at 1f402240 = link=0x1f4021e4 status=0x18000007
token=0x00e0022d buffer=0x033a6c40
 1f4021e4<VF> 18000007,errcnt=3,actlen=8 pid=2d,addr=2,endpt=0,D=0,maxlen=8
 TD(0xc2ed41e0) at 1f4021e0 = link=0x1f402214 status=0x38000008
token=0x010802e1 buffer=0x0d6516b0
 1f402214<VF> 38000008<SPD>,errcnt=3,actlen=9
pid=e1,addr=2,endpt=0,D=1,maxlen=9
 TD(0xc2ed4210) at 1f402210 = link=0x00000001 status=0x194007ff
token=0xffe80269 buffer=0x00000000
 1<T> 194007ff<STALLED,IOC>,errcnt=3,actlen=0
pid=69,addr=2,endpt=0,D=1,maxlen=0
 uhci_idone: actlen=9, status=0x400000
 uhci_idone: error, addr=2, endpt=0x00, status 0x400000<STALLED>
 uhci_remove_hs_ctrl: sqh=0xc2ed5da0
 uhci_device_ctrl_done: length=9
 uhci_idone: ii=0xc2edab78 done





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?18416.83.160.27.115.1210259740.squirrel>