All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Stelian Pop <stelian.pop@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] 	[PATCH, RFC] Make ioremap'ed memory available through	rtdm_mmap_to_user()
Date: Fri, 15 Sep 2006 18:40:06 +0200	[thread overview]
Message-ID: <450AD766.3000307@domain.hid> (raw)
In-Reply-To: <1158337583.13530.20.camel@domain.hid>

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

Stelian Pop wrote:
> Hi,
> 
> I need to be able to map an IO memory buffer to userspace from a RTDM
> driver.
> 
> rtdm_mmap_to_user() seems to do what I need, but it doesn't work. Its
> code thinks that all virtual addresses between VMALLOC_START and
> VMALLOC_END are obtained through vmalloc() and tries to call
> xnarch_remap_vm_page() on them, which fails.

Ok, interesting (one never stops learning).

> 
> Virtual addresses coming from ioremap() need to go through
> xnarch_remap_io_page_range(), and their physical address cannot be
> obtained with a simple virt_to_phys().
> 
> A working patch is attached below, but there might (should ?) be a
> better way to do it. Some of the code may also belong to
> asm-generic/system.h instead of the RTDM skin.
> 
> Note that you may also need to EXPORT_SYMBOL(vmlist and vmlist_lock) in
> mm/vmalloc.c if you want to build the RTDM skin as a module.
> 
> Comments ?

In case no one comes up with an easy, portable way to detect remapped
memory as well: What about some flags the caller of rtdm_mmap_to_user
has to pass, telling what kind of memory it is? Would simplify the RTDM
part, and the user normally knows quite well where the memory came from.
And I love to break APIs. :)

I'm CC'ing the first users of this service to ask for some feedback from
their POV. Hope gna does not -once again- mangles the CCs.

Jan


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

  reply	other threads:[~2006-09-15 16:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-15 16:26 [Xenomai-core] [PATCH, RFC] Make ioremap'ed memory available through rtdm_mmap_to_user() Stelian Pop
2006-09-15 16:40 ` Jan Kiszka [this message]
2006-09-18 21:13   ` Stelian Pop
2006-09-19 15:34     ` Jan Kiszka
2006-09-22  8:35       ` Stelian Pop
2006-09-22  8:58         ` Jan Kiszka
2006-09-22 11:34           ` Stelian Pop
2006-09-22 14:41             ` Jan Kiszka
2006-09-22 14:53               ` Stelian Pop

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=450AD766.3000307@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=stelian.pop@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.