Harkema, G.A. wrote:
> Hello,
> We are glad to present our new realtime USB stack based on Xenomai
> 2.2.0. You can find it at https://gna.org/projects/usb20rt/ as a
> downloadable file and svn.
> It is not bug free, but it's a start. Please try the core and feel free
> to make comments.

Porting the Linux USB stack over was certainly a lot of work. Could you
elaborate a bit on the design principles?

I saw e.g. that you preallocate one USB per endpoint, correct? Is there
a chance to add more pending URBs? Looks to me like a network driver
that is prepared to receive a single frame and than first requires the
application to read out the data. But I might be wrong here.

How do you manage transfer descriptors? Are they preallocated as well?

Some remarks on the code after a first glance:

 o rthal_spinlock shouldn't be used in a RTDM driver, pick rtdm_lock
 o At least in the EHCI code there is still a Linux timer in use from
   RTDM IRQ context (mod_timer in rtdm_ehci_irq). This will blow your
   box sooner or later.
 o The skeleton driver registers its read handler also for non-rt usage.
   If you don't do this, you could drop that context check in
   rtdm_skeleton_read, and you will gain auto-context-switching for the
   caller as well.

This is certainly a pragmatic approach to gain USB 2.0 support over
RTDM. But I would recommend you to carefully review all time-critical
code paths (URB reception and transmission) with all its corner cases
and dependencies (via spinlocks) to check for their RT-safeness.


Attachment: signature.asc
Description: OpenPGP digital signature

Xenomai-core mailing list

Reply via email to