Commit c23a4e96 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds
Browse files

[PATCH] iounmap debugging

We get sporadic reports of `__iounmap: bad address' coming out.  Add a
dump_stack() to find the culprit.

Try to identify which subsystem is having iounmap() problems.
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent eda80228
...@@ -228,7 +228,8 @@ EXPORT_SYMBOL(ioremap_nocache); ...@@ -228,7 +228,8 @@ EXPORT_SYMBOL(ioremap_nocache);
void iounmap(volatile void __iomem *addr) void iounmap(volatile void __iomem *addr)
{ {
struct vm_struct *p; struct vm_struct *p;
if ((void __force *) addr <= high_memory)
if ((void __force *)addr <= high_memory)
return; return;
/* /*
...@@ -241,9 +242,10 @@ void iounmap(volatile void __iomem *addr) ...@@ -241,9 +242,10 @@ void iounmap(volatile void __iomem *addr)
return; return;
write_lock(&vmlist_lock); write_lock(&vmlist_lock);
p = __remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr)); p = __remove_vm_area((void *)(PAGE_MASK & (unsigned long __force)addr));
if (!p) { if (!p) {
printk(KERN_WARNING "iounmap: bad address %p\n", addr); printk(KERN_WARNING "iounmap: bad address %p\n", addr);
goto out_unlock; goto out_unlock;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment