All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] rtdm_iomap_to_user() with PowerPC
@ 2007-09-06  8:45 Markus Osterried (BA/EDD)
  2007-09-06 21:32 ` Jan Kiszka
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Markus Osterried (BA/EDD) @ 2007-09-06  8:45 UTC (permalink / raw)
  To: xenomai

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

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? Everyone else seen this problem?

Thanks
Markus


[-- Attachment #2: Type: text/html, Size: 1627 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Xenomai-core] rtdm_iomap_to_user() with PowerPC
  2007-09-06  8:45 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
  2 siblings, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2007-09-06 21:32 UTC (permalink / raw)
  To: Markus Osterried (BA/EDD); +Cc: xenomai

[-- 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 --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Xenomai-core] rtdm_iomap_to_user() with PowerPC
  2007-09-06  8:45 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
  2 siblings, 0 replies; 9+ messages in thread
From: Johan Borkhuis @ 2007-09-07 12:51 UTC (permalink / raw)
  To: Markus Osterried (BA/EDD); +Cc: xenomai

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? Everyone else seen this problem?
>

I had the same problem, but I solved this by using 2 drivers, one linux 
driver that implemented mmap, and an RTDM driver for the realtime 
functions.  On startup I do the mmap, and then enter RT-mode and can use 
this mapped area in my RT-application. But it would be better if the 
mmap function would also be supported by Xenomai.

Kind regards,
    Johan Borkhuis


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Xenomai-core] rtdm_iomap_to_user() with PowerPC
  2007-09-06  8:45 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
  2 siblings, 0 replies; 9+ messages in thread
From: Philippe Gerum @ 2007-09-07 14:13 UTC (permalink / raw)
  To: Markus Osterried (BA/EDD); +Cc: xenomai

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.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Xenomai-core] rtdm_iomap_to_user() with PowerPC
@ 2007-11-07 14:28 Markus Osterried
  2007-11-07 14:45 ` Jan Kiszka
  0 siblings, 1 reply; 9+ messages in thread
From: Markus Osterried @ 2007-11-07 14:28 UTC (permalink / raw)
  To: xenomai

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

Hello,

two months ago I reported a problem with rtdm_iomap_to_user().
Philippe acknowledged the problem and promised to submit a bug fix.
Unfortunately, till now I don't have seen this bug fix, or have
overlooked it?
Can you please give me a hint about the roadmap?
Thanks.

Markus


