Commit 321566c2 authored by David S. Miller's avatar David S. Miller Committed by David S. Miller

[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: default avatarDavid S. Miller <davem@davemloft.net>
parent 7244d545
...@@ -636,12 +636,17 @@ static void apb_init(struct pci_bus *sabre_bus) ...@@ -636,12 +636,17 @@ static void apb_init(struct pci_bus *sabre_bus)
static void sabre_scan_bus(struct pci_pbm_info *pbm) static void sabre_scan_bus(struct pci_pbm_info *pbm)
{ {
static int once; static int once;
struct pci_bus *pbus;
/* The APB bridge speaks to the Sabre host PCI bridge /* The APB bridge speaks to the Sabre host PCI bridge
* at 66Mhz, but the front side of APB runs at 33Mhz * at 66Mhz, but the front side of APB runs at 33Mhz
* for both segments. * for both segments.
*
* Hummingbird systems do not use APB, so they run
* at 66MHZ.
*/ */
if (hummingbird_p)
pbm->is_66mhz_capable = 1;
else
pbm->is_66mhz_capable = 0; pbm->is_66mhz_capable = 0;
/* This driver has not been verified to handle /* This driver has not been verified to handle
...@@ -656,13 +661,13 @@ static void sabre_scan_bus(struct pci_pbm_info *pbm) ...@@ -656,13 +661,13 @@ static void sabre_scan_bus(struct pci_pbm_info *pbm)
} }
once++; once++;
pbus = pci_scan_one_pbm(pbm); pbm->pci_bus = pci_scan_one_pbm(pbm);
if (!pbus) if (!pbm->pci_bus)
return; return;
sabre_root_bus = pbus; sabre_root_bus = pbm->pci_bus;
apb_init(pbus); apb_init(pbm->pci_bus);
sabre_register_error_handlers(pbm); sabre_register_error_handlers(pbm);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment