linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] x86/pci: intel ioh bus num reg accessing fix
       [not found] <4B2BE063.4040704@kernel.org>
@ 2009-12-18 20:09 ` Yinghai Lu
  2009-12-18 20:09 ` [PATCH 2/7] x86/pci: use resource_size_t in update_res -v2 Yinghai Lu
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Yinghai Lu @ 2009-12-18 20:09 UTC (permalink / raw)
  To: Jesse Barnes, Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: linux-kernel, linux-pci



it is above 0x100, so if mmconf is not enable, need to skip it

Reported-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/pci/intel_bus.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux-2.6/arch/x86/pci/intel_bus.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/intel_bus.c
+++ linux-2.6/arch/x86/pci/intel_bus.c
@@ -49,6 +49,10 @@ static void __devinit pci_root_bus_res(s
 	u64 mmioh_base, mmioh_end;
 	int bus_base, bus_end;
 
+	/* some sys doesn't get mmconf enabled */
+	if (dev->cfg_size < 0x200)
+		return;
+
 	if (pci_root_num >= PCI_ROOT_NR) {
 		printk(KERN_DEBUG "intel_bus.c: PCI_ROOT_NR is too small\n");
 		return;


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 2/7] x86/pci: use resource_size_t in update_res -v2
       [not found] <4B2BE063.4040704@kernel.org>
  2009-12-18 20:09 ` [PATCH 1/7] x86/pci: intel ioh bus num reg accessing fix Yinghai Lu
@ 2009-12-18 20:09 ` Yinghai Lu
  2010-01-15 19:49   ` Jesse Barnes
  2009-12-18 20:09 ` [PATCH 3/7] x86/pci: amd one chain system to use pci read out res Yinghai Lu
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: Yinghai Lu @ 2009-12-18 20:09 UTC (permalink / raw)
  To: Jesse Barnes, Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: linux-kernel, linux-pci



prepare to enable 32bit intel and amd bus

v2: change __init to __devinit

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 arch/x86/pci/bus_numa.c |   16 ++++++++--------
 arch/x86/pci/bus_numa.h |    4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

Index: linux-2.6/arch/x86/pci/bus_numa.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/bus_numa.c
+++ linux-2.6/arch/x86/pci/bus_numa.c
@@ -51,8 +51,8 @@ void x86_pci_root_bus_res_quirks(struct
 	}
 }
 
