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

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

> The way they fit together is that completion IRQs are raised at
> microframe boundaries.  Hence, if the interrupt handler stores a
> realtime clock value together with the new microframe number, there's 
> no need for polling.
> 
> The drawback, of course, is that there won't _be_ any completion 
> interrupts until an active URB completes.  Presumably that won't be a 
> problem for you, but it is a weakness for a general-purpose API.

Yes, that is not very nice in general, but it's certainly an
improvement over now.

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...
Do you know about a comparable API I could look at?
-- 
Kind regards/Mit freundlichen Grüßen, Stefan Tauner
--
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