All of lore.kernel.org
 help / color / mirror / Atom feed
* Is anyone maintaining (or even using) usbtmc?
@ 2009-08-03 21:14 Andrew Lutomirski
  2009-08-03 21:20 ` Greg KH
  2009-08-06 12:19 ` Zimmermann Christoph
  0 siblings, 2 replies; 10+ messages in thread
From: Andrew Lutomirski @ 2009-08-03 21:14 UTC (permalink / raw)
  To: linux-kernel, linux-usb, gregkh

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Is anyone maintaining (or even using) usbtmc?
  2009-08-03 21:14 Is anyone maintaining (or even using) usbtmc? Andrew Lutomirski
@ 2009-08-03 21:20 ` Greg KH
  2009-08-03 21:49   ` Andrew Lutomirski
  2009-08-06 12:19 ` Zimmermann Christoph
  1 sibling, 1 reply; 10+ messages in thread
From: Greg KH @ 2009-08-03 21:20 UTC (permalink / raw)
  To: Andrew Lutomirski; +Cc: linux-kernel, linux-usb, gregkh

On Mon, Aug 03, 2009 at 05:14:56PM -0400, Andrew Lutomirski wrote:
> 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.

> 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.

> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Is anyone maintaining (or even using) usbtmc?
  2009-08-03 21:20 ` Greg KH
@ 2009-08-03 21:49   ` Andrew Lutomirski
  2009-08-03 22:01     ` Andrew Lutomirski
  2009-08-06 19:54     ` Greg KH
  0 siblings, 2 replies; 10+ messages in thread
From: Andrew Lutomirski @ 2009-08-03 21:49 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, linux-usb, gregkh

On Mon, Aug 3, 2009 at 5:20 PM, Greg KH<greg@kroah.com> wrote:
> On Mon, Aug 03, 2009 at 05:14:56PM -0400, Andrew Lutomirski wrote:
>> 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.
>
>> 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.

>
>> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Is anyone maintaining (or even using) usbtmc?
  2009-08-03 21:49   ` Andrew Lutomirski
@ 2009-08-03 22:01     ` Andrew Lutomirski
  2009-08-03 23:00       ` Andrew Lutomirski
  2009-08-06 19:54     ` Greg KH
  1 sibling, 1 reply; 10+ messages in thread
From: Andrew Lutomirski @ 2009-08-03 22:01 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, linux-usb, gregkh

On Mon, Aug 3, 2009 at 5:49 PM, Andrew Lutomirski<luto@mit.edu> wrote:
> On Mon, Aug 3, 2009 at 5:20 PM, Greg KH<greg@kroah.com> wrote:
>> On Mon, Aug 03, 2009 at 05:14:56PM -0400, Andrew Lutomirski wrote:
>>> 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.
>>
>>> 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.

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Is anyone maintaining (or even using) usbtmc?
  2009-08-03 22:01     ` Andrew Lutomirski
@ 2009-08-03 23:00       ` Andrew Lutomirski
  2009-08-04 15:32         ` Juergen Beisert
  2009-08-06 19:55         ` Greg KH
  0 siblings, 2 replies; 10+ messages in thread
From: Andrew Lutomirski @ 2009-08-03 23:00 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, linux-usb, gregkh

On Mon, Aug 3, 2009 at 6:01 PM, Andrew Lutomirski<luto@mit.edu> wrote:
> On Mon, Aug 3, 2009 at 5:49 PM, Andrew Lutomirski<luto@mit.edu> wrote:
>> On Mon, Aug 3, 2009 at 5:20 PM, Greg KH<greg@kroah.com> wrote:
>>> On Mon, Aug 03, 2009 at 05:14:56PM -0400, Andrew Lutomirski wrote:
>>>> 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.
>>>
>>>> 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
>>

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Is anyone maintaining (or even using) usbtmc?
  2009-08-03 23:00       ` Andrew Lutomirski
@ 2009-08-04 15:32         ` Juergen Beisert
  2009-08-06 19:55         ` Greg KH
  1 sibling, 0 replies; 10+ messages in thread
From: Juergen Beisert @ 2009-08-04 15:32 UTC (permalink / raw)
  To: linux-kernel

