* mmap() on 2.6
@ 2004-12-02 1:08 Lance Spaulding
0 siblings, 0 replies; only message in thread
From: Lance Spaulding @ 2004-12-02 1:08 UTC (permalink / raw)
To: linux-kernel
I'm trying to port one of my drivers from 2.4 to 2.6 and am having
problems getting mmap() to work. The driver works fine in 2.4 but hangs
on 2.6 (using the same machine).
What I'm doing is setting aside 40 Meg of memory so I can use a 32 meg
buffer for DMAs from a custom ASIC. I need to be able to acccess this
memory both from kernel and user space.
To do this, I do the following steps:
- In grub.conf, I use "mem=472m"
- In my driver, I do an ioremap(0x1d800000, 0x02000000) to get a kernel
pointer to the memory. This part works fine.
- In myapp, I call mmap(0, 0x02000000, (PROT_READ | PROT_WRITE),
(MAP_SHARED | MAP_LOCKED), fd, (uint32)0x1d800000)
- In my driver's mmap() function, I do the following:
vma->vm_flags|=(VM_RESERVED | VM_IO | VM_LOCKED | VM_SHM);
remap_page_range(vma, vma->vm_start, offset,
vma->vm_end-vma->vm_start, vma->vm_page_prot)
which ends up being:
remap_page_range(0xDC3C7078, 0xB7257000, 0x1D800000, 0xC00000, 0x27)
This remap call works fine and my driver then tries to return 0 but at
that point, the thread appears completely locked up. I'm never getting
control back to the calling app. I can switch virtual consoles and run
other commands just fine.
Can anyone tell me what I'm doing wrong and what I need to change for
2.6? This part of the driver has always worked fine on 2.4.
Thanks in advance,
Lance
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-12-02 4:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-02 1:08 mmap() on 2.6 Lance Spaulding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox