diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2007-10-23 00:23:44 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-11-07 22:15:29 -0500 |
commit | 1db3e890aed3ac39cded30d6e94618bda086f7ce (patch) | |
tree | afef5e36585ee399e35e2e6e28f3f4af8e626594 /arch/powerpc/platforms/pseries/msi.c | |
parent | bdd71eec9b24fb6f7e83148f73c2312a42b2aed5 (diff) |
[POWERPC] Read back MSI message in rtas_setup_msi_irqs() so restore works
There are plans afoot to use pci_restore_msi_state() to restore MSI
state after a device reset. In order for this to work for the RTAS MSI
backend, we need to read back the MSI message from config space after
it has been setup by firmware.
This should be sufficient for restoring the MSI state after a device
reset, however we will need to revisit this for suspend to disk if that
is ever implemented on pseries.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/msi.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/msi.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c index 2793a1b100e6..f15222bbe136 100644 --- a/arch/powerpc/platforms/pseries/msi.c +++ b/arch/powerpc/platforms/pseries/msi.c | |||
@@ -171,6 +171,7 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | |||
171 | struct pci_dn *pdn; | 171 | struct pci_dn *pdn; |
172 | int hwirq, virq, i, rc; | 172 | int hwirq, virq, i, rc; |
173 | struct msi_desc *entry; | 173 | struct msi_desc *entry; |
174 | struct msi_msg msg; | ||
174 | 175 | ||
175 | pdn = get_pdn(pdev); | 176 | pdn = get_pdn(pdev); |
176 | if (!pdn) | 177 | if (!pdn) |
@@ -213,6 +214,11 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | |||
213 | 214 | ||
214 | dev_dbg(&pdev->dev, "rtas_msi: allocated virq %d\n", virq); | 215 | dev_dbg(&pdev->dev, "rtas_msi: allocated virq %d\n", virq); |
215 | set_irq_msi(virq, entry); | 216 | set_irq_msi(virq, entry); |
217 | |||
218 | /* Read config space back so we can restore after reset */ | ||
219 | read_msi_msg(virq, &msg); | ||
220 | entry->msg = msg; | ||
221 | |||
216 | unmask_msi_irq(virq); | 222 | unmask_msi_irq(virq); |
217 | } | 223 | } |
218 | 224 | ||