From: Lance Spaulding <lsjunk1@cableone.net>
To: linux-kernel@vger.kernel.org
Subject: mmap() on 2.6
Date: Wed, 01 Dec 2004 18:08:31 -0700 [thread overview]
Message-ID: <41AE6B0F.3000804@cableone.net> (raw)
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
reply other threads:[~2004-12-02 4:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=41AE6B0F.3000804@cableone.net \
--to=lsjunk1@cableone.net \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox