public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86_64: force re setting the mmconf for fam10h if acpi=off
@ 2008-02-26  2:41 Yinghai Lu
  2008-02-26  7:24 ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Yinghai Lu @ 2008-02-26  2:41 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Andrew Morton, Linux Kernel Mailing List, Greg KH


some BIOS only let AMD fam 10h handle bus0, and nvidia mcp55/ck804
to handle other buses. at that case MCFG will cover all over them.

but with acpi=off, we can not use MCFG. this patch will double check
the busnbits, and if it is less handling 256 bues, and acpi=off
will forcely reset the mmconf in msr, so we still use mmconf in above case.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>

Index: linux-2.6/arch/x86/kernel/setup_64.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup_64.c
+++ linux-2.6/arch/x86/kernel/setup_64.c
@@ -720,14 +720,21 @@ static void __cpuinit fam10h_check_enabl
 
 	/* try to make sure that AP's setting is identical to BSP setting */
 	if (val & FAM10H_MMIO_CONF_ENABLE) {
-		u64 base;
-		base = val & (0xffffULL << 32);
-		if (fam10h_pci_mmconf_base_status <= 0) {
-			fam10h_pci_mmconf_base = base;
-			fam10h_pci_mmconf_base_status = 1;
-			return;
-		} else if (fam10h_pci_mmconf_base ==  base)
-			return;
+		unsigned busnbits;
+		busnbits = (val >> FAM10H_MMIO_CONF_BUSRANGE_SHIFT) &
+			FAM10H_MMIO_CONF_BUSRANGE_MASK;
+
+		/* only trust the one handle 256 buses, if acpi=off */
+		if (!acpi_pci_disabled || busnbits >= 8) {
+			u64 base;
+			base = val & (0xffffULL << 32);
+			if (fam10h_pci_mmconf_base_status <= 0) {
+				fam10h_pci_mmconf_base = base;
+				fam10h_pci_mmconf_base_status = 1;
+				return;
+			} else if (fam10h_pci_mmconf_base ==  base)
+				return;
+		}
 	}
 
 	/*

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

end of thread, other threads:[~2008-02-26 18:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-26  2:41 [PATCH] x86_64: force re setting the mmconf for fam10h if acpi=off Yinghai Lu
2008-02-26  7:24 ` Ingo Molnar
2008-02-26 19:04   ` [PATCH] x86_64: Seperate mmconf for fam10h out from setup_64.c Yinghai Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox