aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2009-10-26 16:20:44 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-11-04 11:47:10 -0500
commitac1aa47b131416a6ff37eb1005a0a1d2541aad6c (patch)
tree1d7efa15a16f61664a240520970e729b1a47e4a5 /arch/x86/pci
parent99935a7a59eaca0292c1a5880e10bae03f4a5e3d (diff)
PCI: determine CLS more intelligently
Till now, CLS has been determined either by arch code or as L1_CACHE_BYTES. Only x86 and ia64 set CLS explicitly and x86 doesn't always get it right. On most configurations, the chance is that firmware configures the correct value during boot. This patch makes pci_init() determine CLS by looking at what firmware has configured. It scans all devices and if all non-zero values agree, the value is used. If none is configured or there is a disagreement, pci_dfl_cache_line_size is used. arch can set the dfl value (via PCI_CACHE_LINE_BYTES or pci_dfl_cache_line_size) or override the actual one. ia64, x86 and sparc64 updated to set the default cls instead of the actual one. While at it, declare pci_cache_line_size and pci_dfl_cache_line_size in pci.h and drop private declarations from arch code. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: David Miller <davem@davemloft.net> Acked-by: Greg KH <gregkh@suse.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tony Luck <tony.luck@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch/x86/pci')
-rw-r--r--arch/x86/pci/common.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 1331fcf2614..fbeec31316c 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -410,8 +410,6 @@ struct pci_bus * __devinit pcibios_scan_root(int busnum)
410 return bus; 410 return bus;
411} 411}
412 412
413extern u8 pci_cache_line_size;
414
415int __init pcibios_init(void) 413int __init pcibios_init(void)
416{ 414{
417 struct cpuinfo_x86 *c = &boot_cpu_data; 415 struct cpuinfo_x86 *c = &boot_cpu_data;
@@ -426,11 +424,11 @@ int __init pcibios_init(void)
426 * and P4. It's also good for 386/486s (which actually have 16) 424 * and P4. It's also good for 386/486s (which actually have 16)
427 * as quite a few PCI devices do not support smaller values. 425 * as quite a few PCI devices do not support smaller values.
428 */ 426 */
429 pci_cache_line_size = 32 >> 2; 427 pci_dfl_cache_line_size = 32 >> 2;
430 if (c->x86 >= 6 && c->x86_vendor == X86_VENDOR_AMD) 428 if (c->x86 >= 6 && c->x86_vendor == X86_VENDOR_AMD)
431 pci_cache_line_size = 64 >> 2; /* K7 & K8 */ 429 pci_dfl_cache_line_size = 64 >> 2; /* K7 & K8 */
432 else if (c->x86 > 6 && c->x86_vendor == X86_VENDOR_INTEL) 430 else if (c->x86 > 6 && c->x86_vendor == X86_VENDOR_INTEL)
433 pci_cache_line_size = 128 >> 2; /* P4 */ 431 pci_dfl_cache_line_size = 128 >> 2; /* P4 */
434 432
435 pcibios_resource_survey(); 433 pcibios_resource_survey();
436 434