6 #include <linux/slab.h>
11 struct acpi_device *
bridge;
15 struct pci_sysdata
sd;
16 #ifdef CONFIG_PCI_MMCONFIG
24 static bool pci_use_crs =
true;
41 .callback = set_use_crs,
42 .ident =
"IBM System x3800",
51 .callback = set_use_crs,
52 .ident =
"ASRock ALiveSATA2-GLAN",
60 .callback = set_use_crs,
61 .ident =
"ASUS M2V-MX SE",
70 .callback = set_use_crs,
71 .ident =
"MSI MS-7253",
83 .callback = set_nouse_crs,
84 .ident =
"Dell Studio 1557",
93 .callback = set_nouse_crs,
94 .ident =
"Thinkpad SL510",
123 "if necessary, use \"pci=%s\" and report a bug\n",
124 pci_use_crs ?
"Using" :
"Ignoring",
125 pci_use_crs ?
"nocrs" :
"use_crs");
128 #ifdef CONFIG_PCI_MMCONFIG
133 "%s can't access PCI configuration "
134 "space under this host bridge.\n",
145 "%s can't access extended PCI configuration "
146 "space under this bridge.\n",
159 info->start_bus =
start;
161 info->mcfg_added =
false;
168 return check_segment(seg, dev,
"MMCONFIG is disabled,");
175 info->mcfg_added =
true;
176 }
else if (result != -
EEXIST)
177 return check_segment(seg, dev,
178 "fail to add MMCONFIG information,");
185 if (info->mcfg_added) {
188 info->mcfg_added =
false;
212 memset(addr, 0,
sizeof(*addr));
213 switch (resource->
type) {
257 status = resource_to_addr(acpi_res, &addr);
267 struct resource *
res;
273 status = resource_to_addr(acpi_res, &addr);
293 "host bridge window [%#llx-%#llx] "
294 "(ignored, not CPU addressable)\n", start, orig_end);
296 }
else if (orig_end != end) {
298 "host bridge window [%#llx-%#llx] "
299 "([%#llx-%#llx] ignored, not CPU addressable)\n",
300 start, orig_end, end + 1, orig_end);
311 "host bridge window %pR (ignored)\n", res);
325 for (i = 0; i < info->
res_num; i++) {
326 res1 = &info->
res[
i];
327 if (!(res1->
flags & type))
330 for (j = i + 1; j < info->
res_num; j++) {
331 res2 = &info->
res[
j];
332 if (!(res2->
flags & type))
340 if (resource_overlaps(res1, res2)) {
344 "host bridge window expanded to %pR; %pR ignored\n",
356 struct resource *
res, *
root, *conflict;
361 for (i = 0; i < info->
res_num; i++) {
374 "ignoring host bridge window %pR (conflicts with %s %pR)\n",
375 res, conflict->
name, conflict);
381 static void free_pci_root_info_res(
struct pci_root_info *info)
388 static void __release_pci_root_info(
struct pci_root_info *info)
391 struct resource *
res;
393 for (i = 0; i < info->
res_num; i++) {
405 free_pci_root_info_res(info);
407 teardown_mcfg_map(info);
416 __release_pci_root_info(info);
425 sprintf(info->
name,
"PCI Bus %04x:%02x", domain, busnum);
446 struct acpi_device *device = root->device;
448 int domain = root->segment;
449 int busnum = root->secondary.start;
452 struct pci_sysdata *
sd;
454 #ifdef CONFIG_ACPI_NUMA
458 if (domain && !pci_domains_supported) {
460 "ignored (multiple domains not supported)\n",
466 #ifdef CONFIG_ACPI_NUMA
471 set_mp_bus_to_node(busnum, node);
474 node = get_mp_bus_to_node(busnum);
482 "ignored (out of memory)\n", domain, busnum);
502 probe_pci_root_info(info, device, busnum, domain);
511 add_resources(info, &resources);
513 free_pci_root_info_res(info);
517 if (!setup_mcfg_map(info, domain, (
u8)root->secondary.start,
518 (
u8)root->secondary.end, root->mcfg_addr))
526 release_pci_root_info, info);
529 __release_pci_root_info(info);
547 if (bus && node != -1) {
548 #ifdef CONFIG_ACPI_NUMA
551 "on NUMA node %d (pxm %d)\n", node, pxm);
553 dev_printk(
KERN_DEBUG, &bus->
dev,
"on NUMA node %d\n", node);
579 printk(
KERN_INFO "PCI: Routing PCI interrupts for all devices because \"pci=routeirq\" specified\n");