|
@@ -152,24 +152,33 @@ int eeh_send_failure_event(struct eeh_pe *pe)
|
|
/**
|
|
/**
|
|
* eeh_remove_event - Remove EEH event from the queue
|
|
* eeh_remove_event - Remove EEH event from the queue
|
|
* @pe: Event binding to the PE
|
|
* @pe: Event binding to the PE
|
|
|
|
+ * @force: Event will be removed unconditionally
|
|
*
|
|
*
|
|
* On PowerNV platform, we might have subsequent coming events
|
|
* On PowerNV platform, we might have subsequent coming events
|
|
* is part of the former one. For that case, those subsequent
|
|
* is part of the former one. For that case, those subsequent
|
|
* coming events are totally duplicated and unnecessary, thus
|
|
* coming events are totally duplicated and unnecessary, thus
|
|
* they should be removed.
|
|
* they should be removed.
|
|
*/
|
|
*/
|
|
-void eeh_remove_event(struct eeh_pe *pe)
|
|
|
|
|
|
+void eeh_remove_event(struct eeh_pe *pe, bool force)
|
|
{
|
|
{
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
struct eeh_event *event, *tmp;
|
|
struct eeh_event *event, *tmp;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * If we have NULL PE passed in, we have dead IOC
|
|
|
|
+ * or we're sure we can report all existing errors
|
|
|
|
+ * by the caller.
|
|
|
|
+ *
|
|
|
|
+ * With "force", the event with associated PE that
|
|
|
|
+ * have been isolated, the event won't be removed
|
|
|
|
+ * to avoid event lost.
|
|
|
|
+ */
|
|
spin_lock_irqsave(&eeh_eventlist_lock, flags);
|
|
spin_lock_irqsave(&eeh_eventlist_lock, flags);
|
|
list_for_each_entry_safe(event, tmp, &eeh_eventlist, list) {
|
|
list_for_each_entry_safe(event, tmp, &eeh_eventlist, list) {
|
|
- /*
|
|
|
|
- * If we don't have valid PE passed in, that means
|
|
|
|
- * we already have event corresponding to dead IOC
|
|
|
|
- * and all events should be purged.
|
|
|
|
- */
|
|
|
|
|
|
+ if (!force && event->pe &&
|
|
|
|
+ (event->pe->state & EEH_PE_ISOLATED))
|
|
|
|
+ continue;
|
|
|
|
+
|
|
if (!pe) {
|
|
if (!pe) {
|
|
list_del(&event->list);
|
|
list_del(&event->list);
|
|
kfree(event);
|
|
kfree(event);
|