LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Jonathan Corbet <corbet@lwn.net>
Cc: Yinghai Lu <yinghai@kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Robert Hancock <hancockr@shaw.ca>,
	e1000-devel@lists.sourceforge.net,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: 2.6.28-rc2 hates my e1000e
Date: Fri, 31 Oct 2008 09:24:40 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.00.0810310916050.21084@nehalem.linux-foundation.org> (raw)
In-Reply-To: <20081031100040.1f0cf34f@bike.lwn.net>



On Fri, 31 Oct 2008, Jonathan Corbet wrote:
> 
> Things change a bit with this patch, but the e1000e still fails to
> initialize:

Ahahhh! My bad. I think this was actually discussed back when the whole 
reserved-memory-handling thing was being worked on, but it got ignored 
because none of the developers actually ever had any machines with this 
issue, and the whole (and only) reason for the change was some odd sound 
card initialization issue if I recall correctly.

The problem (I think) is that the e820 resource handling doesn't insert 
the resources as some kind of magic PCI resource, but it inserts them as a 
"I am a driver, and I actively _use_ this resource".

Which means that it all ends up being very busy, and then when a PCI 
driver says "I now want to use this", you get EBUSY.

Does this patch work for you?

A resource doesn't have to be busy for the resource allocator to try to 
avoid it, so the only thing that BUSY bit does is to not allow people who 
_do_ want to use the resources they know about from using them.

So we should mark the resources busy only if we _really_ use them (like 
the kernel *RAM* resources).

Oh, and this time the patch even compiles. It includes the previous 
change, obviously.

Btw, this shows another (unrelated) issue: the BUSY bit (along with 
various other resource flags) doesn't show up in /proc/iomem, so these 
kinds of issues end up being debugged totally "blind". Not good.

		Linus

---
 arch/x86/kernel/e820.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index ce97bf3..7aafeb5 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1290,15 +1290,17 @@ void __init e820_reserve_resources(void)
 		res->start = e820.map[i].addr;
 		res->end = end;
 
-		res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+		res->flags = IORESOURCE_MEM;
 
 		/*
 		 * don't register the region that could be conflicted with
 		 * pci device BAR resource and insert them later in
 		 * pcibios_resource_survey()
 		 */
-		if (e820.map[i].type != E820_RESERVED || res->start < (1ULL<<20))
+		if (e820.map[i].type != E820_RESERVED || res->start < (1ULL<<20)) {
+			res->flags |= IORESOURCE_BUSY;
 			insert_resource(&iomem_resource, res);
+		}
 		res++;
 	}
 
@@ -1318,7 +1320,7 @@ void __init e820_reserve_resources_late(void)
 	res = e820_res;
 	for (i = 0; i < e820.nr_map; i++) {
 		if (!res->parent && res->end)
-			reserve_region_with_split(&iomem_resource, res->start, res->end, res->name);
+			insert_resource_expand_to_fit(&iomem_resource, res);
 		res++;
 	}
 }

  reply	other threads:[~2008-10-31 16:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.P5jmIAOhSJ192sfWD+qlec07fe8@ifi.uio.no>
2008-10-31  0:45 ` Robert Hancock
2008-10-31  2:58   ` Jonathan Corbet
2008-10-31  4:08     ` Yinghai Lu
2008-10-31 15:07       ` Linus Torvalds
2008-10-31 15:44         ` Linus Torvalds
2008-10-31 16:00           ` Jonathan Corbet
2008-10-31 16:24             ` Linus Torvalds [this message]
2008-10-31 16:35               ` Yinghai Lu
2008-10-31 16:46                 ` Linus Torvalds
2008-10-31 16:51               ` Jonathan Corbet
2008-10-31 16:58                 ` Linus Torvalds
2008-10-31 20:20                   ` Yinghai Lu
2008-11-01 15:01                   ` Jonathan Corbet
2008-11-01 17:16                     ` Linus Torvalds
2008-11-01 17:35                       ` Steven Rostedt
2008-11-01 19:50                       ` Yinghai Lu
2008-11-01 22:45                         ` Jonathan Corbet
2008-11-01 22:47                           ` Yinghai Lu
2008-11-01 23:18                           ` Linus Torvalds
2008-11-02  1:26                             ` Robert Hancock
2008-10-30 23:44 Jonathan Corbet

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=alpine.LFD.2.00.0810310916050.21084@nehalem.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=hancockr@shaw.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=yinghai@kernel.org \
    --subject='Re: 2.6.28-rc2 hates my e1000e' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).