-void __devinit update_res(struct pci_root_info *info, size_t start,
-			      size_t end, unsigned long flags, int merge)
+void __devinit update_res(struct pci_root_info *info, resource_size_t start,
+			  resource_size_t end, unsigned long flags, int merge)
 {
 	int i;
 	struct resource *res;
@@ -65,20 +65,20 @@ void __devinit update_res(struct pci_roo
 
 	/* 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;
+		resource_size_t final_start, final_end;
+		resource_size_t common_start, common_end;
 
 		res = &info->res[i];
 		if (res->flags != flags)
 			continue;
 
-		common_start = max((size_t)res->start, start);
-		common_end = min((size_t)res->end, end);
+		common_start = max(res->start, start);
+		common_end = min(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);
+		final_start = min(res->start, start);
+		final_end = max(res->end, end);
 
 		res->start = final_start;
 		res->end = final_end;
Index: linux-2.6/arch/x86/pci/bus_numa.h
===================================================================
--- linux-2.6.orig/arch/x86/pci/bus_numa.h
+++ linux-2.6/arch/x86/pci/bus_numa.h
@@ -22,6 +22,6 @@ extern int pci_root_num;
 extern struct pci_root_info pci_root_info[PCI_ROOT_NR];
 extern int found_all_numa_early;
 
-extern void update_res(struct pci_root_info *info, size_t start,
-			      size_t end, unsigned long flags, int merge);
+extern void update_res(struct pci_root_info *info, resource_size_t start,
+		      resource_size_t end, unsigned long flags, int merge);
 #endif


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 3/7] x86/pci: amd one chain system to use pci read out res
       [not found] <4B2BE063.4040704@kernel.org>
  2009-12-18 20:09 ` [PATCH 1/7] x86/pci: intel ioh bus num reg accessing fix Yinghai Lu
  2009-12-18 20:09 ` [PATCH 2/7] x86/pci: use resource_size_t in update_res -v2 Yinghai Lu
@ 2009-12-18 20:09 ` Yinghai Lu
  2009-12-18 20:09 ` [PATCH 4/7] x86/pci: use u64 instead of size_t in amd_bus.c -v2 Yinghai Lu
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Yinghai Lu @ 2009-12-18 20:09 UTC (permalink / raw)
  To: Jesse Barnes, Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: linux-kernel, linux-pci


found MSI amd k8 based laptops is hiding [0x70000000, 0x80000000) RAM from
e820.

enable amd one chain even for all.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/pci/amd_bus.c  |    7 ++++---
 arch/x86/pci/bus_numa.c |    5 -----
 arch/x86/pci/bus_numa.h |    1 -
 3 files changed, 4 insertions(+), 9 deletions(-)

Index: linux-2.6/arch/x86/pci/amd_bus.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/amd_bus.c
+++ linux-2.6/arch/x86/pci/amd_bus.c
@@ -87,11 +87,12 @@ static int __init early_fill_mp_bus_info
 	struct range range[RANGE_NUM];
 	u64 val;
 	u32 address;
+	int found;
 
 	if (!early_pci_allowed())
 		return -1;
 
-	found_all_numa_early = 0;
+	found = 0;
 	for (i = 0; i < ARRAY_SIZE(pci_probes); i++) {
 		u32 id;
 		u16 device;
@@ -105,12 +106,12 @@ static int __init early_fill_mp_bus_info
 		device = (id>>16) & 0xffff;
 		if (pci_probes[i].vendor == vendor &&
 		    pci_probes[i].device == device) {
-			found_all_numa_early = 1;
+			found = 1;
 			break;
 		}
 	}
 
-	if (!found_all_numa_early)
+	if (!found)
 		return 0;
 
 	pci_root_num = 0;
Index: linux-2.6/arch/x86/pci/bus_numa.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/bus_numa.c
+++ linux-2.6/arch/x86/pci/bus_numa.c
@@ -5,7 +5,6 @@
 
 int pci_root_num;
 struct pci_root_info pci_root_info[PCI_ROOT_NR];
-int found_all_numa_early;
 
 void x86_pci_root_bus_res_quirks(struct pci_bus *b)
 {
@@ -21,10 +20,6 @@ void x86_pci_root_bus_res_quirks(struct
 	if (!pci_root_num)
 		return;
 
-	/* for amd, if only one root bus, don't need to do anything */
-	if (pci_root_num < 2 && found_all_numa_early)
-		return;
-
 	for (i = 0; i < pci_root_num; i++) {
 		if (pci_root_info[i].bus_min == b->number)
 			break;
Index: linux-2.6/arch/x86/pci/bus_numa.h
===================================================================
--- linux-2.6.orig/arch/x86/pci/bus_numa.h
+++ linux-2.6/arch/x86/pci/bus_numa.h
@@ -20,7 +20,6 @@ struct pci_root_info {
 #define PCI_ROOT_NR 4
 extern int pci_root_num;
 extern struct pci_root_info pci_root_info[PCI_ROOT_NR];
-extern int found_all_numa_early;
 
 extern void update_res(struct pci_root_info *info, resource_size_t start,
 		      resource_size_t end, unsigned long flags, int merge);


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 4/7] x86/pci: use u64 instead of size_t in amd_bus.c -v2
       [not found] <4B2BE063.4040704@kernel.org>
                   ` (2 preceding siblings ...)
  2009-12-18 20:09 ` [PATCH 3/7] x86/pci: amd one chain system to use pci read out res Yinghai Lu
@ 2009-12-18 20:09 ` Yinghai Lu
  2010-01-15 19:49   ` Jesse Barnes
  2009-12-18 20:09 ` [PATCH 5/7] x86/pci: add cap_resource -v2 Yinghai Lu
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: Yinghai Lu @ 2009-12-18 20:09 UTC (permalink / raw)
  To: Jesse Barnes, Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: linux-kernel, linux-pci


prepare to enable it for 32bit

-v2: remove not needed cast

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/pci/amd_bus.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Index: linux-2.6/arch/x86/pci/amd_bus.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/amd_bus.c
+++ linux-2.6/arch/x86/pci/amd_bus.c
@@ -82,8 +82,8 @@ static int __init early_fill_mp_bus_info
 	struct pci_root_info *info;
 	u32 reg;
 	struct resource *res;
-	size_t start;
-	size_t end;
+	u64 start;
+	u64 end;
 	struct range range[RANGE_NUM];
 	u64 val;
 	u32 address;
@@ -173,7 +173,7 @@ 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);
+		       node, link, start, end);
 
 		/* kernel only handle 16 bit only */
 		if (end > 0xffff)
@@ -207,7 +207,7 @@ static int __init early_fill_mp_bus_info
 	address = MSR_K8_TOP_MEM1;
 	rdmsrl(address, val);
 	end = (val & 0xffffff800000ULL);
-	printk(KERN_INFO "TOM: %016lx aka %ldM\n", end, end>>20);
+	printk(KERN_INFO "TOM: %016llx aka %lldM\n", end, end>>20);
 	if (end < (1ULL<<32))
 		subtract_range(range, RANGE_NUM, 0, end - 1);
 
@@ -246,7 +246,7 @@ static int __init early_fill_mp_bus_info
 		info = &pci_root_info[j];
 
 		printk(KERN_DEBUG "node %d link %d: mmio [%llx, %llx]",
-		       node, link, (u64)start, (u64)end);
+		       node, link, start, end);
 		/*
 		 * some sick allocation would have range overlap with fam10h
 		 * mmconf range, so need to update start and end.
@@ -272,13 +272,13 @@ static int __init early_fill_mp_bus_info
 				endx = fam10h_mmconf_start - 1;
 				update_res(info, start, endx, IORESOURCE_MEM, 0);
 				subtract_range(range, RANGE_NUM, start, endx);
-				printk(KERN_CONT " ==> [%llx, %llx]", (u64)start, endx);
+				printk(KERN_CONT " ==> [%llx, %llx]", start, endx);
 				start = fam10h_mmconf_end + 1;
 				changed = 1;
 			}
 			if (changed) {
 				if (start <= end) {
-					printk(KERN_CONT " %s [%llx, %llx]", endx?"and":"==>", (u64)start, (u64)end);
+					printk(KERN_CONT " %s [%llx, %llx]", endx?"and":"==>", start, end);
 				} else {
 					printk(KERN_CONT "%s\n", endx?"":" ==> none");
 					continue;
@@ -301,7 +301,7 @@ static int __init early_fill_mp_bus_info
 		address = MSR_K8_TOP_MEM2;
 		rdmsrl(address, val);
 		end = (val & 0xffffff800000ULL);
-		printk(KERN_INFO "TOM2: %016lx aka %ldM\n", end, end>>20);
+		printk(KERN_INFO "TOM2: %016llx aka %lldM\n", end, end>>20);
 		subtract_range(range, RANGE_NUM, 1ULL<<32, end - 1);
 	}
 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 5/7] x86/pci: add cap_resource -v2
       [not found] <4B2BE063.4040704@kernel.org>
                   ` (3 preceding siblings ...)
  2009-12-18 20:09 ` [PATCH 4/7] x86/pci: use u64 instead of size_t in amd_bus.c -v2 Yinghai Lu
@ 2009-12-18 20:09 ` Yinghai Lu
  2009-12-18 20:09 ` [PATCH 6/7] x86/pci: enable pci root res read out for 32bit too -v3 Yinghai Lu
  2009-12-18 20:09 ` [PATCH 7/7] x86/pci: don't check mmconf again if it is from MSR with amd faml0h Yinghai Lu
  6 siblings, 0 replies; 16+ messages in thread
From: Yinghai Lu @ 2009-12-18 20:09 UTC (permalink / raw)
  To: Jesse Barnes, Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: linux-kernel, linux-pci



prepare for 32bit pci root bus

-v2: hpa said we should compare with (resource_size_t)~0

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/pci/amd_bus.c   |    8 +++++---
 arch/x86/pci/bus_numa.c  |    3 +++
 arch/x86/pci/intel_bus.c |    5 ++++-
 include/linux/range.h    |    8 ++++++++
 4 files changed, 20 insertions(+), 4 deletions(-)

Index: linux-2.6/arch/x86/pci/amd_bus.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/amd_bus.c
+++ linux-2.6/arch/x86/pci/amd_bus.c
@@ -201,7 +201,7 @@ static int __init early_fill_mp_bus_info
 
 	memset(range, 0, sizeof(range));
 	/* 0xfd00000000-0xffffffffff for HT */
-	range[0].end = (0xfdULL<<32) - 1;
+	range[0].end = cap_resource((0xfdULL<<32) - 1);
 
 	/* need to take out [0, TOM) for RAM*/
 	address = MSR_K8_TOP_MEM1;
@@ -286,7 +286,8 @@ static int __init early_fill_mp_bus_info
 			}
 		}
 
-		update_res(info, start, end, IORESOURCE_MEM, 1);
+		update_res(info, cap_resource(start), cap_resource(end),
+				 IORESOURCE_MEM, 1);
 		subtract_range(range, RANGE_NUM, start, end);
 		printk(KERN_CONT "\n");
 	}
