All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: "Markus Osterried (BA/EDD)" <markus.osterried@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] rtdm_iomap_to_user() with PowerPC
Date: Fri, 07 Sep 2007 16:13:59 +0200	[thread overview]
Message-ID: <1189174439.26986.89.camel@domain.hid> (raw)
In-Reply-To: <E5E9C6CC7DC8844A8DA7A9EFE7B5350E08F1F9@domain.hid>

On Thu, 2007-09-06 at 10:45 +0200, 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. 
> 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?

The best and only solution is to mark the the I/O pages as guarded
+uncached as expected on powerpc as you did indirectly, but this is
likely to add a great amount of ugly code to the arch-dep wrappers, in
order to do that according to the 2.4 x 2.6 x powerpc x i386 [ x ia64 ]
matrix. This said, wrappers are usually the place where disgusting code
lives anyway.

>  Everyone else seen this problem?
> 
Not sure that many people use rtdm to map some I/O space on powerpc yet,
but in any case, this can't work the way it is done right now. I'll
submit a fix along your suggested lines. Thanks for the report.

> Thanks 
> Markus
> 
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core
-- 
Philippe.




  parent reply	other threads:[~2007-09-07 14:13 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
2007-09-07 12:51 ` Johan Borkhuis
2007-09-07 14:13 ` Philippe Gerum [this message]
  -- 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=1189174439.26986.89.camel@domain.hid \
    --to=rpm@xenomai.org \
    --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.