Thread (33 messages) flat view 33 messages, 3 authors, 2013-06-18
STALE4843d

Revision v4 of 4 in this series.

Revisions (4)
  1. v3 [diff vs current]
  2. v4 current
  3. v5 [diff vs current]
  4. v6 [diff vs current]

[PATCH 25/27] powerpc/eeh: Register OPAL notifier for PCI error

From: Gavin Shan <hidden>
Date: 2013-06-15 09:04:12
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

The patch intends to register OPAL event notifier and process the
PCI errors from firmware. If we have pending PCI errors, the kthread
will be invoked to handle that in turn.

Signed-off-by: Gavin Shan <redacted>
---
 arch/powerpc/platforms/powernv/pci-err.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/pci-err.c b/arch/powerpc/platforms/powernv/pci-err.c
index e54135b..9b5c4ae 100644
--- a/arch/powerpc/platforms/powernv/pci-err.c
+++ b/arch/powerpc/platforms/powernv/pci-err.c
@@ -425,6 +425,13 @@ static void pci_err_process(struct pci_controller *hose,
 	}
 }
 
+static void pci_err_event(u64 event)
+{
+	/* Notify kthread to process error */
+	if (event & OPAL_EVENT_PCI_ERROR)
+		up(&pci_err_int_sem);
+}
+
 static int pci_err_handler(void *dummy)
 {
 	struct pnv_phb *phb;
@@ -513,6 +520,16 @@ static int __init pci_err_init(void)
 		return ret;
 	}
 
+	/* Register OPAL event notifier */
+	ret = opal_notifier_register(OPAL_EVENT_PCI_ERROR, pci_err_event);
+	if (ret) {
+		kthread_stop(pci_err_thread);
+		free_page((unsigned long)pci_err_diag);
+		pr_err("%s: Failed to register OPAL notifier, rc=%d\n",
+		        __func__, ret);
+		return ret;
+	}
+
 	return 0;
 }
 
-- 
1.7.5.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help