Re: [RFC PATCH] usb/core: add current frame_number sysfs attr to hcd

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

 



On Tue, 19 Feb 2013, Stefan Tauner wrote:

> On Tue, 19 Feb 2013 13:27:49 -0500 (EST)
> Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> 
> > > Adding a completely new API that returns a timestamp associated with
> > > the start/end/fixed offset of a frame number sounds like a perfect
> > > solution for my problem. I am not sure what you mean with completion
> > > (interrupt). AFAICS that term is used mainly/only in relation to
> > > (signaling) completed URBs. How does that fit together? What can I do
> > > to make it happen?  
> > 
> > Yes, completion interrupts are used for signalling when an URB
> > completes.  That's most of the signalling the CPU gets from a host
> > controller; other things like port connect and disconnect are 
> > comparatively rare.
> 
> Hm but there are also other potential interrupt sources at least for
> some HCD types that could be used, e.g. OHCI_INTR_SF at the start of
> frames in OHCI or the Frame List Rollover interrupt in EHCI?

Yes.  (Although the Frame List Rollover interrupt fires at a rather low 
frequency.)

Don't forget -- if this ever does manage to get into the kernel, it 
will be necessary to modify more than just the EHCI and OHCI drivers.  
The kernel contains a whole bunch of host controller drivers, and every 
one would need to be updated.

> The drawback of using other interrupt sources like OHCI_INTR_SF would
> be of course that they... interrupt, a lot :)
> Maybe the gathering through normally unused interrupts could be
> enabled/disabled with ioctls (and while that is disabled the value is
> only updated on completed URBs)?

Sure, if you want to make things even more complicated...

> What kind of interface do you propose? I would say a single file in
> sysfs with one line frame counter and one line timestamp, but the sysfs
> docs clearly don't encourage mixing types like this, if I understand
> it right. Of course we need to make sure that the corresponding values
> can be retrieved safely in sync...

In fact, I think this interface is so unlikely to be used by more than 
a few people that I propose not adding it at all.  :-)

For your own purposes, of course, you can do whatever you want.

> Do you know about a comparable API I could look at?

Nothing other than the ones you're already aware of.

Alan Stern

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