All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Asier Tamayo <asier.tamayo@domain.hid>
Cc: Jan Kiszka <jan.kiszka@domain.hid>, xenomai@xenomai.org
Subject: Re: [Xenomai-help] FW: rtdm_iomap_to_user() I-pipe error
Date: Tue, 26 Apr 2011 13:15:09 +0200	[thread overview]
Message-ID: <4DB6A93D.3070402@domain.hid> (raw)
In-Reply-To: <DFFBF4EB468A894AB1474ED220F05AF60134C17F@srv-dc.ona-electroerosion.com>

Asier Tamayo wrote:
> Hello again,
> 
> When one doesn't get replies to his questions, it may be either
> because: i) they are too obvious (RTFM), ii) too difficult, iii)
> there is little information and it makes the checking in one's system
> impossible, or iv) they haven't been correctly explained. It may also
> be that the help demander is not being polite.
> 
> As i have received no answer, I will assume I haven't explained my
> problem correctly and will give myself a second chance ;) The
> following lines will just rewrite my question, since I haven't been
> able to find any new clue:
> 
> I'm porting a PCI driver to a RTDM, using Xenomai version 2.4.7 and
> Linux 2.6.27, from the ELinOS 5.0 distribution.

Before anything else, please try the latest version of the branch you
use (that would be Xenomai 2.4.10)

> 
> I want to allow a RT task to access the PCI memory directly, by
> calling the rtdm_iomap_to_user() function just after mlockall and
> rt_dev_open, and before rt_task_shadow. The function returns me a
> correct value, but then I cannot access the PCI registers by using
> that address. The mmap seems not to be correct. The values I get:
> 
> Driver: xen_mydriver->location = pci_resource_start(dev,0); -->
> 0x20000000 xen_mydriver->base_address =
> ioremap(xen_mydriver->location, xen_mydriver->mem_size); -->
> 0xe0a00000 *(unsigned short*)(my_context->base_address + 0x100) =
> 0xAAAA; --> It works
> 
> RT task: rtdm_iomap_to_user(user_info,my_context->location, 300,
> PROT_READ|PROT_WRITE, &new_iomap, NULL, NULL); --> 0xb5f6f000 
> virt_to_phys(new_iomap) --> 0xf5f6f000 *(unsigned short*)(new_iomap +

virt_to_phys is not supposed to work in that case. Since you ioremap'ed
the address, you already know the physical address anyway.

-- 
                                                                Gilles.


  reply	other threads:[~2011-04-26 11:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-14  6:14 [Xenomai-help] FW: rtdm_iomap_to_user() I-pipe error Asier Tamayo
2011-04-14  7:34 ` Jan Kiszka
2011-04-14  9:38   ` Asier Tamayo
2011-04-26 10:05     ` Asier Tamayo
2011-04-26 11:15       ` Gilles Chanteperdrix [this message]
2011-04-27  7:05         ` Asier Tamayo
2011-04-27  7:42           ` Gilles Chanteperdrix
2011-04-27 17:36             ` Gilles Chanteperdrix
2011-04-28  8:54               ` Asier Tamayo

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=4DB6A93D.3070402@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=asier.tamayo@domain.hid \
    --cc=jan.kiszka@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.