Skip to contentSkip to conversation

Is anyone maintaining (or even using) usbtmc?

DISCUSSION Andrew Lutomirski 4 participants 10 messages Aug 3, 2009 – Aug 6, 2009

lore
Share & tools
lore
#0 lore raw

Hi all-

I'm trying to use usbtmc on an Aglient N9310A (The only TMC device I have), and it sort of works, but it seems to be both extremely buggy and missing a good deal of rather important functionality. Is there anyone maintaining it?

If the answer is yes, I can describe the bugs (logspam, spurious errors, delayed messages, inability to read status, etc.) in greater detail.

If the answer is no (as I suspect it is), then I might give fixing it a shot the week after next, when I'll be camping out in Virginia with this thing for awhile. In that case, I have another question:

Is anyone using usbtmc, or, more specifically, does anyone care about backward compatibility?

If not, then I'll be less careful to preserve the interface, even though I'm not really sure that there's much of interest to preserve.

Thanks,
Andy, who's happy that the driver at least works a little bit

#1 lore raw
Quoted 6 lines · Andrew Lutomirski

Hi all-

I'm trying to use usbtmc on an Aglient N9310A (The only TMC device I have), and it sort of works, but it seems to be both extremely buggy and missing a good deal of rather important functionality. Is there anyone maintaining it?

Yes, me.

Quoted 3 lines

If the answer is yes, I can describe the bugs (logspam, spurious errors, delayed messages, inability to read status, etc.) in greater detail.

Please do, but also please use the latest version, in 2.6.30.3, we fixed some bad problems in it recently.

Quoted 2 lines

Is anyone using usbtmc, or, more specifically, does anyone care about backward compatibility?

What do you want to change in the driver interface?

thanks,

greg k-h

#2 lore raw
Quoted 8 lines · Greg KH
Quoted 6 lines · Andrew Lutomirski

Hi all-

I'm trying to use usbtmc on an Aglient N9310A (The only TMC device I have), and it sort of works, but it seems to be both extremely buggy and missing a good deal of rather important functionality.  Is there anyone maintaining it?

Quoted 8 lines

Yes, me.

Quoted 3 lines

If the answer is yes, I can describe the bugs (logspam, spurious errors, delayed messages, inability to read status, etc.) in greater detail.

Please do, but also please use the latest version, in 2.6.30.3, we fixed some bad problems in it recently.

I am.

Almost anything I do triggers this:

usbtmc 3-1:1.0: Unable to read data, error -110

The easiest way is to write something that wasn't a query and then try to read. Of course, the read should fail, but there's no reason it should spam the logs.

On occasion, sending garbage to the device will cause even a subsequent USBTMC_IOCTL_CLEAR to fail with ETIMEDOUT. (Maybe I wanted USBTMC_IOCTL_ABORT_BULK_IN? That seems wrong, though, since presumably the driver should manage pending Bulk-IN requests on its own.)

On other occasions (usually triggered by sending a garbage command, but, when this happens, the problem persists across several messages), every response will be delayed. That is, if I send a query, I get back the previous query's answer or ETIMEDOUT if the previous command wasn't a query. This persists across closing and reopening the device.

Sometimes write() fails with ETIMEDOUT. This failure happens with no perceivable delay and I have no idea why.

An ioctl for GET_CAPABILITIES would be nice, but is not mandatory.

Finally, I see no way to read the USB488 status byte or detect a status interrupt.

Quoted 5 lines
Quoted 3 lines

Is anyone using usbtmc, or, more specifically, does anyone care about backward compatibility?

What do you want to change in the driver interface?

The main compatibility-breaking change is that I'd like to see close/reopen go through the whole resynchronization procedure so that the device starts in a sane state. Currently I restore sanity by doing a bunch of reads and ignoring ETIMEDOUT.

--Andy

#3 lore raw
Quoted 20 lines · Andrew Lutomirski
Quoted 8 lines · Greg KH
Quoted 6 lines · Andrew Lutomirski

Hi all-

I'm trying to use usbtmc on an Aglient N9310A (The only TMC device I have), and it sort of works, but it seems to be both extremely buggy and missing a good deal of rather important functionality.  Is there anyone maintaining it?

