diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:26:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:26:51 -0400 |
commit | 5f78e4d33945b291d12765cdd7e4304f437b9361 (patch) | |
tree | 113cea729de15a98bb941cc4afb8d13301534ca7 /drivers | |
parent | 867a89e0b73af48838c7987e80899a1ff26dd6ff (diff) | |
parent | 5f0b2976cb2b62668a076f54419c24b8ab677167 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86-bigbox-pci
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86-bigbox-pci:
x86: add pci=check_enable_amd_mmconf and dmi check
x86: work around io allocation overlap of HT links
acpi: get boot_cpu_id as early for k8_scan_nodes
x86_64: don't need set default res if only have one root bus
x86: double check the multi root bus with fam10h mmconf
x86: multi pci root bus with different io resource range, on 64-bit
x86: use bus conf in NB conf fun1 to get bus range on, on 64-bit
x86: get mp_bus_to_node early
x86 pci: remove checking type for mmconfig probe
x86: remove unneeded check in mmconf reject
driver core: try parent numa_node at first before using default
x86: seperate mmconf for fam10h out from setup_64.c
x86: if acpi=off, force setting the mmconf for fam10h
x86_64: check MSR to get MMCONFIG for AMD Family 10h
x86_64: check and enable MMCONFIG for AMD Family 10h
x86_64: set cfg_size for AMD Family 10h in case MMCONFIG
x86: mmconf enable mcfg early
x86: clear pci_mmcfg_virt when mmcfg get rejected
x86: validate against acpi motherboard resources
Fixed up fairly trivial conflicts in arch/x86/pci/{init.c,pci.h} due to
OLPC support manually.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/bus.c | 2 | ||||
-rw-r--r-- | drivers/base/core.c | 14 | ||||
-rw-r--r-- | drivers/pci/probe.c | 21 |
3 files changed, 33 insertions, 4 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 2d1955c11833..a6dbcf4d9ef5 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #ifdef CONFIG_X86 | 35 | #ifdef CONFIG_X86 |
36 | #include <asm/mpspec.h> | 36 | #include <asm/mpspec.h> |
37 | #endif | 37 | #endif |
38 | #include <linux/pci.h> | ||
38 | #include <acpi/acpi_bus.h> | 39 | #include <acpi/acpi_bus.h> |
39 | #include <acpi/acpi_drivers.h> | 40 | #include <acpi/acpi_drivers.h> |
40 | 41 | ||
@@ -784,6 +785,7 @@ static int __init acpi_init(void) | |||
784 | result = acpi_bus_init(); | 785 | result = acpi_bus_init(); |
785 | 786 | ||
786 | if (!result) { | 787 | if (!result) { |
788 | pci_mmcfg_late_init(); | ||
787 | if (!(pm_flags & PM_APM)) | 789 | if (!(pm_flags & PM_APM)) |
788 | pm_flags |= PM_ACPI; | 790 | pm_flags |= PM_ACPI; |
789 | else { | 791 | else { |
diff --git a/drivers/base/core.c b/drivers/base/core.c index 9248e0927d08..be288b5e4180 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -787,6 +787,10 @@ int device_add(struct device *dev) | |||
787 | parent = get_device(dev->parent); | 787 | parent = get_device(dev->parent); |
788 | setup_parent(dev, parent); | 788 | setup_parent(dev, parent); |
789 | 789 | ||
790 | /* use parent numa_node */ | ||
791 | if (parent) | ||
792 | set_dev_node(dev, dev_to_node(parent)); | ||
793 | |||
790 | /* first, register with generic layer. */ | 794 | /* first, register with generic layer. */ |
791 | error = kobject_add(&dev->kobj, dev->kobj.parent, "%s", dev->bus_id); | 795 | error = kobject_add(&dev->kobj, dev->kobj.parent, "%s", dev->bus_id); |
792 | if (error) | 796 | if (error) |
@@ -1306,8 +1310,11 @@ int device_move(struct device *dev, struct device *new_parent) | |||
1306 | dev->parent = new_parent; | 1310 | dev->parent = new_parent; |
1307 | if (old_parent) | 1311 | if (old_parent) |
1308 | klist_remove(&dev->knode_parent); | 1312 | klist_remove(&dev->knode_parent); |
1309 | if (new_parent) | 1313 | if (new_parent) { |
1310 | klist_add_tail(&dev->knode_parent, &new_parent->klist_children); | 1314 | klist_add_tail(&dev->knode_parent, &new_parent->klist_children); |
1315 | set_dev_node(dev, dev_to_node(new_parent)); | ||
1316 | } | ||
1317 | |||
1311 | if (!dev->class) | 1318 | if (!dev->class) |
1312 | goto out_put; | 1319 | goto out_put; |
1313 | error = device_move_class_links(dev, old_parent, new_parent); | 1320 | error = device_move_class_links(dev, old_parent, new_parent); |
@@ -1317,9 +1324,12 @@ int device_move(struct device *dev, struct device *new_parent) | |||
1317 | if (!kobject_move(&dev->kobj, &old_parent->kobj)) { | 1324 | if (!kobject_move(&dev->kobj, &old_parent->kobj)) { |
1318 | if (new_parent) | 1325 | if (new_parent) |
1319 | klist_remove(&dev->knode_parent); | 1326 | klist_remove(&dev->knode_parent); |
1320 | if (old_parent) | 1327 | dev->parent = old_parent; |
1328 | if (old_parent) { | ||
1321 | klist_add_tail(&dev->knode_parent, | 1329 | klist_add_tail(&dev->knode_parent, |
1322 | &old_parent->klist_children); | 1330 | &old_parent->klist_children); |
1331 | set_dev_node(dev, dev_to_node(old_parent)); | ||
1332 | } | ||
1323 | } | 1333 | } |
1324 | cleanup_glue_dir(dev, new_parent_kobj); | 1334 | cleanup_glue_dir(dev, new_parent_kobj); |
1325 | put_device(new_parent); | 1335 | put_device(new_parent); |
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index f991359f0c36..4a55bf380957 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -842,11 +842,14 @@ static void set_pcie_port_type(struct pci_dev *pdev) | |||
842 | * reading the dword at 0x100 which must either be 0 or a valid extended | 842 | * reading the dword at 0x100 which must either be 0 or a valid extended |
843 | * capability header. | 843 | * capability header. |
844 | */ | 844 | */ |
845 | int pci_cfg_space_size(struct pci_dev *dev) | 845 | int pci_cfg_space_size_ext(struct pci_dev *dev, unsigned check_exp_pcix) |
846 | { | 846 | { |
847 | int pos; | 847 | int pos; |
848 | u32 status; | 848 | u32 status; |
849 | 849 | ||
850 | if (!check_exp_pcix) | ||
851 | goto skip; | ||
852 | |||
850 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); | 853 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); |
851 | if (!pos) { | 854 | if (!pos) { |
852 | pos = pci_find_capability(dev, PCI_CAP_ID_PCIX); | 855 | pos = pci_find_capability(dev, PCI_CAP_ID_PCIX); |
@@ -858,6 +861,7 @@ int pci_cfg_space_size(struct pci_dev *dev) | |||
858 | goto fail; | 861 | goto fail; |
859 | } | 862 | } |
860 | 863 | ||
864 | skip: | ||
861 | if (pci_read_config_dword(dev, 256, &status) != PCIBIOS_SUCCESSFUL) | 865 | if (pci_read_config_dword(dev, 256, &status) != PCIBIOS_SUCCESSFUL) |
862 | goto fail; | 866 | goto fail; |
863 | if (status == 0xffffffff) | 867 | if (status == 0xffffffff) |
@@ -869,6 +873,11 @@ int pci_cfg_space_size(struct pci_dev *dev) | |||
869 | return PCI_CFG_SPACE_SIZE; | 873 | return PCI_CFG_SPACE_SIZE; |
870 | } | 874 | } |
871 | 875 | ||
876 | int pci_cfg_space_size(struct pci_dev *dev) | ||
877 | { | ||
878 | return pci_cfg_space_size_ext(dev, 1); | ||
879 | } | ||
880 | |||
872 | static void pci_release_bus_bridge_dev(struct device *dev) | 881 | static void pci_release_bus_bridge_dev(struct device *dev) |
873 | { | 882 | { |
874 | kfree(dev); | 883 | kfree(dev); |
@@ -964,7 +973,6 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus) | |||
964 | dev->dev.release = pci_release_dev; | 973 | dev->dev.release = pci_release_dev; |
965 | pci_dev_get(dev); | 974 | pci_dev_get(dev); |
966 | 975 | ||
967 | set_dev_node(&dev->dev, pcibus_to_node(bus)); | ||
968 | dev->dev.dma_mask = &dev->dma_mask; | 976 | dev->dev.dma_mask = &dev->dma_mask; |
969 | dev->dev.dma_parms = &dev->dma_parms; | 977 | dev->dev.dma_parms = &dev->dma_parms; |
970 | dev->dev.coherent_dma_mask = 0xffffffffull; | 978 | dev->dev.coherent_dma_mask = 0xffffffffull; |
@@ -1080,6 +1088,10 @@ unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus) | |||
1080 | return max; | 1088 | return max; |
1081 | } | 1089 | } |
1082 | 1090 | ||
1091 | void __attribute__((weak)) set_pci_bus_resources_arch_default(struct pci_bus *b) | ||
1092 | { | ||
1093 | } | ||
1094 | |||
1083 | struct pci_bus * pci_create_bus(struct device *parent, | 1095 | struct pci_bus * pci_create_bus(struct device *parent, |
1084 | int bus, struct pci_ops *ops, void *sysdata) | 1096 | int bus, struct pci_ops *ops, void *sysdata) |
1085 | { | 1097 | { |
@@ -1119,6 +1131,9 @@ struct pci_bus * pci_create_bus(struct device *parent, | |||
1119 | goto dev_reg_err; | 1131 | goto dev_reg_err; |
1120 | b->bridge = get_device(dev); | 1132 | b->bridge = get_device(dev); |
1121 | 1133 | ||
1134 | if (!parent) | ||
1135 | set_dev_node(b->bridge, pcibus_to_node(b)); | ||
1136 | |||
1122 | b->dev.class = &pcibus_class; | 1137 | b->dev.class = &pcibus_class; |
1123 | b->dev.parent = b->bridge; | 1138 | b->dev.parent = b->bridge; |
1124 | sprintf(b->dev.bus_id, "%04x:%02x", pci_domain_nr(b), bus); | 1139 | sprintf(b->dev.bus_id, "%04x:%02x", pci_domain_nr(b), bus); |
@@ -1136,6 +1151,8 @@ struct pci_bus * pci_create_bus(struct device *parent, | |||
1136 | b->resource[0] = &ioport_resource; | 1151 | b->resource[0] = &ioport_resource; |
1137 | b->resource[1] = &iomem_resource; | 1152 | b->resource[1] = &iomem_resource; |
1138 | 1153 | ||
1154 | set_pci_bus_resources_arch_default(b); | ||
1155 | |||
1139 | return b; | 1156 | return b; |
1140 | 1157 | ||
1141 | dev_create_file_err: | 1158 | dev_create_file_err: |