Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[SPARC64]: Fix memory corruption in pci_4u_free_consistent().
[SPARC64]: Fix central/FHC bus handling on Ex000 systems.

+44 -25
+4
arch/sparc64/kernel/central.c
··· 126 126 int board; 127 127 u32 tmp; 128 128 129 + if (dp->parent && 130 + dp->parent->parent != NULL) 131 + continue; 132 + 129 133 fhc = (struct linux_fhc *) 130 134 central_alloc_bootmem(sizeof(struct linux_fhc)); 131 135 if (fhc == NULL)
+24 -9
arch/sparc64/kernel/of_device.c
··· 402 402 *sizec = 1; 403 403 } 404 404 405 - static int of_bus_sbus_map(u32 *addr, const u32 *range, int na, int ns, int pna) 405 + /* 406 + * FHC/Central bus specific translator. 407 + * 408 + * This is just needed to hard-code the address and size cell 409 + * counts. 'fhc' and 'central' nodes lack the #address-cells and 410 + * #size-cells properties, and if you walk to the root on such 411 + * Enterprise boxes all you'll get is a #size-cells of 2 which is 412 + * not what we want to use. 413 + */ 414 + static int of_bus_fhc_match(struct device_node *np) 406 415 { 407 - return of_bus_default_map(addr, range, na, ns, pna); 416 + return !strcmp(np->name, "fhc") || 417 + !strcmp(np->name, "central"); 408 418 } 409 419 410 - static unsigned int of_bus_sbus_get_flags(u32 *addr) 411 - { 412 - return IORESOURCE_MEM; 413 - } 414 - 420 + #define of_bus_fhc_count_cells of_bus_sbus_count_cells 415 421 416 422 /* 417 423 * Array of bus specific translators ··· 439 433 .addr_prop_name = "reg", 440 434 .match = of_bus_sbus_match, 441 435 .count_cells = of_bus_sbus_count_cells, 442 - .map = of_bus_sbus_map, 443 - .get_flags = of_bus_sbus_get_flags, 436 + .map = of_bus_default_map, 437 + .get_flags = of_bus_default_get_flags, 438 + }, 439 + /* FHC */ 440 + { 441 + .name = "fhc", 442 + .addr_prop_name = "reg", 443 + .match = of_bus_fhc_match, 444 + .count_cells = of_bus_fhc_count_cells, 445 + .map = of_bus_default_map, 446 + .get_flags = of_bus_default_get_flags, 444 447 }, 445 448 /* Default */ 446 449 {
+1 -1
arch/sparc64/kernel/pci_iommu.c
··· 281 281 282 282 spin_lock_irqsave(&iommu->lock, flags); 283 283 284 - free_npages(iommu, dvma, npages); 284 + free_npages(iommu, dvma - iommu->page_table_map_base, npages); 285 285 286 286 spin_unlock_irqrestore(&iommu->lock, flags); 287 287
+15 -15
arch/sparc64/kernel/prom.c
··· 1079 1079 1080 1080 static void irq_trans_init(struct device_node *dp) 1081 1081 { 1082 - const char *model; 1083 1082 #ifdef CONFIG_PCI 1083 + const char *model; 1084 1084 int i; 1085 1085 #endif 1086 1086 1087 + #ifdef CONFIG_PCI 1087 1088 model = of_get_property(dp, "model", NULL); 1088 1089 if (!model) 1089 1090 model = of_get_property(dp, "compatible", NULL); 1090 - if (!model) 1091 - return; 1091 + if (model) { 1092 + for (i = 0; i < ARRAY_SIZE(pci_irq_trans_table); i++) { 1093 + struct irq_trans *t = &pci_irq_trans_table[i]; 1092 1094 1093 - #ifdef CONFIG_PCI 1094 - for (i = 0; i < ARRAY_SIZE(pci_irq_trans_table); i++) { 1095 - struct irq_trans *t = &pci_irq_trans_table[i]; 1096 - 1097 - if (!strcmp(model, t->name)) 1098 - return t->init(dp); 1095 + if (!strcmp(model, t->name)) 1096 + return t->init(dp); 1097 + } 1099 1098 } 1100 1099 #endif 1101 1100 #ifdef CONFIG_SBUS ··· 1102 1103 !strcmp(dp->name, "sbi")) 1103 1104 return sbus_irq_trans_init(dp); 1104 1105 #endif 1105 - if (!strcmp(dp->name, "central")) 1106 - return central_irq_trans_init(dp->child); 1106 + if (!strcmp(dp->name, "fhc") && 1107 + !strcmp(dp->parent->name, "central")) 1108 + return central_irq_trans_init(dp); 1107 1109 if (!strcmp(dp->name, "virtual-devices")) 1108 1110 return sun4v_vdev_irq_trans_init(dp); 1109 1111 } ··· 1516 1516 return buf; 1517 1517 } 1518 1518 1519 - static struct device_node * __init create_node(phandle node) 1519 + static struct device_node * __init create_node(phandle node, struct device_node *parent) 1520 1520 { 1521 1521 struct device_node *dp; 1522 1522 ··· 1525 1525 1526 1526 dp = prom_early_alloc(sizeof(*dp)); 1527 1527 dp->unique_id = unique_id++; 1528 + dp->parent = parent; 1528 1529 1529 1530 kref_init(&dp->kref); 1530 1531 ··· 1544 1543 { 1545 1544 struct device_node *dp; 1546 1545 1547 - dp = create_node(node); 1546 + dp = create_node(node, parent); 1548 1547 if (dp) { 1549 1548 *(*nextp) = dp; 1550 1549 *nextp = &dp->allnext; 1551 1550 1552 - dp->parent = parent; 1553 1551 dp->path_component_name = build_path_component(dp); 1554 1552 dp->full_name = build_full_name(dp); 1555 1553 ··· 1564 1564 { 1565 1565 struct device_node **nextp; 1566 1566 1567 - allnodes = create_node(prom_root_node); 1567 + allnodes = create_node(prom_root_node, NULL); 1568 1568 allnodes->path_component_name = ""; 1569 1569 allnodes->full_name = "/"; 1570 1570