aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/pci_sabre.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@ultra5.davemloft.net>2007-06-06 17:03:08 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-06-07 19:59:46 -0400
commit321566c2504445160b18e1508a73081579923a6b (patch)
treea81be2b3ca7f3423830faf79368cfc9c847c4af8 /arch/sparc64/kernel/pci_sabre.c
parent7244d545c123ff33a3a5bff7fcb96a07778c32d1 (diff)
[SPARC64]: Fix 2 bugs in PCI Sabre bus scanning.
If we are on hummingbird, bus runs at 66MHZ. pbm->pci_bus should be setup with the result of pci_scan_one_pbm() or else we deref NULL pointers in the error interrupt handlers. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/pci_sabre.c')
-rw-r--r--arch/sparc64/kernel/pci_sabre.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c
index 323d6c278518..22e1be5c7489 100644
--- a/arch/sparc64/kernel/pci_sabre.c
+++ b/arch/sparc64/kernel/pci_sabre.c
@@ -636,13 +636,18 @@ static void apb_init(struct pci_bus *sabre_bus)
636static void sabre_scan_bus(struct pci_pbm_info *pbm) 636static void sabre_scan_bus(struct pci_pbm_info *pbm)
637{ 637{
638 static int once; 638 static int once;
639 struct pci_bus *pbus;
640 639
641 /* The APB bridge speaks to the Sabre host PCI bridge 640 /* The APB bridge speaks to the Sabre host PCI bridge
642 * at 66Mhz, but the front side of APB runs at 33Mhz 641 * at 66Mhz, but the front side of APB runs at 33Mhz
643 * for both segments. 642 * for both segments.
643 *
644 * Hummingbird systems do not use APB, so they run
645 * at 66MHZ.
644 */ 646 */
645 pbm->is_66mhz_capable = 0; 647 if (hummingbird_p)
648 pbm->is_66mhz_capable = 1;
649 else
650 pbm->is_66mhz_capable = 0;
646 651
647 /* This driver has not been verified to handle 652 /* This driver has not been verified to handle
648 * multiple SABREs yet, so trap this. 653 * multiple SABREs yet, so trap this.
@@ -656,13 +661,13 @@ static void sabre_scan_bus(struct pci_pbm_info *pbm)
656 } 661 }
657 once++; 662 once++;
658 663
659 pbus = pci_scan_one_pbm(pbm); 664 pbm->pci_bus = pci_scan_one_pbm(pbm);
660 if (!pbus) 665 if (!pbm->pci_bus)
661 return; 666 return;
662 667
663 sabre_root_bus = pbus; 668 sabre_root_bus = pbm->pci_bus;
664 669
665 apb_init(pbus); 670 apb_init(pbm->pci_bus);
666 671
667 sabre_register_error_handlers(pbm); 672 sabre_register_error_handlers(pbm);
668} 673}