All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: "Harkema, G.A." <G.A.Harkema@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] dma in rtdm
Date: Tue, 25 Jul 2006 08:18:29 +0200	[thread overview]
Message-ID: <44C5B7B5.3080505@domain.hid> (raw)
In-Reply-To: <E443EE6E95070D46896C24F5C44EA7F53A1547@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 1591 bytes --]

Harkema, G.A. wrote:
> Hallo,
> 
>  
> 
> We are currently trying to develop a realtime usb2.0 stack based on
> xenomai rtdm. In non-realtime mode we use first the kmalloc() function
> to allocate a dma buffer and use the dma_map_single() function to get
> the bus address for the dma engine of the ehci hostcontroller. This
> works fine. For use in a realtime context we replaced the kmalloc()
> function by the rtdm_malloc() function. In our logs we see that the data

rtdm_malloc does not return memory guaranteed to be usable for DMA (we
should document this somewhere). Depending on the size of your system
heap, the memory /may/ come from a pre-allocated kmalloc'ed (heap <=
128K) or from a vmalloc'ed block.

> transfer take place, but the dma buffer was not filled with the
> (received)data. We don't know where the data in the memory is stored. Is
> this the right way for using dma in realtime context ? I guess not., but
> what is the right way. Who can help us with this problem.

I'm convinced that ahead-of-time allocation of URBs, transfer
descriptors, and other buffers is the way to go. The application /
high-level driver requesting some service from the UHCI controller
should take care of providing them. That way you will gain full
determinism, because even rtdm_malloc is not guaranteed to work always.
Low memory or fragmentation caused by other users of this service may
bite you in complex scenarios.

Jan


PS: Is your design now based on usb4rt or do you work on a separate
solution? I haven't heard any news from you on this.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

  reply	other threads:[~2006-07-25  6:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-24 13:16 [Xenomai-help] dma in rtdm Harkema, G.A.
2006-07-25  6:18 ` Jan Kiszka [this message]
2006-07-25 16:06   ` [Xenomai-help] Xenomai task (beginner) GUARDIOLA-FALCO Sebastien 204282
2006-07-25 17:23     ` Gilles Chanteperdrix
2006-07-26  6:14       ` GUARDIOLA-FALCO Sebastien 204282
2006-07-26 12:05         ` Gilles Chanteperdrix
2006-07-26 13:48           ` GUARDIOLA-FALCO Sebastien 204282
2006-07-27 12:07             ` Gilles Chanteperdrix
2006-07-25 17:41     ` Jan Kiszka
2006-07-26 14:39       ` Ulrich Schwab
2006-07-26 14:58         ` GUARDIOLA-FALCO Sebastien 204282
2006-07-26 15:02         ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44C5B7B5.3080505@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=G.A.Harkema@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.