[-- Attachment #2: Type: text/html, Size: 915 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Xenomai-core] rtdm_iomap_to_user() with PowerPC
  2007-11-07 14:28 [Xenomai-core] rtdm_iomap_to_user() with PowerPC Markus Osterried
@ 2007-11-07 14:45 ` Jan Kiszka
  2007-11-07 15:44   ` Markus Osterried
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Kiszka @ 2007-11-07 14:45 UTC (permalink / raw)
  To: Markus Osterried; +Cc: Xenomai-core

Markus Osterried wrote:
> Hello,
> 
> two months ago I reported a problem with rtdm_iomap_to_user().
> Philippe acknowledged the problem and promised to submit a bug fix.
> Unfortunately, till now I don't have seen this bug fix, or have
> overlooked it?

Please post your bugs to our bugtracker on gna.org if you feel like it
is getting/already got lost. Everyone is busy, and I'm afraid this
particular issue remained unfixed unintentionally.

> Can you please give me a hint about the roadmap?

This is surely a must-fix for both 2.4 and the next 2.3 releases, we are
only lacking the patch. Unless Philippe is able to come out with
something over the next, say, two days, I would suggest to develop a fix
along his original suggestions on your own. As far as I understood, we
need an arch-specific wrapper for io-remapping in
include/asm-powerps/wrappers.h and awareness for this specific solution
in asm-generic/wrappers.h.

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Xenomai-core] rtdm_iomap_to_user() with PowerPC
  2007-11-07 14:45 ` Jan Kiszka
@ 2007-11-07 15:44   ` Markus Osterried
  2007-11-07 16:08     ` Jan Kiszka
  0 siblings, 1 reply; 9+ messages in thread
From: Markus Osterried @ 2007-11-07 15:44 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Xenomai-core

Sorry for being intrusive.
I've already done a quick and dirty bug fix, so final bug fix is not
urgent.
Just wanted to know about time schedule.

Markus



-----Original Message-----
From: Jan Kiszka [mailto:jan.kiszka@domain.hid
Sent: Mittwoch, 7. November 2007 15:46
To: Markus Osterried
Cc: Philippe Gerum; Xenomai-core@domain.hid
Subject: Re: [Xenomai-core] rtdm_iomap_to_user() with PowerPC

Markus Osterried wrote:
> Hello,
> 
> two months ago I reported a problem with rtdm_iomap_to_user().
> Philippe acknowledged the problem and promised to submit a bug fix.
> Unfortunately, till now I don't have seen this bug fix, or have 
> overlooked it?

Please post your bugs to our bugtracker on gna.org if you feel like it
is getting/already got lost. Everyone is busy, and I'm afraid this
particular issue remained unfixed unintentionally.

> Can you please give me a hint about the roadmap?

This is surely a must-fix for both 2.4 and the next 2.3 releases, we are
only lacking the patch. Unless Philippe is able to come out with
something over the next, say, two days, I would suggest to develop a fix
along his original suggestions on your own. As far as I understood, we
need an arch-specific wrapper for io-remapping in
include/asm-powerps/wrappers.h and awareness for this specific solution
in asm-generic/wrappers.h.

Jan

--
Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center
Embedded Linux


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Xenomai-core] rtdm_iomap_to_user() with PowerPC
  2007-11-07 15:44   ` Markus Osterried
@ 2007-11-07 16:08     ` Jan Kiszka
  2007-11-08  8:51       ` Philippe Gerum
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Kiszka @ 2007-11-07 16:08 UTC (permalink / raw)
  To: Markus Osterried; +Cc: Xenomai-core

Markus Osterried wrote:
> Sorry for being intrusive.
> I've already done a quick and dirty bug fix, so final bug fix is not
> urgent.
> Just wanted to know about time schedule.

At least 2.4 is near, but I guess another 2.3 release will follow as
well (due to recently accumulated fixes). So the time is right to pick
this up again.

And although Philippe said he would fix this one on his own, this does
not have to mean no one else would be able to provide an equivalent fix
as well and he wouldn't be happy to save the otherwise required time... :)

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Xenomai-core] rtdm_iomap_to_user() with PowerPC
  2007-11-07 16:08     ` Jan Kiszka
@ 2007-11-08  8:51       ` Philippe Gerum
  0 siblings, 0 replies; 9+ messages in thread
From: Philippe Gerum @ 2007-11-08  8:51 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Markus Osterried, Xenomai-core

Jan Kiszka wrote:
> Markus Osterried wrote:
>> Sorry for being intrusive.
>> I've already done a quick and dirty bug fix, so final bug fix is not
>> urgent.
>> Just wanted to know about time schedule.
> 
> At least 2.4 is near, but I guess another 2.3 release will follow as
> well (due to recently accumulated fixes). So the time is right to pick
> this up again.
> 
> And although Philippe said he would fix this one on his own, this does
> not have to mean no one else would be able to provide an equivalent fix
> as well and he wouldn't be happy to save the otherwise required time... :)
> 

Indeed. Quite frankly, the bug report is patiently pending in my queue,
so it was not lost, but I just had no time to address this seriously.
Have everything converge to roll out 2.4 drains much of my Xenomai time,
so I tend to put the non-critical issues on the back burner for now,
especially if they might break things in subtle ways.
Since there is a work around for this issue, and the final fix may make
it to any stable branch once 2.4 is out, I've postponed the latter.

-- 
Philippe.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-11-08  8:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-07 14:28 [Xenomai-core] rtdm_iomap_to_user() with PowerPC 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
  -- strict thread matches above, loose matches on Subject: below --
2007-09-06  8:45 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 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.