AW: usbtmc driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi all

here is now a first, hopefully usefull, bugreport for the usbtmc driver:

executed commands:
root@miniprijv:# echo "*ese?" > /dev/usbtmc0
root@miniprijv:# cat /dev/usbtmc0
0
cat: /dev/usbtmc0: Die Wartezeit für die Verbindung ist abgelaufen   <-- this means a timeout occoured

usbmon output:
d0c7f080 2338333712 S Bo:1:030:2 -115 20 = 0101fe00 06000000 01000000 2a657365 3f0a0000
d0c7f080 2338333786 C Bo:1:030:2 0 20 >
f6719b80 2339955647 S Bo:1:030:2 -115 12 = 0202fd00 e2070000 000a0000
f6719b80 2339955714 C Bo:1:030:2 0 12 >
f6719b80 2339956096 S Bi:1:030:6 -115 2048 <
f6719b80 2339956211 C Bi:1:030:6 0 15 = 0202fd00 02000000 01000000 300a00
f6719b80 2339956374 S Bo:1:030:2 -115 12 = 0203fc00 e2070000 000a0000
f6719b80 2339956460 C Bo:1:030:2 0 12 >
f6719b80 2339956572 S Bi:1:030:6 -115 2048 <
f6719b80 2339975592 C Bi:1:030:6 -2 0
f6719b80 2339975722 S Ci:1:030:0 s a2 03 0004 0086 0002 2 <
f6719b80 2339975838 C Ci:1:030:0 0 2 = 8104


when I execute this command, I get the correct response of the client device AND a time-out 
error message.
the problem here is, that the usbtmc driver requests to many data from the device. 
as you can see in the usbmon log above in transaction 2339955647 the host sends a 
REQUEST DEVICE DEPENDENT IN TRANSFER, this is ACK'd from the client. the host then does a in
transfer (transaction 2339956211) and gets the correct information from the device. 
the device reports a correct transfer size in the tmc IN header of 0x02 (ASCII 0 and LF) and
also sets the EOM (end of message bit) according to the tmc specs.

then, after the tmc message is finished the driver sends another 
REQUEST DEVICE DEPENDENT IN TRANSFER (2339956374) and tries to read data from the device again.
the device has no data queued and NAK's the transfer and stalls the endpoint (according to tmc
specs page 12, paragraph 2). 

the last part in the usbmon log is ok, the host detects an error and tries to abort the last 
started action, the tmc in transfer. the device responds also correctly (0x81) that no such 
transfer has started, i've seen other devices responding SUCCESS also when no transfer has 
started before.

sincerely,
christoph
________________________________________
Von: Greg KH [gregkh@xxxxxxx]
Gesendet: Donnerstag, 4. Juni 2009 20:15
An: Zimmermann Christoph
Cc: linux-usb@xxxxxxxxxxxxxxx
Betreff: Re: usbtmc driver

On Thu, Jun 04, 2009 at 06:00:40PM +0200, Zimmermann Christoph [zac1] wrote:
> hi
>
> now i found the correct sysfs location for my device and i see the files
> needed to configure the behavior of the driver itself (TermChar,
> auto-abort,...) but i couldn't figure out how to trigger the driver to
> send a "indicator pulse" setup command (usbtmc spec section 4.2.1.9).
>
> today i compiled a vanilla 2.6.29-4 kernel with debug messages activated
> and tried again my usual commands:
>
> root@localhost:/home/chrigi/GECKO3COM/usbtmc# ./usbtmc_ioctl 0 indpulse
> Error: ioctl returned -1.

Odd.  That means that something happened with the command and it was not
successful.  Can you enable CONFIG_USB_DEBUG and look at the kernel log
messages?

> root@localhost:/home/chrigi/GECKO3COM/usbtmc# echo "*idn?" > /dev/usbtmc0
> root@localhost:/home/chrigi/GECKO3COM/usbtmc# cat /dev/usbtmc0
> MicroLab BFH-TI,GECKO3COM,proto-2,0.3
> cat: /dev/usbtmc0: Die Wartezeit für die Verbindung ist abgelaufen
>
>
> the kernel logs looks exactly the same as with my normal distribution
> kernel:
>
> Jun  4 17:49:06 miniprijv kernel: [ 2438.365152] usb 1-3: new high speed
> USB device using ehci_hcd and address 4
> Jun  4 17:49:07 miniprijv kernel: [ 2439.716293] hub 1-0:1.0: unable to
> enumerate USB device on port 3
> Jun  4 17:49:07 miniprijv kernel: [ 2440.110149] usb 1-3: new high speed
> USB device using ehci_hcd and address 5
> Jun  4 17:49:08 miniprijv kernel: [ 2440.225352] usb 1-3: configuration
> #1 chosen from 1 choice
> Jun  4 17:49:47 miniprijv kernel: [ 2479.775242] usbtmc 1-3:1.0:
> INITIATE_ABORT_BULK_OUT returned 81

That means that your device returned
USBTMC_STATUS_TRANSFER_NOT_IN_PROGRESS, so something is wrong.

> Jun  4 17:49:47 miniprijv kernel: [ 2479.775361] usbtmc 1-3:1.0:
> INITIATE_ABORT_BULK_IN returned 81

Same here.

> Jun  4 17:49:57 miniprijv kernel: [ 2489.609415] usbtmc 1-3:1.0: Unable
> to read data, error -110

Have you not started sending data?

> Jun  4 17:49:57 miniprijv kernel: [ 2489.609579] usbtmc 1-3:1.0:
> INITIATE_ABORT_BULK_IN returned 81

Same error here.

It looks like your device isn't configured properly somehow.  Have you
started to stream data from it?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux