[POWERPC] EEH: rm un-needed data
authorLinas Vepstas <linas@austin.ibm.com>
Mon, 19 Mar 2007 19:59:10 +0000 (14:59 -0500)
committerPaul Mackerras <paulus@samba.org>
Thu, 22 Mar 2007 11:52:55 +0000 (22:52 +1100)
The EEH event notification system passes around data that is
not needed or at least, not used properly. Stop passing this
data; get it in a more reliable fashion.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/pseries/eeh.c
arch/powerpc/platforms/pseries/eeh_driver.c
arch/powerpc/platforms/pseries/eeh_event.c
include/asm-powerpc/eeh_event.h

index c4604f71c962fb0fefe41ce3cc24a2750bb4983d..1d05c9b55605eca7608c4f04bd990b2e9d15aeda 100644 (file)
@@ -346,7 +346,6 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
        int rets[3];
        unsigned long flags;
        struct pci_dn *pdn;
-       enum pci_channel_state state;
        int rc = 0;
 
        total_mmio_ffs++;
@@ -452,12 +451,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
        eeh_mark_slot (dn, EEH_MODE_ISOLATED);
        spin_unlock_irqrestore(&confirm_error_lock, flags);
 
-       state = pci_channel_io_normal;
-       if ((rets[0] == 1) || (rets[0] == 2) || (rets[0] == 4))
-               state = pci_channel_io_frozen;
-       if (rets[0] == 5)
-               state = pci_channel_io_perm_failure;
-       eeh_send_failure_event (dn, dev, state, rets[2]);
+       eeh_send_failure_event (dn, dev);
 
        /* Most EEH events are due to device driver bugs.  Having
         * a stack trace will help the device-driver authors figure
index 5ec6edf19ece5cd9fa8cf8f7dbb2c9ee4eaae69b..6493f593687f7c575c18dd86a547b094d8636d06 100644 (file)
@@ -342,13 +342,6 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)
                return NULL;
        }
 
-#if 0
-       /* We may get "permanent failure" messages on empty slots.
-        * These are false alarms. Empty slots have no child dn. */
-       if ((event->state == pci_channel_io_perm_failure) && (frozen_device == NULL))
-               return;
-#endif
-
        frozen_pdn = PCI_DN(frozen_dn);
        frozen_pdn->eeh_freeze_count++;
 
@@ -363,12 +356,9 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)
        if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES)
                goto excess_failures;
 
-       /* If the reset state is a '5' and the time to reset is 0 (infinity)
-        * or is more then 15 seconds, then mark this as a permanent failure.
-        */
-       if ((event->state == pci_channel_io_perm_failure) &&
-           ((event->time_unavail <= 0) ||
-            (event->time_unavail > MAX_WAIT_FOR_RECOVERY*1000))) {
+       /* Get the current PCI slot state. */
+       rc = eeh_wait_for_slot_status (frozen_pdn, MAX_WAIT_FOR_RECOVERY*1000);
+       if (rc < 0) {
                printk(KERN_WARNING "EEH: Permanent failure\n");
                goto hard_fail;
        }
index 49037edf7d3999545c9190d2d7fd0e0594330f49..221dec8c16bd3b5fe8edb504578f3e395fe5b8c4 100644 (file)
@@ -118,9 +118,7 @@ static void eeh_thread_launcher(struct work_struct *dummy)
  * (from a workqueue).
  */
 int eeh_send_failure_event (struct device_node *dn,
-                            struct pci_dev *dev,
-                            enum pci_channel_state state,
-                            int time_unavail)
+                            struct pci_dev *dev)
 {
        unsigned long flags;
        struct eeh_event *event;
@@ -144,8 +142,6 @@ int eeh_send_failure_event (struct device_node *dn,
 
        event->dn = dn;
        event->dev = dev;
-       event->state = state;
-       event->time_unavail = time_unavail;
 
        /* We may or may not be called in an interrupt context */
        spin_lock_irqsave(&eeh_eventlist_lock, flags);
index dc6bf0ffb796afb25fe707c85c9147169742665f..cc3cb04539ac4972874000b01e95cd6f8e98ae6c 100644 (file)
@@ -30,8 +30,6 @@ struct eeh_event {
        struct list_head     list;
        struct device_node      *dn;   /* struct device node */
        struct pci_dev       *dev;  /* affected device */
-       enum pci_channel_state state; /* PCI bus state for the affected device */
-       int time_unavail;    /* milliseconds until device might be available */
 };
 
 /**
@@ -46,9 +44,7 @@ struct eeh_event {
  * (from a workqueue).
  */
 int eeh_send_failure_event (struct device_node *dn,
-                            struct pci_dev *dev,
-                            enum pci_channel_state state,
-                            int time_unavail);
+                            struct pci_dev *dev);
 
 /* Main recovery function */
 struct pci_dn * handle_eeh_events (struct eeh_event *);