Re: [RFC PATCH 1/2] pci: determine CLS more intelligently

David Miller
2009-06-25T09:05:16Z

From: Tejun Heo <tj@kernel.org>
Date: Thu, 25 Jun 2009 16:12:13 +0900

> sparc64 is currently the only one using PCI_CACHE_LINE_BYTES.

Feel free to add the patch below and:

Acked-by: David S. Miller <davem@davemloft.net>

Although I think it's better to declare pci_dfl_cache_line_size in
linux/pci.h instead of making every arch do the extern decl.

diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index 57859ad..511a592 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -1081,3 +1081,12 @@ void pci_resource_to_user(const struct pci_dev *pdev, int bar,
*start = rp->start - offset;
*end = rp->end - offset;
}
+
+extern u8 pci_dfl_cache_line_size;
+
+static int __init pcibios_init(void)
+{
+ pci_dfl_cache_line_size = 64 >> 2;
+ return 0;
+}
+subsys_initcall(pcibios_init);