The original implementation builds EEH event based on EEH device.
We already had dedicated struct to depict PE. It's reasonable to
build EEH event based on PE.

Signed-off-by: Gavin Shan <sha...@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/eeh_event.h       |    4 ++--
 arch/powerpc/platforms/pseries/eeh_event.c |   29 ++++++++--------------------
 2 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/arch/powerpc/include/asm/eeh_event.h 
b/arch/powerpc/include/asm/eeh_event.h
index c68b012..dc722b5 100644
--- a/arch/powerpc/include/asm/eeh_event.h
+++ b/arch/powerpc/include/asm/eeh_event.h
@@ -28,10 +28,10 @@
  */
 struct eeh_event {
        struct list_head        list;   /* to form event queue  */
-       struct eeh_dev          *edev;  /* EEH device           */
+       struct eeh_pe           *pe;    /* EEH PE               */
 };
 
-int eeh_send_failure_event(struct eeh_dev *edev);
+int eeh_send_failure_event(struct eeh_pe *pe);
 struct eeh_dev *handle_eeh_events(struct eeh_event *);
 
 #endif /* __KERNEL__ */
diff --git a/arch/powerpc/platforms/pseries/eeh_event.c 
b/arch/powerpc/platforms/pseries/eeh_event.c
index 87fea2e..ab8ca18 100644
--- a/arch/powerpc/platforms/pseries/eeh_event.c
+++ b/arch/powerpc/platforms/pseries/eeh_event.c
@@ -117,36 +117,23 @@ static void eeh_thread_launcher(struct work_struct *dummy)
 
 /**
  * eeh_send_failure_event - Generate a PCI error event
- * @edev: EEH device
+ * @pe: EEH PE
  *
  * This routine can be called within an interrupt context;
  * the actual event will be delivered in a normal context
  * (from a workqueue).
  */
-int eeh_send_failure_event(struct eeh_dev *edev)
+int eeh_send_failure_event(struct eeh_pe *pe)
 {
        unsigned long flags;
        struct eeh_event *event;
-       struct device_node *dn = eeh_dev_to_of_node(edev);
-       const char *location;
-
-       if (!mem_init_done) {
-               printk(KERN_ERR "EEH: event during early boot not handled\n");
-               location = of_get_property(dn, "ibm,loc-code", NULL);
-               printk(KERN_ERR "EEH: device node = %s\n", dn->full_name);
-               printk(KERN_ERR "EEH: PCI location = %s\n", location);
-               return 1;
-       }
-       event = kzalloc(sizeof(*event), GFP_ATOMIC);
-       if (event == NULL) {
-               printk(KERN_ERR "EEH: out of memory, event not handled\n");
-               return 1;
-       }
-
-       if (edev->pdev)
-               pci_dev_get(edev->pdev);
 
-       event->edev = edev;
+       event = kzalloc(sizeof(*event), GFP_ATOMIC);
+       if (!event) {
+               pr_err("EEH: out of memory, event not handled\n");
+               return -ENOMEM;
+       }
+       event->pe = pe;
 
        /* We may or may not be called in an interrupt context */
        spin_lock_irqsave(&eeh_eventlist_lock, flags);
-- 
1.7.9.5

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to