lkml.org 
[lkml]   [2008]   [Apr]   [13]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateSun, 13 Apr 2008 01:41:58 -0700
From"Yinghai Lu" <>
SubjectRe: x86 git tree broken (bisected)
On Sun, Apr 13, 2008 at 1:24 AM, Yinghai Lu <yhlu.kernel@gmail.com> wrote:
>> On Fri, Apr 11, 2008 at 1:51 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>  >>  > On Friday, 11 of April 2008, Yinghai Lu wrote:>  >  > On Fri, Apr 11, 2008 at 12:26 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>  >  > > On Friday, 11 of April 2008, Rafael J. Wysocki wrote:
>  >  > >  > On Thursday, 10 of April 2008, Ingo Molnar wrote:>  >  > >  > >>  >  > >  > > * Ingo Molnar <mingo@elte.hu> wrote:
>  >  > >  > >
>  >  > >  > > > > > > First, the X server doesn't want to start (it says it couldn't
>  >  > >  > > > > > > mmap the framebuffer).>  >  > >  > > > > >>  >  > >  > > > > > could you send your .config?>  >  > >  > > > >>  >  > >  > > > > Attached.>  >  > >  > > >>  >  > >  > > > could you disable this option:>  >  > >  > > >>  >  > >  > > >  CONFIG_NONPROMISC_DEVMEM=y
>  >  > >  > > >
>  >  > >  > > > does it help with the X problem?>  >  > >  >>  >  > >  > That didn't help.>  >  > >  >>  >  > >  > > btw., Xorg works fine here on a comparable AMD system - but i use a
>  >  > >  > > rather new distro (Fedora 8) which has Xorg 7.2.>  >  > >  >>  >  > >  > My system is an OpenSUSE 10.3 and it has Xorg 7.2 as well.
>  >  > >  >>  >  > >  > I think the problem is somehow related to the Radeon.>  >  > >>  >  > >  The bisection turned up commit ea1441bdf53692c3dc1fd2658addcf1205629661
>  >  > >  "x86: use bus conf in NB conf fun1 to get bus range on, on 64-bit"  as the one
>  >  > >  causing problems.
>  >  > >
>  >  > >  Unfortunately, I can't revert cleanly it, because there are two more commits
>  >  > >  depending on it in a highly nontrivial fashion, so I have reverted all three
>  >  > >  commits
>  >  > >
>  >  > >  a365998cd2cecfb827469dbd57c29602c106cb83
>  >  > >  44f7f90fbe7a3a99aab082f765346514b7b5c705
>  >  > >  ea1441bdf53692c3dc1fd2658addcf1205629661
>  >  > >
>  >  > >  and X starts again.  Also, suspend to RAM works from under X.
>  >  >
>  >  > please keep the three patches and applied the two attached debug patches.
>  >  >
>  >  > i wonder if there is some io allocation overlapping with your system.>  >>  >  Attached is a boot dmesg output from the current x86 git tree with your two
>  >  patches applied.
>  >
>  can you try to apply the patch i sent to you about agp bridge order
>  reading for buggy silicon?
>
>  Please boot kernel with "debug"...
>
>  I want to verify if you can get
>
>  "
>  Aperture conflicts with PCI mapping.
>  "
>
>  in your boot log...
>

then with this patch for io allocation overlapping...

YH
[PATCH] x86_64: workaround io allocation overlapping for HT link

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

Index: linux-2.6/arch/x86/pci/k8-bus_64.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/k8-bus_64.c
+++ linux-2.6/arch/x86/pci/k8-bus_64.c
@@ -111,17 +111,25 @@ static void __init update_range(struct r
 	for (j = 0; j < RANGE_NUM; j++) {
 		if (!range[j].end)
 			continue;
-		if (start == range[j].start && end < range[j].end) {
-			range[j].start = end + 1;
-			break;
-		} else if (start == range[j].start && end == range[j].end) {
+
+		if (start <= range[j].start && end >= range[j].end) {
 			range[j].start = 0;
 			range[j].end = 0;
-			break;
-		} else if (start > range[j].start && end == range[j].end) {
+			continue;
+		}
+
+		if (start <= range[j].start && end < range[j].end && range[j].start < end + 1) {
+			range[j].start = end + 1;
+			continue;
+		}
+
+
+		if (start > range[j].start && end >= range[j].end && range[j].end > start - 1) {
 			range[j].end = start - 1;
-			break;
-		} else if (start > range[j].start && end < range[j].end) {
+			continue;
+		}
+
+		if (start > range[j].start && end < range[j].end) {
 			/* find the new spare */
 			for (i = 0; i < RANGE_NUM; i++) {
 				if (range[i].end == 0)
@@ -134,7 +142,7 @@ static void __init update_range(struct r
 				printk(KERN_ERR "run of slot in ranges\n");
 			}
 			range[j].end = start - 1;
-			break;
+			continue;
 		}
 	}
 }
@@ -150,16 +158,24 @@ static void __init update_res(struct pci
 
 	/* try to merge it with old one */
 	for (i = 0; i < info->res_num; i++) {
+		size_t final_start, final_end;
+		size_t common_start, common_end;
+
 		res = &info->res[i];
 		if (res->flags != flags)
 			continue;
-		if (res->end + 1 == start) {
-			res->end = end;
-			return;
-		} else if (end + 1 == res->start) {
-			res->start = start;
-			return;
-		}
+
+		common_start = max((size_t)res->start, start);
+		common_end = min((size_t)res->end, end);
+		if (common_start > common_end + 1)
+			continue;
+
+		final_start = min((size_t)res->start, start);
+		final_end = max((size_t)res->end, end);
+
+		res->start = final_start;
+		res->end = final_end;
+		return;
 	}
 
 addit:
@@ -335,7 +351,11 @@ static int __init early_fill_mp_bus_info
 		info = &pci_root_info[j];
 		printk(KERN_DEBUG "node %d link %d: io port [%llx, %llx]\n",
 		       node, link, (u64)start, (u64)end);
-		update_res(info, start, end, IORESOURCE_IO, 0);
+
+		/* kernel only handle 16 bit only */
+		if (end > 0xffff)
+			end = 0xffff;
+		update_res(info, start, end, IORESOURCE_IO, 1);
 		update_range(range, start, end);
 	}
 	/* add left over io port range to def node/link, [0, 0xffff] */
@@ -443,7 +463,7 @@ static int __init early_fill_mp_bus_info
 			}
 		}
 
-		update_res(info, start, end, IORESOURCE_MEM, 0);
+		update_res(info, start, end, IORESOURCE_MEM, 1);
 		update_range(range, start, end);
 		printk(KERN_CONT "\n");
 	}
\
 
 \ /
  Last update: 2008-04-13 10:45    [from the cache]
©2003-2008