All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: "Markus Osterried (BA/EDD)" <markus.osterried@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] rtdm_iomap_to_user() with PowerPC
Date: Thu, 06 Sep 2007 23:32:22 +0200	[thread overview]
Message-ID: <46E071E6.8030807@domain.hid> (raw)
In-Reply-To: <E5E9C6CC7DC8844A8DA7A9EFE7B5350E08F1F9@domain.hid>

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

Markus Osterried (BA/EDD) wrote:
> Hello,
> 
> I want to use rtdm_iomap_to_user() to map our device registers to user
> space.
> But this doesn't work, our application just crashes when I read from the
> mapped registers.
> 
> When I insert the line
> 
> 	vma->vm_page_prot = phys_mem_access_prot(filp,
> paddr>>PAGE_SHIFT, size, vma->vm_page_prot);
> 
> in rtdm_mmap_buffer() just before calling xnarch_remap_io_page_range()
> it works fine.

[hint: using diff -up helps the reader to quickly localise your changes.]

> This is just like it is done in /drivers/char/mem.c and in
> /drivers/video/fbmem.c.
> 
> But I think this is architecture and kernel version dependent and I
> don't know whether rtdm_mmap_buffer() is the right place.
> I use Xenomai 2.3.1 and Linux 2.6.18 with PowerPC CPU.
> What is the best solution? Everyone else seen this problem?

Providing phys_mem_access_prot() services for
xnarch_remap_io_page_range() looks like it is actually required -
practically at least for PPC, but I can't tell immediately if there
aren't other yet unnoticed side effect of skipping it.

Hmm, can we extend xnarch_remap_io_page_range()/
wrap_remap_io_page_range() to take care of this as well? Suggestions
(ie. patches) welcome!

Jan


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

  reply	other threads:[~2007-09-06 21:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-06  8:45 [Xenomai-core] rtdm_iomap_to_user() with PowerPC Markus Osterried (BA/EDD)
2007-09-06 21:32 ` Jan Kiszka [this message]
2007-09-07 12:51 ` Johan Borkhuis
2007-09-07 14:13 ` Philippe Gerum
  -- strict thread matches above, loose matches on Subject: below --
2007-11-07 14:28 Markus Osterried
2007-11-07 14:45 ` Jan Kiszka
2007-11-07 15:44   ` Markus Osterried
2007-11-07 16:08     ` Jan Kiszka
2007-11-08  8:51       ` Philippe Gerum

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=46E071E6.8030807@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=markus.osterried@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.