aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-09-21 01:00:40 -0400
committerDavid S. Miller <davem@davemloft.net>2008-09-21 01:00:40 -0400
commit7ee766d8fba9dfd93bf3eca7a8d84a25404a68dc (patch)
tree34b017e2eb3e560c15a41089b894a4125bca7d89 /arch/sparc64
parent9843099ff46467461d6476a827f6f9701682dbac (diff)
sparc64: Fix disappearing PCI devices on e3500.
Based upon a bug report by Meelis Roos. The OF device layer builds properties by matching bus types and applying 'range' properties as appropriate, up to the root. The match for "PCI" busses is looking at the 'device_type' property, and this does work %99 of the time. But on an E3500 system with a PCI QFE card, the DEC 21153 bridge sitting above the QFE network interface devices has a 'name' of "pci", but it completely lacks a 'device_type' property. So we don't match it as a PCI bus, and subsequently we end up with no resource values at all for the devices sitting under that DEC bridge. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/of_device.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c
index f845f150f565..100ebd527499 100644
--- a/arch/sparc64/kernel/of_device.c
+++ b/arch/sparc64/kernel/of_device.c
@@ -169,7 +169,7 @@ static unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long fla
169 169
170static int of_bus_pci_match(struct device_node *np) 170static int of_bus_pci_match(struct device_node *np)
171{ 171{
172 if (!strcmp(np->type, "pci") || !strcmp(np->type, "pciex")) { 172 if (!strcmp(np->name, "pci")) {
173 const char *model = of_get_property(np, "model", NULL); 173 const char *model = of_get_property(np, "model", NULL);
174 174
175 if (model && !strcmp(model, "SUNW,simba")) 175 if (model && !strcmp(model, "SUNW,simba"))
@@ -200,7 +200,7 @@ static int of_bus_simba_match(struct device_node *np)
200 /* Treat PCI busses lacking ranges property just like 200 /* Treat PCI busses lacking ranges property just like
201 * simba. 201 * simba.
202 */ 202 */
203 if (!strcmp(np->type, "pci") || !strcmp(np->type, "pciex")) { 203 if (!strcmp(np->name, "pci")) {
204 if (!of_find_property(np, "ranges", NULL)) 204 if (!of_find_property(np, "ranges", NULL))
205 return 1; 205 return 1;
206 } 206 }
@@ -429,7 +429,7 @@ static int __init use_1to1_mapping(struct device_node *pp)
429 * it lacks a ranges property, and this will include 429 * it lacks a ranges property, and this will include
430 * cases like Simba. 430 * cases like Simba.
431 */ 431 */
432 if (!strcmp(pp->type, "pci") || !strcmp(pp->type, "pciex")) 432 if (!strcmp(pp->name, "pci"))
433 return 0; 433 return 0;
434 434
435 return 1; 435 return 1;
@@ -714,8 +714,7 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
714 break; 714 break;
715 } 715 }
716 } else { 716 } else {
717 if (!strcmp(pp->type, "pci") || 717 if (!strcmp(pp->name, "pci")) {
718 !strcmp(pp->type, "pciex")) {
719 unsigned int this_orig_irq = irq; 718 unsigned int this_orig_irq = irq;
720 719
721 irq = pci_irq_swizzle(dp, pp, irq); 720 irq = pci_irq_swizzle(dp, pp, irq);