Quoted 8 lines

Yes, me.

Quoted 3 lines

If the answer is yes, I can describe the bugs (logspam, spurious errors, delayed messages, inability to read status, etc.) in greater detail.

Please do, but also please use the latest version, in 2.6.30.3, we fixed some bad problems in it recently.

I am.

Quoted 7 lines

Almost anything I do triggers this:

usbtmc 3-1:1.0: Unable to read data, error -110

The easiest way is to write something that wasn't a query and then try to read.  Of course, the read should fail, but there's no reason it should spam the logs.

Here's more details, in the form of an strace log:

open("/dev/usbtmc0", O_RDWR|O_EXCL)     = 3
ioctl(3, 0x5b07, 0)                     = 0  // CLEAR_OUT_HALT
ioctl(3, 0x5b06, 0)                     = 0  // CLEAR_IN_HALT
ioctl(3, 0x5b02, 0)                     = 0  // CLEAR
write(3, "*IDN?\n", 6)                  = 6
read(3, 0x2078554, 4096)                = -1 ETIMEDOUT (Connection timed out)

Removing the \n makes no difference. This happens over and over.

Then I used a different program that opened the device, read and discarded some ETIMEDOUTs, and made a successful query (not quite sure what did the trick), and the original program starts working again.

--Andy

#4 lore raw
Quoted 19 lines · Andrew Lutomirski
Quoted 18 lines · Andrew Lutomirski
Quoted 16 lines · Greg KH
Quoted 6 lines · Andrew Lutomirski

Hi all-

I'm trying to use usbtmc on an Aglient N9310A (The only TMC device I have), and it sort of works, but it seems to be both extremely buggy and missing a good deal of rather important functionality.  Is there anyone maintaining it?

Yes, me.

Quoted 3 lines

If the answer is yes, I can describe the bugs (logspam, spurious errors, delayed messages, inability to read status, etc.) in greater detail.

Please do, but also please use the latest version, in 2.6.30.3, we fixed some bad problems in it recently.

Quoted 6 lines
Quoted 6 lines

I am.

Almost anything I do triggers this:

usbtmc 3-1:1.0: Unable to read data, error -110

My N9310A is now totally wedged. Anything I can think of doing (send queries, send *RST, or any of the CLEAR ioctls) fails and spews stuff like this:

[360946.881771] usbtmc 3-1:1.0: Unable to send data, error -110
[360946.890770] usbtmc 3-1:1.0: usb_bulk_msg returned -110
[360965.303400] usb 3-1: usb_control_msg returned -110
[360965.312404] usb 3-1: usb_control_msg returned -110
[361052.364626] usbtmc 3-1:1.0: usb_bulk_msg returned -110
[361055.114579] usbtmc 3-1:1.0: Unable to send data, error -110
[361055.123574] usbtmc 3-1:1.0: usb_bulk_msg returned -110

I'm going to leave it like this in case you want me to try something.

--Andy

#5 lore raw
Quoted 38 lines · Andrew Lutomirski
Quoted 16 lines · Andrew Lutomirski
Quoted 15 lines · Andrew Lutomirski
Quoted 14 lines · Greg KH
Quoted 6 lines · Andrew Lutomirski

Hi all-

I'm trying to use usbtmc on an Aglient N9310A (The only TMC device I have), and it sort of works, but it seems to be both extremely buggy and missing a good deal of rather important functionality.  Is there anyone maintaining it?

Yes, me.

Quoted 3 lines

If the answer is yes, I can describe the bugs (logspam, spurious errors, delayed messages, inability to read status, etc.) in greater detail.

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

Please do, but also please use the latest version, in 2.6.30.3, we fixed some bad problems in it recently.

I am.

Almost anything I do triggers this:

usbtmc 3-1:1.0: Unable to read data, error -110

My N9310A is now totally wedged. Anything I can think of doing (send queries, send *RST, or any of the CLEAR ioctls) fails and spews stuff like this:

[360946.881771] usbtmc 3-1:1.0: Unable to send data, error -110
[360946.890770] usbtmc 3-1:1.0: usb_bulk_msg returned -110
[360965.303400] usb 3-1: usb_control_msg returned -110
[360965.312404] usb 3-1: usb_control_msg returned -110
[361052.364626] usbtmc 3-1:1.0: usb_bulk_msg returned -110
[361055.114579] usbtmc 3-1:1.0: Unable to send data, error -110
[361055.123574] usbtmc 3-1:1.0: usb_bulk_msg returned -110
Quoted 1 line

I'm going to leave it like this in case you want me to try something.

Could I help also with tests? I have a Tektronix TDS 1001B here with TMC capability.

Juergen

Signature · 4 lines
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | Phone: +49-8766-939 228     |
Vertretung Sued/Muenchen, Germany             | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686              | http://www.pengutronix.de/  |
#6 lore raw
In reply to Andrew Lutomirski
Quoted 39 lines · Andrew Lutomirski
Quoted 19 lines · Andrew Lutomirski
Quoted 18 lines · Andrew Lutomirski
Quoted 16 lines · Greg KH
Quoted 6 lines · Andrew Lutomirski

Hi all-

I'm trying to use usbtmc on an Aglient N9310A (The only TMC device I have), and it sort of works, but it seems to be both extremely buggy and missing a good deal of rather important functionality.  Is there anyone maintaining it?

Yes, me.

Quoted 3 lines

If the answer is yes, I can describe the bugs (logspam, spurious errors, delayed messages, inability to read status, etc.) in greater detail.

Please do, but also please use the latest version, in 2.6.30.3, we fixed some bad problems in it recently.

Quoted 6 lines
Quoted 6 lines

I am.

Almost anything I do triggers this:

usbtmc 3-1:1.0: Unable to read data, error -110

My N9310A is now totally wedged. Anything I can think of doing (send queries, send *RST, or any of the CLEAR ioctls) fails and spews stuff like this:

[360946.881771] usbtmc 3-1:1.0: Unable to send data, error -110
[360946.890770] usbtmc 3-1:1.0: usb_bulk_msg returned -110
[360965.303400] usb 3-1: usb_control_msg returned -110
[360965.312404] usb 3-1: usb_control_msg returned -110
[361052.364626] usbtmc 3-1:1.0: usb_bulk_msg returned -110
[361055.114579] usbtmc 3-1:1.0: Unable to send data, error -110
[361055.123574] usbtmc 3-1:1.0: usb_bulk_msg returned -110
Quoted 1 line

I'm going to leave it like this in case you want me to try something.

I really don't know, sorry. Bad firmware on the device?

odd.

greg k-h

#7 lore raw
In reply to Andrew Lutomirski
Quoted 20 lines · Andrew Lutomirski
Quoted 8 lines · Greg KH
Quoted 6 lines · Andrew Lutomirski

Hi all-

I'm trying to use usbtmc on an Aglient N9310A (The only TMC device I have), and it sort of works, but it seems to be both extremely buggy and missing a good deal of rather important functionality.  Is there anyone maintaining it?

Quoted 8 lines

Yes, me.

Quoted 3 lines

If the answer is yes, I can describe the bugs (logspam, spurious errors, delayed messages, inability to read status, etc.) in greater detail.

Please do, but also please use the latest version, in 2.6.30.3, we fixed some bad problems in it recently.

I am.

Quoted 7 lines

Almost anything I do triggers this:

usbtmc 3-1:1.0: Unable to read data, error -110

The easiest way is to write something that wasn't a query and then try to read. Of course, the read should fail, but there's no reason it should spam the logs.

Ok, care to send a patch reducing the error level of the message?

Quoted 5 lines

On occasion, sending garbage to the device will cause even a subsequent USBTMC_IOCTL_CLEAR to fail with ETIMEDOUT. (Maybe I wanted USBTMC_IOCTL_ABORT_BULK_IN? That seems wrong, though, since presumably the driver should manage pending Bulk-IN requests on its own.)

Possibly, although I don't know the protocol for what should happen when sending garbage to devices, except that it is probably undefined :)

Quoted 9 lines

On other occasions (usually triggered by sending a garbage command, but, when this happens, the problem persists across several messages), every response will be delayed. That is, if I send a query, I get back the previous query's answer or ETIMEDOUT if the previous command wasn't a query. This persists across closing and reopening the device.

Sometimes write() fails with ETIMEDOUT. This failure happens with no perceivable delay and I have no idea why.

Device problems?

Quoted 1 line

An ioctl for GET_CAPABILITIES would be nice, but is not mandatory.

What's wrong with the sysfs file for this instead?

Quoted 2 lines

Finally, I see no way to read the USB488 status byte or detect a status interrupt.

Hm, is this in the spec somewhere that I missed? Patches are always welcome.

thanks,

greg k-h

#8 lore raw
In reply to Andrew Lutomirski

i've asked also some of your questions two month ago.

i'm a tmc driver user only. i use it to develop my firmware for a cypress fx2 based tmc device.

i've made some bugreporting to greg and to the mailinglist (now i'm not sure anymore if all my mails arrived on the mailinglist. the gmame archive does not list all mails. the other archives are even worse).

since then two ore tree small patches are sent to the mailinglist. but none seemed to adress my bugs (one patch was about a memory leak)

Quoted 3 lines

If the answer is no (as I suspect it is), then I might give fixing it a shot the week after next, when I'll be camping out in Virginia with this thing for awhile. In that case, I have another question:

do it. greg is the maintainer of the whole usb stuff and is working really hard. so i understand that he only has little time on "our" usbtmc bugs. in my opionion it's good when you do it to help greg with it. he still is the maintainer and has to sign of your patches.

the other thing is, that i belive, please correct me, that greg don't has an usbtmc device to test with. for me it seems that there is lack of testing in the usbtmc driver. thats why i assume this.

as i wrote in my older mails, i've never worked on the kernel source. i can do some testing with different devices (in our lab we have serveral tmc devices).

Quoted 2 lines

Is anyone using usbtmc, or, more specifically, does anyone care about backward compatibility?

it doesn't look like that. i don't care if the interface changes. i'm still working with the old agilent one until the mainline one works.

Quoted 7 lines

Finally, I see no way to read the USB488 status byte or detect a status interrupt.

Quoted 4 lines
Quoted 3 lines

Is anyone using usbtmc, or, more specifically, does anyone care about backward compatibility?

Quoted 8 lines
Quoted 1 line

What do you want to change in the driver interface?

The main compatibility-breaking change is that I'd like to see close/reopen go through the whole resynchronization procedure so that the device starts in a sane state. Currently I restore sanity by doing a bunch of reads and ignoring ETIMEDOUT.
If not, then I'll be less careful to preserve the interface, even though I'm not really sure that there's much of interest to preserve.

to read the USB488 status byte i guess that there is still an ioctl function for it (was there in the opensource agilent driver) but you can get the status byte with a normal "*STB?" query.

the lack of interrupt status reporting is an important one. so you have to quess, or do stupid polling, until your device is finished working. the normal way is to set "opc?" and do something else until the response from the interrupt endpoint arrives.

christoph

#9 lore raw
Quoted 12 lines · Zimmermann Christoph

i've asked also some of your questions two month ago.

i'm a tmc driver user only. i use it to develop my firmware for a cypress fx2 based tmc device.

i've made some bugreporting to greg and to the mailinglist (now i'm not sure anymore if all my mails arrived on the mailinglist. the gmame archive does not list all mails. the other archives are even worse).

since then two ore tree small patches are sent to the mailinglist. but none seemed to adress my bugs (one patch was about a memory leak)

Quoted 8 lines
Quoted 3 lines

If the answer is no (as I suspect it is), then I might give fixing it a shot the week after next, when I'll be camping out in Virginia with this thing for awhile. In that case, I have another question:

do it. greg is the maintainer of the whole usb stuff and is working really hard. so i understand that he only has little time on "our" usbtmc bugs. in my opionion it's good when you do it to help greg with it. he still is the maintainer and has to sign of your patches.

Yes, any patches you can provide for this driver would be most appreciated.

Quoted 3 lines

the other thing is, that i belive, please correct me, that greg don't has an usbtmc device to test with. for me it seems that there is lack of testing in the usbtmc driver. thats why i assume this.

No, I do have a device, I just don't really have a userspace program to strongly stress it :)

thanks,

greg k-h