netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Read back MSI message in rtas_setup_msi_irqs() so restore works
@ 2007-10-23  4:23 Michael Ellerman
  2007-11-07 21:29 ` Linas Vepstas
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Ellerman @ 2007-10-23  4:23 UTC (permalink / raw)
  To: Paul Mackerras
  Cc: netdev, mcarlson, linuxppc-dev, mchan, linux-pci, David S. Miller

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>
---

Linas, can you test this on your setup with your EEH stuff? I haven't got
any MSI supporting hardware/firmware combination.


 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 2793a1b..f15222b 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)
 	struct pci_dn *pdn;
 	int hwirq, virq, i, rc;
 	struct msi_desc *entry;
+	struct msi_msg msg;
 
 	pdn = get_pdn(pdev);
 	if (!pdn)
@@ -213,6 +214,11 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
 
 		dev_dbg(&pdev->dev, "rtas_msi: allocated virq %d\n", virq);
 		set_irq_msi(virq, entry);
+
+		/* Read config space back so we can restore after reset */
+		read_msi_msg(virq, &msg);
+		entry->msg = msg;
+
 		unmask_msi_irq(virq);
 	}
 
-- 
1.5.1.3.g7a33b

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Read back MSI message in rtas_setup_msi_irqs() so restore works
  2007-10-23  4:23 [PATCH] Read back MSI message in rtas_setup_msi_irqs() so restore works Michael Ellerman
@ 2007-11-07 21:29 ` Linas Vepstas
  0 siblings, 0 replies; 2+ messages in thread
From: Linas Vepstas @ 2007-11-07 21:29 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Paul Mackerras, linuxppc-dev, netdev, David S. Miller, mchan,
	mcarlson, linux-pci, Benjamin Herrenschmidt

On Tue, Oct 23, 2007 at 02:23:44PM +1000, Michael Ellerman wrote:
> 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>
> ---
> 
> Linas, can you test this on your setup with your EEH stuff? I haven't got
> any MSI supporting hardware/firmware combination.

Acked-by: Linas Vepstas <linas@austin.ibm.com>

I *finally* was able to get onto some hardware long enough to run this.
And that took a lot of work. Sigh. Yes, this is exactly what I'd wanted.

--linas

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-07 21:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-23  4:23 [PATCH] Read back MSI message in rtas_setup_msi_irqs() so restore works Michael Ellerman
2007-11-07 21:29 ` Linas Vepstas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).