aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Patterson <andrew.patterson@hp.com>2008-11-10 17:30:50 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-01-07 14:12:28 -0500
commit0ef5f8f6159e44b4faa997be08d1a3bcbf44ad08 (patch)
tree0753c27a1eb2f5802501e60d575f01fe6edccc2f
parent990a7ac5645883a833a11b900bb6f25b65dea65b (diff)
ACPI/PCI: PCI extended config _OSC support called when root bridge added
The _OSC capability OSC_EXT_PCI_CONFIG_SUPPORT is set when the root bridge is added with pci_acpi_osc_support() if we can access PCI extended config space. This adds the function pci_ext_cfg_avail which returns true if we can access PCI extended config space (offset greater than 0xff). It currently only returns false if arch=x86 and raw_pci_ext_ops is not set (which might happen if pci=nommcfg is set on the kernel command-line). Signed-off-by: Andrew Patterson <andrew.patterson@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r--arch/x86/pci/common.c8
-rw-r--r--drivers/acpi/pci_root.c10
-rw-r--r--drivers/pci/pci.c13
-rw-r--r--include/linux/pci.h2
4 files changed, 31 insertions, 2 deletions
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 62ddb73e09ed..9ab8509f7b15 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -562,6 +562,14 @@ void pcibios_disable_device (struct pci_dev *dev)
562 pcibios_disable_irq(dev); 562 pcibios_disable_irq(dev);
563} 563}
564 564
565int pci_ext_cfg_avail(struct pci_dev *dev)
566{
567 if (raw_pci_ext_ops)
568 return 1;
569 else
570 return 0;
571}
572
565struct pci_bus * __devinit pci_scan_bus_on_node(int busno, struct pci_ops *ops, int node) 573struct pci_bus * __devinit pci_scan_bus_on_node(int busno, struct pci_ops *ops, int node)
566{ 574{
567 struct pci_bus *bus = NULL; 575 struct pci_bus *bus = NULL;
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index de4d57114fe4..96e68e841539 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -194,7 +194,7 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device)
194 unsigned long long value = 0; 194 unsigned long long value = 0;
195 acpi_handle handle = NULL; 195 acpi_handle handle = NULL;
196 struct acpi_device *child; 196 struct acpi_device *child;
197 u32 flags; 197 u32 flags, base_flags;
198 198
199 199
200 if (!device) 200 if (!device)
@@ -216,7 +216,7 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device)
216 * All supported architectures that use ACPI have support for 216 * All supported architectures that use ACPI have support for
217 * PCI domains, so we indicate this in _OSC support capabilities. 217 * PCI domains, so we indicate this in _OSC support capabilities.
218 */ 218 */
219 flags = OSC_PCI_SEGMENT_GROUPS_SUPPORT; 219 flags = base_flags = OSC_PCI_SEGMENT_GROUPS_SUPPORT;
220 pci_acpi_osc_support(device->handle, flags); 220 pci_acpi_osc_support(device->handle, flags);
221 221
222 /* 222 /*
@@ -344,6 +344,12 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device)
344 list_for_each_entry(child, &device->children, node) 344 list_for_each_entry(child, &device->children, node)
345 acpi_pci_bridge_scan(child); 345 acpi_pci_bridge_scan(child);
346 346
347 /* Indicate support for various _OSC capabilities. */
348 if (pci_ext_cfg_avail(root->bus->self))
349 flags |= OSC_EXT_PCI_CONFIG_SUPPORT;
350 if (flags != base_flags)
351 pci_acpi_osc_support(device->handle, flags);
352
347 end: 353 end:
348 if (result) { 354 if (result) {
349 if (!list_empty(&root->node)) 355 if (!list_empty(&root->node))
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 3c2fa2fdc9cd..48fa860276d4 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2084,6 +2084,19 @@ static void __devinit pci_no_domains(void)
2084#endif 2084#endif
2085} 2085}
2086 2086
2087/**
2088 * pci_ext_cfg_enabled - can we access extended PCI config space?
2089 * @dev: The PCI device of the root bridge.
2090 *
2091 * Returns 1 if we can access PCI extended config space (offsets
2092 * greater than 0xff). This is the default implementation. Architecture
2093 * implementations can override this.
2094 */
2095int __attribute__ ((weak)) pci_ext_cfg_avail(struct pci_dev *dev)
2096{
2097 return 1;
2098}
2099
2087static int __devinit pci_init(void) 2100static int __devinit pci_init(void)
2088{ 2101{
2089 struct pci_dev *dev = NULL; 2102 struct pci_dev *dev = NULL;
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 4bb156ba854a..6fd47654ca4e 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1140,6 +1140,8 @@ static inline void pci_mmcfg_early_init(void) { }
1140static inline void pci_mmcfg_late_init(void) { } 1140static inline void pci_mmcfg_late_init(void) { }
1141#endif 1141#endif
1142 1142
1143int pci_ext_cfg_avail(struct pci_dev *dev);
1144
1143#ifdef CONFIG_HAS_IOMEM 1145#ifdef CONFIG_HAS_IOMEM
1144static inline void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar) 1146static inline void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar)
1145{ 1147{