@@ -321,7 +322,8 @@ static int __init early_fill_mp_bus_info
 			if (!range[i].end)
 				continue;
 
-			update_res(info, range[i].start, range[i].end,
+			update_res(info, cap_resource(range[i].start),
+				   cap_resource(range[i].end),
 				   IORESOURCE_MEM, 1);
 		}
 	}
Index: linux-2.6/arch/x86/pci/bus_numa.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/bus_numa.c
+++ linux-2.6/arch/x86/pci/bus_numa.c
@@ -55,6 +55,9 @@ void __init update_res(struct pci_root_i
 	if (start > end)
 		return;
 
+	if (start == (resource_size_t)~0)
+		return;
+
 	if (!merge)
 		goto addit;
 
Index: linux-2.6/arch/x86/pci/intel_bus.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/intel_bus.c
+++ linux-2.6/arch/x86/pci/intel_bus.c
@@ -6,6 +6,8 @@
 #include <linux/dmi.h>
 #include <linux/pci.h>
 #include <linux/init.h>
+#include <linux/range.h>
+
 #include <asm/pci_x86.h>
 
 #include "bus_numa.h"
@@ -85,7 +87,8 @@ static void __devinit pci_root_bus_res(s
 	mmioh_base |= ((u64)(dword & 0x7ffff)) << 32;
 	pci_read_config_dword(dev, IOH_LMMIOH_LIMITU, &dword);
 	mmioh_end |= ((u64)(dword & 0x7ffff)) << 32;
-	update_res(info, mmioh_base, mmioh_end, IORESOURCE_MEM, 0);
+	update_res(info, cap_resource(mmioh_base), cap_resource(mmioh_end),
+			 IORESOURCE_MEM, 0);
 
 	print_ioh_resources(info);
 }
Index: linux-2.6/include/linux/range.h
===================================================================
--- linux-2.6.orig/include/linux/range.h
+++ linux-2.6/include/linux/range.h
@@ -19,4 +19,12 @@ int clean_sort_range(struct range *range
 
 void sort_range(struct range *range, int nr_range);
 
+
+static inline resource_size_t cap_resource(u64 val)
+{
+	if (val > (resource_size_t)~0)
+		return (resource_size_t)~0;
+	else
+		return val;
+}
 #endif


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 6/7] x86/pci: enable pci root res read out for 32bit too -v3
       [not found] <4B2BE063.4040704@kernel.org>
                   ` (4 preceding siblings ...)
  2009-12-18 20:09 ` [PATCH 5/7] x86/pci: add cap_resource -v2 Yinghai Lu
@ 2009-12-18 20:09 ` Yinghai Lu
  2009-12-18 20:09 ` [PATCH 7/7] x86/pci: don't check mmconf again if it is from MSR with amd faml0h Yinghai Lu
  6 siblings, 0 replies; 16+ messages in thread
From: Yinghai Lu @ 2009-12-18 20:09 UTC (permalink / raw)
  To: Jesse Barnes, Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: linux-kernel, linux-pci


should be good for 32bit too.

-v3: cast res->start

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/pci/Makefile    |    3 +--
 arch/x86/pci/amd_bus.c   |   14 +-------------
 arch/x86/pci/bus_numa.h  |    4 ++--
 arch/x86/pci/i386.c      |    4 ----
 arch/x86/pci/intel_bus.c |    2 +-
 5 files changed, 5 insertions(+), 22 deletions(-)

Index: linux-2.6/arch/x86/pci/Makefile
===================================================================
--- linux-2.6.orig/arch/x86/pci/Makefile
+++ linux-2.6/arch/x86/pci/Makefile
@@ -14,8 +14,7 @@ obj-$(CONFIG_X86_VISWS)		+= visws.o
 obj-$(CONFIG_X86_NUMAQ)		+= numaq_32.o
 
 obj-y				+= common.o early.o
-obj-y				+= amd_bus.o
-obj-$(CONFIG_X86_64)		+= bus_numa.o intel_bus.o
+obj-y				+= amd_bus.o bus_numa.o intel_bus.o
 
 ifeq ($(CONFIG_PCI_DEBUG),y)
 EXTRA_CFLAGS += -DDEBUG
Index: linux-2.6/arch/x86/pci/amd_bus.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/amd_bus.c
+++ linux-2.6/arch/x86/pci/amd_bus.c
@@ -6,9 +6,7 @@
 
 #include <asm/pci_x86.h>
 
-#ifdef CONFIG_X86_64
 #include <asm/pci-direct.h>
-#endif
 
 #include "bus_numa.h"
 
@@ -17,8 +15,6 @@
  * also get peer root bus resource for io,mmio
  */
 
-#ifdef CONFIG_X86_64
-
 struct pci_hostbridge_probe {
 	u32 bus;
 	u32 slot;
@@ -342,21 +338,13 @@ static int __init early_fill_mp_bus_info
 			printk(KERN_DEBUG "bus: %02x index %x %s: [%llx, %llx]\n",
 			       busnum, j,
 			       (res->flags & IORESOURCE_IO)?"io port":"mmio",
-			       res->start, res->end);
+			       (u64)res->start, (u64)res->end);
 		}
 	}
 
 	return 0;
 }
 
