Skip to contentSkip to conversation

iounmap() - can't always unmap memory I've mappedt

DISCUSSION Alan Cox 2 participants 2 messages Sep 29, 2000 1 message not in the archive Memory management

lore
Share & tools
lore

Alan Cox

author
#1 lore raw
In reply to a message not in the archive
Quoted 7 lines

"num_pages" is usually just equal to 1. This code appears to work very well. However, when I call the iounmap function on the memory obtained via ioremap_nocache, sometimes I hit a kernel BUG(). The code which causes the bug is in page_alloc.c, line 85 (in function __free_pages_ok):

	if (page->buffers)
		BUG();

This sounds like you are trying to do maps on pages that are in use. No can do

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

#2 lore raw

** Reply to message from Alan Cox <[email protected]> on Fri, 29 Sep 2000 23:00:16 +0100 (BST)

Quoted 9 lines
Quoted 7 lines

"num_pages" is usually just equal to 1. This code appears to work very well. However, when I call the iounmap function on the memory obtained via ioremap_nocache, sometimes I hit a kernel BUG(). The code which causes the bug is in page_alloc.c, line 85 (in function __free_pages_ok):

	if (page->buffers)
		BUG();

This sounds like you are trying to do maps on pages that are in use. No can do

Why not? I mean, I can access the memory anyway from the driver, since it's all mapped linearly via phys_to_virt. All I'm really doing is creating a temporary alias.

Unfortunately, this mapping is a requirement for our product. I'd hate to have to create my own pte's and do it all manually.

What confuses me is what ioremap_nocache() doesn't fail. Why are these tests (e.g. page->buffers) not in ioremap_nocache()?

Signature · 8 lines
Timur Tabi - [email protected]
Interactive Silicon - http://www.interactivesi.com

When replying to a mailing-list message, please don't cc: me, because then I'll just get two copies of the same message.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/