LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] x86, pci: early dump skip device the same way as later probe code
@ 2011-02-07 22:01 Yinghai Lu
  0 siblings, 0 replies; only message in thread
From: Yinghai Lu @ 2011-02-07 22:01 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Jesse Barnes
  Cc: linux-kernel, linux-pci


Use VENDOR_ID instead of CLASS_REVISION.

Do have one system with 0x00ffffff CLASS_REVSION

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

---
 arch/x86/pci/early.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Index: linux-2.6/arch/x86/pci/early.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/early.c
+++ linux-2.6/arch/x86/pci/early.c
@@ -88,12 +88,17 @@ void early_dump_pci_devices(void)
 	for (bus = 0; bus < 256; bus++) {
 		for (slot = 0; slot < 32; slot++) {
 			for (func = 0; func < 8; func++) {
-				u32 class;
+				u32 l;
 				u8 type;
 
-				class = read_pci_config(bus, slot, func,
-							PCI_CLASS_REVISION);
-				if (class == 0xffffffff)
+				l = read_pci_config(bus, slot, func,
+							PCI_VENDOR_ID);
+				/*
+				 * some broken boards return 0 or ~0 if a slot
+				 *  is empty
+				 */
+				if (l == 0xffffffff || l == 0x00000000 ||
+				    l == 0x0000ffff || l == 0xffff0000)
 					continue;
 
 				early_dump_pci_device(bus, slot, func);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-02-07 22:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-07 22:01 [PATCH] x86, pci: early dump skip device the same way as later probe code 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).