-#else  /* !CONFIG_X86_64 */
-
-static int __init early_fill_mp_bus_info(void) { return 0; }
-
-#endif /* !CONFIG_X86_64 */
-
-/* common 32/64 bit code */
-
 #define ENABLE_CF8_EXT_CFG      (1ULL << 46)
 
 static void enable_pci_io_ecs(void *unused)
Index: linux-2.6/arch/x86/pci/i386.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/i386.c
+++ linux-2.6/arch/x86/pci/i386.c
@@ -257,10 +257,6 @@ void __init pcibios_resource_survey(void
  */
 fs_initcall(pcibios_assign_resources);
 
-void __weak x86_pci_root_bus_res_quirks(struct pci_bus *b)
-{
-}
-
 /*
  *  If we set up a device for bus mastering, we need to check the latency
  *  timer as certain crappy BIOSes forget to set it properly.
Index: linux-2.6/arch/x86/pci/bus_numa.h
===================================================================
--- linux-2.6.orig/arch/x86/pci/bus_numa.h
+++ linux-2.6/arch/x86/pci/bus_numa.h
@@ -1,5 +1,5 @@
-#ifdef CONFIG_X86_64
-
+#ifndef __BUS_NUMA_H
+#define __BUS_NUMA_H
 /*
  * sub bus (transparent) will use entres from 3 to store extra from
  * root, so need to make sure we have enough slot there, Should we
Index: linux-2.6/arch/x86/pci/intel_bus.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/intel_bus.c
+++ linux-2.6/arch/x86/pci/intel_bus.c
@@ -30,7 +30,7 @@ static inline void print_ioh_resources(s
 			busnum, i,
 			(res->flags & IORESOURCE_IO) ? "io port" :
 							"mmio",
-			res->start, res->end);
+			(u64)res->start, (u64)res->end);
 	}
 }
 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 7/7] x86/pci: don't check mmconf again if it is from MSR with amd faml0h
       [not found] <4B2BE063.4040704@kernel.org>
                   ` (5 preceding siblings ...)
  2009-12-18 20:09 ` [PATCH 6/7] x86/pci: enable pci root res read out for 32bit too -v3 Yinghai Lu
@ 2009-12-18 20:09 ` Yinghai Lu
  2010-01-15 19:42   ` Jesse Barnes
  6 siblings, 1 reply; 16+ messages in thread
From: Yinghai Lu @ 2009-12-18 20:09 UTC (permalink / raw)
  To: Jesse Barnes, Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: linux-kernel, linux-pci


for AMD Fam10h, it we read mmconf from MSR early, we should just trust it
because we check it and correct it already.

so skip the reject check there.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/pci/mmconfig-shared.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Index: linux-2.6/arch/x86/pci/mmconfig-shared.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/mmconfig-shared.c
+++ linux-2.6/arch/x86/pci/mmconfig-shared.c
@@ -168,6 +168,7 @@ static const char __init *pci_mmcfg_inte
 	return "Intel Corporation 945G/GZ/P/PL Express Memory Controller Hub";
 }
 
+static int __initdata amd_fam10h_mmconf_found_via_hostbridge;
 static const char __init *pci_mmcfg_amd_fam10h(void)
 {
 	u32 low, high, address;
@@ -215,6 +216,8 @@ static const char __init *pci_mmcfg_amd_
 			return NULL;
 		}
 
+	amd_fam10h_mmconf_found_via_hostbridge = 1;
+
 	return "AMD Family 10h NB";
 }
 
@@ -606,7 +609,12 @@ static void __init __pci_mmcfg_init(int
 	if (!known_bridge)
 		acpi_sfi_table_parse(ACPI_SIG_MCFG, pci_parse_mcfg);
 
-	pci_mmcfg_reject_broken(early);
+	/*
+	 * if it is amd fam10h, and that is read from msr,
+	 * we don't need check them again.
+	 */
+	if (!amd_fam10h_mmconf_found_via_hostbridge)
+		pci_mmcfg_reject_broken(early);
 
 	if (list_empty(&pci_mmcfg_list))
 		return;


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 7/7] x86/pci: don't check mmconf again if it is from MSR with amd faml0h
  2009-12-18 20:09 ` [PATCH 7/7] x86/pci: don't check mmconf again if it is from MSR with amd faml0h Yinghai Lu
@ 2010-01-15 19:42   ` Jesse Barnes
  2010-01-15 21:16     ` Yinghai Lu
  0 siblings, 1 reply; 16+ messages in thread
From: Jesse Barnes @ 2010-01-15 19:42 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, linux-kernel, linux-pci

On Fri, 18 Dec 2009 12:09:58 -0800
Yinghai Lu <yinghai@kernel.org> wrote:

> 
> for AMD Fam10h, it we read mmconf from MSR early, we should just
> trust it because we check it and correct it already.
> 
> so skip the reject check there.
> 
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>

My previous question wasn't answered.  Either reject_broken should be a
no-op on this platform, or it's getting things wrong and should be
fixed.  Adding a whitelist here seems like the wrong thing to do...

-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 4/7] x86/pci: use u64 instead of size_t in amd_bus.c -v2
  2009-12-18 20:09 ` [PATCH 4/7] x86/pci: use u64 instead of size_t in amd_bus.c -v2 Yinghai Lu
@ 2010-01-15 19:49   ` Jesse Barnes
  2010-01-15 21:18     ` Yinghai Lu
  0 siblings, 1 reply; 16+ messages in thread
From: Jesse Barnes @ 2010-01-15 19:49 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, linux-kernel, linux-pci

On Fri, 18 Dec 2009 12:09:45 -0800
Yinghai Lu <yinghai@kernel.org> wrote:

> 
> prepare to enable it for 32bit
> 
> -v2: remove not needed cast
> 
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> 

4-6 have conflicts against my linux-next branch, can you refresh them?

Thanks,
-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/7] x86/pci: use resource_size_t in update_res -v2
  2009-12-18 20:09 ` [PATCH 2/7] x86/pci: use resource_size_t in update_res -v2 Yinghai Lu
@ 2010-01-15 19:49   ` Jesse Barnes
  2010-01-15 21:20     ` Yinghai Lu
  0 siblings, 1 reply; 16+ messages in thread
From: Jesse Barnes @ 2010-01-15 19:49 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, linux-kernel, linux-pci

On Fri, 18 Dec 2009 12:09:37 -0800
Yinghai Lu <yinghai@kernel.org> wrote:

> 
> 
> prepare to enable 32bit intel and amd bus
> 
> v2: change __init to __devinit
> 
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> ---

Applied 2-3 to my linux-next branch, thanks.  (1 was already applied to
fix Jens' problem over the holidays, thanks hpa).

-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 7/7] x86/pci: don't check mmconf again if it is from MSR with amd faml0h
  2010-01-15 19:42   ` Jesse Barnes
