All of lore.kernel.org
 help / color / mirror / Atom feed
* Memory trample when using /dev/mem
@ 2014-10-11  8:51 Hu Keping
  2014-10-11  9:04 ` Richard Weinberger
  0 siblings, 1 reply; 2+ messages in thread
From: Hu Keping @ 2014-10-11  8:51 UTC (permalink / raw)
  To: arnd, gregkh; +Cc: linux-kernel, sdu.liu, wangnan0, peifeiyue

Hi there,

Recently, I run a little testcase about using mmap to check
some physical address.What I found was that the different task can
read and write the same physical address at the same time.

For example,
I make proc1 to access 0x20000000, read and write "512" to
that address every 2 seconds. Meanwhile,I make proc2 to access
0x200000000, read and write "1024" to that address every 1 seconds.
The output is a mess, though it needs not be worry on this case,
but what about the proc1 and proc2 are both driver, and they mmap to the
same physical address?

As there are many drivers using /dev/mem and we can not
make sure that the different task will not trample on
each others memory.Shall we add some printk to help locating the problem
when error happened?


Thanks,
Hu Keping


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

* Re: Memory trample when using /dev/mem
  2014-10-11  8:51 Memory trample when using /dev/mem Hu Keping
@ 2014-10-11  9:04 ` Richard Weinberger
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Weinberger @ 2014-10-11  9:04 UTC (permalink / raw)
  To: Hu Keping; +Cc: Arnd Bergmann, Greg KH, LKML, sdu.liu, wangnan0, peifeiyue

On Sat, Oct 11, 2014 at 10:51 AM, Hu Keping <hukeping@huawei.com> wrote:
> As there are many drivers using /dev/mem and we can not
> make sure that the different task will not trample on
> each others memory.Shall we add some printk to help locating the problem
> when error happened?

Actually no driver should use /dev/mem.
Please have a look at UIO.

-- 
Thanks,
//richard

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

end of thread, other threads:[~2014-10-11  9:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-11  8:51 Memory trample when using /dev/mem Hu Keping
2014-10-11  9:04 ` Richard Weinberger

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.