All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Asier Tamayo" <asier.tamayo@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: Jan Kiszka <jan.kiszka@domain.hid>, xenomai@xenomai.org
Subject: Re: [Xenomai-help] FW: rtdm_iomap_to_user() I-pipe error
Date: Thu, 28 Apr 2011 10:54:30 +0200	[thread overview]
Message-ID: <DFFBF4EB468A894AB1474ED220F05AF60134C182@domain.hid> (raw)
In-Reply-To: <4DB85435.8040400@domain.hid>

Hello,

Finally rtdm_iomap_to_user works! It was an initialization error: the probe() function correctly stored the pci_resource_start and pci_resource_len values in the xen_mydriver variable, but these values were not copied into the context->dev_private structure in the open() function. The ioctl function used my_context->location, which was 0.

In the new working driver, the open() function correctly initializes the context->dev_private variable. Later, rtdm_iomap_to_user() is called with the correct values.

Gilles, thank you very much for your help and patience. It would have been much harder to find a solution without your indications. 

By the way, I have upgraded to Xenomai 2.4.10. It was quite straightforward. I haven't applied the patches from ksrc/arch/x86/patches/adeos-ipipe*.

Thank you for your help.

Best regards,

Asier





> -----Original Message-----
> From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
> Sent: Wednesday, April 27, 2011 7:37 PM
> To: Asier Tamayo
> Cc: Jan Kiszka; xenomai-help@gna.org
> Subject: Re: [Xenomai-help] FW: rtdm_iomap_to_user() I-pipe error
> 
> 
> Gilles Chanteperdrix wrote:
> > Asier Tamayo wrote:
> >> Hello,
> >>
> >> Thanks for your help.
> >>
> >> I know my Xenomai version is quite out of date. However, 
> as I'm using
> >> the ELinOS distribution (which already has its own patches), I find
> >> it really difficult to upgrade to Xenomai 2.4.10. Anyway, 
> I can apply
> >> changes to some files.
> > 
> > Sorry, I do not mean that you should upgrade to 2.4.10, I mean you
> > should run a self-contained test case on an unpatched 
> 2.4.10, in order
> > to see whether you observe the same behaviour.
> > 
> >> The rtdm_iomap_to_user function is referenced in drvlib.c and
> >> rtdm_driver.h: I compare the 2.4.7 and 2.4.10 versions and they are
> >> almost identical, so I think there will be no use in patching the
> >> kernel for these 2 files. Do you know of any other file that could
> >> make any difference in my problem?
> >>
> >> If I compare versions 2.4.7 and 2.5.6 (the last one) of Xenomai, I
> >> can see the last version uses "/dev/rtheap" instead of "/dev/zero"
> >> and that there are some changes if CONFIG_MMU is not defined. My
> >> system (Intel Atom N270 CPU) is configured with MMU and 
> therefore the
> >> only actual changes between the versions are regarding 
> "dev/rtheap".
> >> Does it make any difference? Xenomai 2.4.7 has 
> "/dev/rtpheap" but no
> >> "/dev/rtheap"; should I use it instead of "/dev/zero"?
> > 
> > The implementation is different, in order to know why, and 
> which problem
> >  it solves, you can look into git history. The advantage of using
> > /dev/rtheap is that the implementation is shared with other skins.
> > 
> >>
> >>>> virt_to_phys(new_iomap) --> 0xf5f6f000
> >>> virt_to_phys is not supposed to work in that case. Since you
> >>> ioremap'ed the address, you already know the physical address
> >>> anyway.
> >>>
> >> Is there any function that will tell me the real physical 
> address in
> >> order to make sure the mapping is correct?
> > 
> > I would say vmalloc_to_page. But do not take my word for 
> it, check the
> > "linux device drivers" book.
> > 
> vmalloc_to_page would work for an address returned by vmalloc/ioremap,
> not for one returned by the mapping functions.
> 
> To check what happens, you should trace drvlib.c to see what 
> parameters
> are finally passed to remap_page_range.
> 
> But there were several changes between 2.4 and 2.5, so, I 
> would suggest
> trying 2.5.6, just with the simple test case, no need to upgrade the
> linux kernel.
> 
> -- 
>                                                               
>   Gilles.
> 

      reply	other threads:[~2011-04-28  8:54 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
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 [this message]

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=DFFBF4EB468A894AB1474ED220F05AF60134C182@domain.hid \
    --to=asier.tamayo@domain.hid \
    --cc=gilles.chanteperdrix@xenomai.org \
    --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.