@ 2010-01-15 21:16     ` Yinghai Lu
  0 siblings, 0 replies; 16+ messages in thread
From: Yinghai Lu @ 2010-01-15 21:16 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, linux-kernel, linux-pci

On 01/15/2010 11:42 AM, Jesse Barnes wrote:
> On Fri, 18 Dec 2009 12:09:58 -0800
> Yinghai Lu <yinghai@kernel.org> wrote:
> 
>>
>> for AMD Fam10h, it we read mmconf from MSR early, we should just
>> trust it because we check it and correct it already.
>>
>> so skip the reject check there.
>>
>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> 
> My previous question wasn't answered.  Either reject_broken should be a
> no-op on this platform, or it's getting things wrong and should be
> fixed.  Adding a whitelist here seems like the wrong thing to do...
> 

let me find other way, may update e820 directly.

YH

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 4/7] x86/pci: use u64 instead of size_t in amd_bus.c -v2
  2010-01-15 19:49   ` Jesse Barnes
@ 2010-01-15 21:18     ` Yinghai Lu
  0 siblings, 0 replies; 16+ messages in thread
From: Yinghai Lu @ 2010-01-15 21:18 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, linux-kernel, linux-pci

On 01/15/2010 11:49 AM, Jesse Barnes wrote:
> On Fri, 18 Dec 2009 12:09:45 -0800
> Yinghai Lu <yinghai@kernel.org> wrote:
> 
>>
>> prepare to enable it for 32bit
>>
>> -v2: remove not needed cast
>>
>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>>
> 
> 4-6 have conflicts against my linux-next branch, can you refresh them?

because it will rely on range.c related cleanup. can we make it go through tip
and add acked-by from you?

Thanks

Yinghai

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/7] x86/pci: use resource_size_t in update_res -v2
  2010-01-15 19:49   ` Jesse Barnes
