aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-04-18 05:39:21 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-05-02 22:02:38 -0400
commit7fe3730de729b758e9f69b862b9255d998671b5f (patch)
tree2fc0cf3a003aaf6e8c257a32b748941e3eec93b2 /arch/sparc64
parentf282b97021ddc95c6092b9016f667c0963858fb1 (diff)
MSI: arch must connect the irq and the msi_desc
set_irq_msi() currently connects an irq_desc to an msi_desc. The archs call it at some point in their setup routine, and then the generic code sets up the reverse mapping from the msi_desc back to the irq. set_irq_msi() should do both connections, making it the one and only call required to connect an irq with it's MSI desc and vice versa. The arch code MUST call set_irq_msi(), and it must do so only once it's sure it's not going to fail the irq allocation. Given that there's no need for the arch to return the irq anymore, the return value from the arch setup routine just becomes 0 for success and anything else for failure. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/pci.c4
-rw-r--r--arch/sparc64/kernel/pci_sun4v.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index 023af41ad68d..9a549547cb2b 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -1092,10 +1092,10 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
1092 return -EINVAL; 1092 return -EINVAL;
1093 1093
1094 err = p->setup_msi_irq(&virt_irq, pdev, desc); 1094 err = p->setup_msi_irq(&virt_irq, pdev, desc);
1095 if (err < 0) 1095 if (err)
1096 return err; 1096 return err;
1097 1097
1098 return virt_irq; 1098 return 0;
1099} 1099}
1100 1100
1101void arch_teardown_msi_irq(unsigned int virt_irq) 1101void arch_teardown_msi_irq(unsigned int virt_irq)
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c
index 94295c219329..1ccf4c9a9a43 100644
--- a/arch/sparc64/kernel/pci_sun4v.c
+++ b/arch/sparc64/kernel/pci_sun4v.c
@@ -1169,8 +1169,6 @@ static int pci_sun4v_setup_msi_irq(unsigned int *virt_irq_p,
1169 if (!devino) 1169 if (!devino)
1170 goto out_err; 1170 goto out_err;
1171 1171
1172 set_irq_msi(*virt_irq_p, entry);
1173
1174 msiqid = ((devino - pbm->msiq_first_devino) + 1172 msiqid = ((devino - pbm->msiq_first_devino) +
1175 pbm->msiq_first); 1173 pbm->msiq_first);
1176 1174
@@ -1204,6 +1202,8 @@ static int pci_sun4v_setup_msi_irq(unsigned int *virt_irq_p,
1204 msg.address_lo = pbm->msi32_start; 1202 msg.address_lo = pbm->msi32_start;
1205 } 1203 }
1206 msg.data = msi_num; 1204 msg.data = msi_num;
1205
1206 set_irq_msi(*virt_irq_p, entry);
1207 write_msi_msg(*virt_irq_p, &msg); 1207 write_msi_msg(*virt_irq_p, &msg);
1208 1208
1209 irq_install_pre_handler(*virt_irq_p, 1209 irq_install_pre_handler(*virt_irq_p,