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, 22 Sep 2006 10:58:56 +0200	[thread overview]
Message-ID: <4513A5D0.3040507@domain.hid> (raw)
In-Reply-To: <1158914149.14421.10.camel@domain.hid>

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

Stelian Pop wrote:
> [Sorry for the delay, I was quite busy those days and unable to test the
> patch...]
> 
> Le mardi 19 septembre 2006 à 17:34 +0200, Jan Kiszka a écrit :
>>> Or maybe we should lower the API level a little bit, and let the user
>>> specify the physical address of the mapping instead of the virtual
>>> one....
>> How would this help? You still need the virtual address for VMA blocks
>> in order to collect the pages.
> 
> Actualy we need both the virtual address (for vmalloc case) and the
> physical address (for ioremap case).
> 
>> +    if (mmap_data->mem_type == RTDM_MEMTYPE_VMALLOC) {
> [...]
> 
> This still won't work because for RTDM_MEMTYPE_IOREMAP
> virt_to_phys((void *)vaddr) doesn't return the physical address.
> 
> So we still need to either:
> 	a) walk the vmlist struct to find out the needed vm->phys_addr (which
> will probably won't work in 2.4, or even in earlier 2.6 kernels)

Sounds fragile, indeed.

> 
> 	b) pass both the physical and the virtual adresses in the
> rtdm_mmap_to_user prototype (the physical address would be used only
> when RTDM_MEMTYPE_IOREMAP is specified)

Hmm, a bit ugly, this long argument list.

> 
> 	c) make 'src_addr' be a virtual address in some cases, and a physical
> address in ioremap case.

That's so far the cleanest solution in my eyes.

> 
> 	d) make a special rtdm_mmap_iomem_to_user() function...

Also an option. Specifically, it wouldn't break the existing API... What
about rtdm_iomap_to_user? Would you like to work out a patch in this
direction?

Jan


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

  reply	other threads:[~2006-09-22  8:58 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
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 [this message]
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=4513A5D0.3040507@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.