@ 2010-01-15 21:20     ` Yinghai Lu
  2010-01-15 21:39       ` Jesse Barnes
  0 siblings, 1 reply; 16+ messages in thread
From: Yinghai Lu @ 2010-01-15 21:20 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, linux-kernel, linux-pci

On 01/15/2010 11:49 AM, Jesse Barnes wrote:
> On Fri, 18 Dec 2009 12:09:37 -0800
> Yinghai Lu <yinghai@kernel.org> wrote:
> 
>>
>>
>> prepare to enable 32bit intel and amd bus
>>
>> v2: change __init to __devinit
>>
>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>> ---
> 
> Applied 2-3 to my linux-next branch, thanks.  (1 was already applied to
> fix Jens' problem over the holidays, thanks hpa).
> 

will find out good apply sequence....

YH

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/7] x86/pci: use resource_size_t in update_res -v2
  2010-01-15 21:20     ` Yinghai Lu
@ 2010-01-15 21:39       ` Jesse Barnes
  2010-01-22  1:55         ` Yinghai Lu
  0 siblings, 1 reply; 16+ messages in thread
From: Jesse Barnes @ 2010-01-15 21:39 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, linux-kernel, linux-pci

On Fri, 15 Jan 2010 13:20:53 -0800
Yinghai Lu <yinghai@kernel.org> wrote:

> On 01/15/2010 11:49 AM, Jesse Barnes wrote:
> > On Fri, 18 Dec 2009 12:09:37 -0800
> > Yinghai Lu <yinghai@kernel.org> wrote:
> > 
> >>
> >>
> >> prepare to enable 32bit intel and amd bus
> >>
> >> v2: change __init to __devinit
> >>
> >> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> >> ---
> > 
> > Applied 2-3 to my linux-next branch, thanks.  (1 was already
> > applied to fix Jens' problem over the holidays, thanks hpa).
> > 
> 
> will find out good apply sequence....

Pushing the ones for 32 bit bus driver support through -tip is fine
with me, you can add my Acked-by.

Thanks,
-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/7] x86/pci: use resource_size_t in update_res -v2
  2010-01-15 21:39       ` Jesse Barnes
@ 2010-01-22  1:55         ` Yinghai Lu
  2010-01-25 18:49           ` Jesse Barnes
  0 siblings, 1 reply; 16+ messages in thread
From: Yinghai Lu @ 2010-01-22  1:55 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, linux-kernel, linux-pci

On 01/15/2010 01:39 PM, Jesse Barnes wrote:
> On Fri, 15 Jan 2010 13:20:53 -0800
> Yinghai Lu <yinghai@kernel.org> wrote:
> 
>> On 01/15/2010 11:49 AM, Jesse Barnes wrote:
>>> On Fri, 18 Dec 2009 12:09:37 -0800
>>> Yinghai Lu <yinghai@kernel.org> wrote:
>>>
>>>>
>>>>
>>>> prepare to enable 32bit intel and amd bus
>>>>
>>>> v2: change __init to __devinit
>>>>
>>>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>>>> ---
>>>
>>> Applied 2-3 to my linux-next branch, thanks.  (1 was already
>>> applied to fix Jens' problem over the holidays, thanks hpa).
>>>
>>
>> will find out good apply sequence....
> 
> Pushing the ones for 32 bit bus driver support through -tip is fine
> with me, you can add my Acked-by.

please drop 2 and 3 from pci/linux-next tree. we need to make them go through tip/x86 tree with range related seperating code.

http://git.kernel.org/?p=linux/kernel/git/jbarnes/pci-2.6.git;a=commitdiff;h=f84fe8aef6e4b23ab58175a15dd12c197c993f81
http://git.kernel.org/?p=linux/kernel/git/jbarnes/pci-2.6.git;a=commitdiff;h=693f084f82a38fc1b01e3b05664a6fe014a3488a


Thanks

Yinghai

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/7] x86/pci: use resource_size_t in update_res -v2
  2010-01-22  1:55         ` Yinghai Lu
@ 2010-01-25 18:49           ` Jesse Barnes
  0 siblings, 0 replies; 16+ messages in thread
From: Jesse Barnes @ 2010-01-25 18:49 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, linux-kernel, linux-pci

On Thu, 21 Jan 2010 17:55:38 -0800
Yinghai Lu <yinghai@kernel.org> wrote:

> On 01/15/2010 01:39 PM, Jesse Barnes wrote:
> > On Fri, 15 Jan 2010 13:20:53 -0800
> > Yinghai Lu <yinghai@kernel.org> wrote:
> > 
> >> On 01/15/2010 11:49 AM, Jesse Barnes wrote:
> >>> On Fri, 18 Dec 2009 12:09:37 -0800
> >>> Yinghai Lu <yinghai@kernel.org> wrote:
> >>>
> >>>>
> >>>>
> >>>> prepare to enable 32bit intel and amd bus
> >>>>
> >>>> v2: change __init to __devinit
> >>>>
> >>>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> >>>> ---
> >>>
> >>> Applied 2-3 to my linux-next branch, thanks.  (1 was already
> >>> applied to fix Jens' problem over the holidays, thanks hpa).
> >>>
> >>
> >> will find out good apply sequence....
> > 
> > Pushing the ones for 32 bit bus driver support through -tip is fine
> > with me, you can add my Acked-by.
> 
> please drop 2 and 3 from pci/linux-next tree. we need to make them go
> through tip/x86 tree with range related seperating code.
> 
> http://git.kernel.org/?p=linux/kernel/git/jbarnes/pci-2.6.git;a=commitdiff;h=f84fe8aef6e4b23ab58175a15dd12c197c993f81
> http://git.kernel.org/?p=linux/kernel/git/jbarnes/pci-2.6.git;a=commitdiff;h=693f084f82a38fc1b01e3b05664a6fe014a3488a

Ok, dropped.

-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2010-01-25 18:50 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4B2BE063.4040704@kernel.org>
2009-12-18 20:09 ` [PATCH 1/7] x86/pci: intel ioh bus num reg accessing fix Yinghai Lu
2009-12-18 20:09 ` [PATCH 2/7] x86/pci: use resource_size_t in update_res -v2 Yinghai Lu
2010-01-15 19:49   ` Jesse Barnes
2010-01-15 21:20     ` Yinghai Lu
2010-01-15 21:39       ` Jesse Barnes
2010-01-22  1:55         ` Yinghai Lu
2010-01-25 18:49           ` Jesse Barnes
2009-12-18 20:09 ` [PATCH 3/7] x86/pci: amd one chain system to use pci read out res Yinghai Lu
2009-12-18 20:09 ` [PATCH 4/7] x86/pci: use u64 instead of size_t in amd_bus.c -v2 Yinghai Lu
2010-01-15 19:49   ` Jesse Barnes
2010-01-15 21:18     ` Yinghai Lu
2009-12-18 20:09 ` [PATCH 5/7] x86/pci: add cap_resource -v2 Yinghai Lu
2009-12-18 20:09 ` [PATCH 6/7] x86/pci: enable pci root res read out for 32bit too -v3 Yinghai Lu
2009-12-18 20:09 ` [PATCH 7/7] x86/pci: don't check mmconf again if it is from MSR with amd faml0h Yinghai Lu
2010-01-15 19:42   ` Jesse Barnes
2010-01-15 21:16     ` Yinghai Lu

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).