public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	Frans Pop <elendil@planet.nl>, Eric Anholt <eric@anholt.net>,
	nix.or.die@googlemail.com, linux-kernel@vger.kernel.org,
	rjw@sisk.pl, Yinghai Lu <yinghai@kernel.org>
Subject: Re: Linux 2.6.28-rc8
Date: Sat, 13 Dec 2008 09:15:27 -0800	[thread overview]
Message-ID: <20081213091527.6f8efbc7@infradead.org> (raw)
In-Reply-To: <alpine.LFD.2.00.0812120808200.3340@localhost.localdomain>

On Fri, 12 Dec 2008 08:11:35 -0800 (PST)
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> 
> 
> On Fri, 12 Dec 2008, Arjan van de Ven wrote:
> > 
> > another thing we could do is try to only warn if you cross bar
> > boundaries but not if you cross other user-of-the-resource
> > boundaries.
> 
> Hmm. We could use the res->flags for this. But I'm not sure non-PCI 
> resources fill those in correctly.
> 
> A pure "busy" allocation (ie a driver marker) would generally have
> just the IORESOURCE_BUSY bit set, while a real PCI hardware resource
> will have other bits set (ie the IORESOURCE_IO/MEM bits) and not be
> marked BUSY.
> 
> Maybe just ignoring resources with BUSY set, as they are driver
> markers rather than actual HW resources.

something like this: ?

From: Arjan van de Ven <arjan@linux.intel.com>
Date: Sat, 13 Dec 2008 09:12:18 -0800
Subject: [PATCH] resource: Don't warn for driver originated resource structures

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>
---
 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,
-- 
1.6.0.4



-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

  reply	other threads:[~2008-12-13 17:14 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-11  1:04 Linux 2.6.28-rc8 Linus Torvalds
2008-12-11  2:37 ` Gabriel C
2008-12-11  7:19   ` Eric Anholt
2008-12-11 16:07     ` Frans Pop
2008-12-11 16:22       ` Linus Torvalds
2008-12-11 16:35         ` Ingo Molnar
2008-12-11 17:05           ` Linus Torvalds
2008-12-11 20:36             ` Ingo Molnar
2008-12-11 20:46               ` Pekka Enberg
2008-12-11 21:34                 ` Suresh Siddha
2008-12-12  8:24                 ` Ingo Molnar
2008-12-12 15:57                   ` Arjan van de Ven
2008-12-12 16:11                     ` Linus Torvalds
2008-12-13 17:15                       ` Arjan van de Ven [this message]
2008-12-16 22:34                         ` Ingo Molnar
2008-12-11  5:09 ` Arjan van de Ven
2008-12-11  7:57 ` Nick Piggin
2008-12-11  8:07   ` Andrew Morton
2008-12-11  8:45     ` Nick Piggin
2008-12-12  3:02       ` Andrew Morton
2008-12-12  3:07         ` Nick Piggin
2008-12-12  3:39           ` Andrew Morton
2008-12-11  8:06 ` Willy Tarreau
2008-12-11  8:40 ` Joerg Roedel
2008-12-11 22:57   ` Theodore Tso
2008-12-11 23:12     ` Mike Travis
2008-12-11  9:26 ` Jean Delvare
2008-12-11 10:38 ` Frederik Deweerdt
2008-12-11 16:59   ` Andrew Morton
2008-12-11 13:00 ` Sam Ravnborg
2008-12-11 13:23   ` Paolo Ciarrocchi
2008-12-11 13:44 ` Alexey Zaytsev
2008-12-11 13:48 ` Ingo Molnar
2008-12-11 15:20 ` Pavel Machek
2008-12-11 15:29 ` David Howells
2008-12-12  3:19   ` David Miller
2008-12-12  5:40     ` Linus Torvalds
2008-12-12  7:54       ` Joerg Roedel
2008-12-12 15:48     ` Alan Cox
2008-12-11 20:12 ` Rafael J. Wysocki

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=20081213091527.6f8efbc7@infradead.org \
    --to=arjan@infradead.org \
    --cc=elendil@planet.nl \
    --cc=eric@anholt.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nix.or.die@googlemail.com \
    --cc=penberg@cs.helsinki.fi \
    --cc=rjw@sisk.pl \
    --cc=torvalds@linux-foundation.org \
    --cc=yinghai@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