Re: Linux 2.6.28-rc8

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ingo Molnar
Date: Tuesday, December 16, 2008 - 3:34 pm

* Arjan van de Ven <arjan@infradead.org> wrote:


okay, i've applied it in the form below, to tip/core/resources. This in 
combination with the toning down of the messages should do the trick i 
think.

btw., here's a bug that got caught by the sanity checks:

| commit d522af581c6abd0e064278345ca638b0553a93fa
| Author: Suresh Siddha <suresh.b.siddha@intel.com>
| Date:   Mon Oct 20 17:57:02 2008 -0300
|
|     V4L/DVB (9356): [PATCH] saa7134: fix resource map sanity check conflict
|    
|     Impact: driver could possibly stomp on resources outside of its scope

so it's not just nuisance.


it will be much more likely to be caught via other misbehavior i guess. 

	Ingo

------------------>
From 3ac52669c7a24b93663acfcab606d1065ed1accd Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Sat, 13 Dec 2008 09:15:27 -0800
Subject: [PATCH] resources: skip sanity check of busy resources

Impact: reduce false positives in iomem_map_sanity_check()

Some drivers (vesafb) only map/reserve a portion of a resource.
If then some other driver comes in and maps the whole resource,
the current code WARN_ON's. This is not the intent of the checks
in iomem_map_sanity_check(); rather these checks want to
warn when crossing *hardware* resources only.

This patch skips BUSY resources as suggested by Linus.

Note: having two drivers talk to the same hardware at the same
time is obviously not optimal behavior, but that's a separate story.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/resource.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/kernel/resource.c b/kernel/resource.c
index 4337063..e633106 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -853,6 +853,15 @@ int iomem_map_sanity_check(resource_size_t addr, unsigned long size)
 		if (PFN_DOWN(p->start) <= PFN_DOWN(addr) &&
 		    PFN_DOWN(p->end) >= PFN_DOWN(addr + size - 1))
 			continue;
+		/*
+		 * if a resource is "BUSY", it's not a hardware resource
+		 * but a driver mapping of such a resource; we don't want
+		 * to warn for those; some drivers legitimately map only
+		 * partial hardware resources. (example: vesafb)
+		 */
+		if (p->flags & IORESOURCE_BUSY)
+			continue;
+
 		printk(KERN_WARNING "resource map sanity check conflict: "
 		       "0x%llx 0x%llx 0x%llx 0x%llx %s\n",
 		       (unsigned long long)addr,
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Linux 2.6.28-rc8, Linus Torvalds, (Wed Dec 10, 6:04 pm)
Re: Linux 2.6.28-rc8, Gabriel C, (Wed Dec 10, 7:37 pm)
Re: Linux 2.6.28-rc8, Arjan van de Ven, (Wed Dec 10, 10:09 pm)
Re: Linux 2.6.28-rc8, Eric Anholt, (Thu Dec 11, 12:19 am)
Re: Linux 2.6.28-rc8, Nick Piggin, (Thu Dec 11, 12:57 am)
Re: Linux 2.6.28-rc8, Willy Tarreau, (Thu Dec 11, 1:06 am)
Re: Linux 2.6.28-rc8, Andrew Morton, (Thu Dec 11, 1:07 am)
Re: Linux 2.6.28-rc8, Joerg Roedel, (Thu Dec 11, 1:40 am)
Re: Linux 2.6.28-rc8, Nick Piggin, (Thu Dec 11, 1:45 am)
Re: Linux 2.6.28-rc8, Jean Delvare, (Thu Dec 11, 2:26 am)
Re: Linux 2.6.28-rc8, Frederik Deweerdt, (Thu Dec 11, 3:38 am)
Re: Linux 2.6.28-rc8, Sam Ravnborg, (Thu Dec 11, 6:00 am)
Re: Linux 2.6.28-rc8, Paolo Ciarrocchi, (Thu Dec 11, 6:23 am)
Re: Linux 2.6.28-rc8, Alexey Zaytsev, (Thu Dec 11, 6:44 am)
Re: Linux 2.6.28-rc8, Ingo Molnar, (Thu Dec 11, 6:48 am)
Re: Linux 2.6.28-rc8, Pavel Machek, (Thu Dec 11, 8:20 am)
Re: Linux 2.6.28-rc8, David Howells, (Thu Dec 11, 8:29 am)
Re: Linux 2.6.28-rc8, Frans Pop, (Thu Dec 11, 9:07 am)
Re: Linux 2.6.28-rc8, Linus Torvalds, (Thu Dec 11, 9:22 am)
Re: Linux 2.6.28-rc8, Ingo Molnar, (Thu Dec 11, 9:35 am)
Re: Linux 2.6.28-rc8, Andrew Morton, (Thu Dec 11, 9:59 am)
Re: Linux 2.6.28-rc8, Linus Torvalds, (Thu Dec 11, 10:05 am)
Re: Linux 2.6.28-rc8, Rafael J. Wysocki, (Thu Dec 11, 1:12 pm)
Re: Linux 2.6.28-rc8, Ingo Molnar, (Thu Dec 11, 1:36 pm)
Re: Linux 2.6.28-rc8, Pekka Enberg, (Thu Dec 11, 1:46 pm)
Re: Linux 2.6.28-rc8, Suresh Siddha, (Thu Dec 11, 2:34 pm)
Re: Linux 2.6.28-rc8, Theodore Tso, (Thu Dec 11, 3:57 pm)
Re: Linux 2.6.28-rc8, Mike Travis, (Thu Dec 11, 4:12 pm)
Re: Linux 2.6.28-rc8, Andrew Morton, (Thu Dec 11, 8:02 pm)
Re: Linux 2.6.28-rc8, Nick Piggin, (Thu Dec 11, 8:07 pm)
Re: Linux 2.6.28-rc8, David Miller, (Thu Dec 11, 8:19 pm)
Re: Linux 2.6.28-rc8, Andrew Morton, (Thu Dec 11, 8:39 pm)
Re: Linux 2.6.28-rc8, Linus Torvalds, (Thu Dec 11, 10:40 pm)
Re: Linux 2.6.28-rc8, Joerg Roedel, (Fri Dec 12, 12:54 am)
Re: Linux 2.6.28-rc8, Ingo Molnar, (Fri Dec 12, 1:24 am)
Re: Linux 2.6.28-rc8, Alan Cox, (Fri Dec 12, 8:48 am)
Re: Linux 2.6.28-rc8, Arjan van de Ven, (Fri Dec 12, 8:57 am)
Re: Linux 2.6.28-rc8, Linus Torvalds, (Fri Dec 12, 9:11 am)
Re: Linux 2.6.28-rc8, Arjan van de Ven, (Sat Dec 13, 10:15 am)
Re: Linux 2.6.28-rc8, Ingo Molnar, (Tue Dec 16, 3:34 pm)