提交 101d5c18 编写于 作者: D David S. Miller

[SPARC64]: Fix PCI IRQ probing regression.

If the top-level cnode had multi entries in it's "reg"
property, we'd fail.  The buffer wasn't large enough in
such cases.
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 72aff53f
...@@ -675,7 +675,7 @@ static int __init pci_intmap_match(struct pci_dev *pdev, unsigned int *interrupt ...@@ -675,7 +675,7 @@ static int __init pci_intmap_match(struct pci_dev *pdev, unsigned int *interrupt
{ {
struct pcidev_cookie *dev_pcp = pdev->sysdata; struct pcidev_cookie *dev_pcp = pdev->sysdata;
struct pci_pbm_info *pbm = dev_pcp->pbm; struct pci_pbm_info *pbm = dev_pcp->pbm;
struct linux_prom_pci_registers reg; struct linux_prom_pci_registers reg[PROMREG_MAX];
unsigned int hi, mid, lo, irq; unsigned int hi, mid, lo, irq;
int i, cnode, plen; int i, cnode, plen;
...@@ -683,7 +683,7 @@ static int __init pci_intmap_match(struct pci_dev *pdev, unsigned int *interrupt ...@@ -683,7 +683,7 @@ static int __init pci_intmap_match(struct pci_dev *pdev, unsigned int *interrupt
if (cnode == pbm->prom_node) if (cnode == pbm->prom_node)
goto success; goto success;
plen = prom_getproperty(cnode, "reg", (char *) &reg, sizeof(reg)); plen = prom_getproperty(cnode, "reg", (char *) reg, sizeof(reg));
if (plen <= 0 || if (plen <= 0 ||
(plen % sizeof(struct linux_prom_pci_registers)) != 0) { (plen % sizeof(struct linux_prom_pci_registers)) != 0) {
printk("%s: OBP node %x reg property has bad len %d\n", printk("%s: OBP node %x reg property has bad len %d\n",
...@@ -691,9 +691,9 @@ static int __init pci_intmap_match(struct pci_dev *pdev, unsigned int *interrupt ...@@ -691,9 +691,9 @@ static int __init pci_intmap_match(struct pci_dev *pdev, unsigned int *interrupt
goto fail; goto fail;
} }
hi = reg.phys_hi & pbm->pbm_intmask.phys_hi; hi = reg[0].phys_hi & pbm->pbm_intmask.phys_hi;
mid = reg.phys_mid & pbm->pbm_intmask.phys_mid; mid = reg[0].phys_mid & pbm->pbm_intmask.phys_mid;
lo = reg.phys_lo & pbm->pbm_intmask.phys_lo; lo = reg[0].phys_lo & pbm->pbm_intmask.phys_lo;
irq = *interrupt & pbm->pbm_intmask.interrupt; irq = *interrupt & pbm->pbm_intmask.interrupt;
for (i = 0; i < pbm->num_pbm_intmap; i++) { for (i = 0; i < pbm->num_pbm_intmap; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册