On Dienstag, 4. August 2009, Andrew Lutomirski wrote:
> On Mon, Aug 3, 2009 at 6:01 PM, Andrew Lutomirski<luto@mit.edu> wrote:
> > On Mon, Aug 3, 2009 at 5:49 PM, Andrew Lutomirski<luto@mit.edu> wrote:
> >> On Mon, Aug 3, 2009 at 5:20 PM, Greg KH<greg@kroah.com> wrote:
> >>> On Mon, Aug 03, 2009 at 05:14:56PM -0400, Andrew Lutomirski wrote:
> >>>> 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.
> >>>
> >>>> 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
>
> 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.

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

Juergen

-- 
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/  |

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Is anyone maintaining (or even using) usbtmc?
  2009-08-03 21:14 Is anyone maintaining (or even using) usbtmc? Andrew Lutomirski
  2009-08-03 21:20 ` Greg KH
@ 2009-08-06 12:19 ` Zimmermann Christoph
  2009-08-06 15:38   ` Greg KH
  1 sibling, 1 reply; 10+ messages in thread
From: Zimmermann Christoph @ 2009-08-06 12:19 UTC (permalink / raw)
  To: Andrew Lutomirski, Greg KH; +Cc: linux-kernel

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)

> 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).

> 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.

> Finally, I see no way to read the USB488 status byte or detect a
> status interrupt.
> 
> >  
> >> 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.
> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Is anyone maintaining (or even using) usbtmc?
  2009-08-06 12:19 ` Zimmermann Christoph
@ 2009-08-06 15:38   ` Greg KH
  0 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2009-08-06 15:38 UTC (permalink / raw)
  To: Zimmermann Christoph; +Cc: Andrew Lutomirski, linux-kernel

On Thu, Aug 06, 2009 at 02:19:38PM +0200, Zimmermann Christoph wrote:
> 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)
> 
> > 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.

> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Is anyone maintaining (or even using) usbtmc?
  2009-08-03 21:49   ` Andrew Lutomirski
  2009-08-03 22:01     ` Andrew Lutomirski
@ 2009-08-06 19:54     ` Greg KH
  1 sibling, 0 replies; 10+ messages in thread
From: Greg KH @ 2009-08-06 19:54 UTC (permalink / raw)
  To: Andrew Lutomirski; +Cc: linux-kernel, linux-usb, gregkh

On Mon, Aug 03, 2009 at 05:49:09PM -0400, Andrew Lutomirski wrote:
> On Mon, Aug 3, 2009 at 5:20 PM, Greg KH<greg@kroah.com> wrote:
> > On Mon, Aug 03, 2009 at 05:14:56PM -0400, Andrew Lutomirski wrote:
> >> 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.
> >
> >> 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.

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

> 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 :)

> 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?

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

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

> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Is anyone maintaining (or even using) usbtmc?
  2009-08-03 23:00       ` Andrew Lutomirski
  2009-08-04 15:32         ` Juergen Beisert
@ 2009-08-06 19:55         ` Greg KH
  1 sibling, 0 replies; 10+ messages in thread
From: Greg KH @ 2009-08-06 19:55 UTC (permalink / raw)
  To: Andrew Lutomirski; +Cc: linux-kernel, linux-usb, gregkh

On Mon, Aug 03, 2009 at 07:00:47PM -0400, Andrew Lutomirski wrote:
> On Mon, Aug 3, 2009 at 6:01 PM, Andrew Lutomirski<luto@mit.edu> wrote:
> > On Mon, Aug 3, 2009 at 5:49 PM, Andrew Lutomirski<luto@mit.edu> wrote:
> >> On Mon, Aug 3, 2009 at 5:20 PM, Greg KH<greg@kroah.com> wrote:
> >>> On Mon, Aug 03, 2009 at 05:14:56PM -0400, Andrew Lutomirski wrote:
> >>>> 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.
> >>>
> >>>> 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
> >>
> 
> 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.

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

odd.

greg k-h

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-08-06 19:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-03 21:14 Is anyone maintaining (or even using) usbtmc? Andrew Lutomirski
2009-08-03 21:20 ` Greg KH
2009-08-03 21:49   ` Andrew Lutomirski
2009-08-03 22:01     ` Andrew Lutomirski
2009-08-03 23:00       ` Andrew Lutomirski
2009-08-04 15:32         ` Juergen Beisert
2009-08-06 19:55         ` Greg KH
2009-08-06 19:54     ` Greg KH
2009-08-06 12:19 ` Zimmermann Christoph
2009-08-06 15:38   ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.