Skip to content

Commit

Permalink
GHES: Elliminate double-loop in the NMI handler
Browse files Browse the repository at this point in the history
There's no real need to iterate twice over the HW error sources in the
NMI handler. With the previous cleanups, elliminating the second loop is
almost trivial.

Signed-off-by: Borislav Petkov <[email protected]>
  • Loading branch information
suryasaimadhu committed Apr 27, 2015
1 parent 6169ddf commit 2383844
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions drivers/acpi/apei/ghes.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,25 +851,18 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
if (sev >= GHES_SEV_PANIC)
__ghes_panic(ghes);

ret = NMI_HANDLED;
}

if (ret == NMI_DONE)
goto out;

list_for_each_entry_rcu(ghes, &ghes_nmi, list) {
if (!(ghes->flags & GHES_TO_CLEAR))
continue;

__process_error(ghes);
ghes_clear_estatus(ghes);

ret = NMI_HANDLED;
}

#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
irq_work_queue(&ghes_proc_irq_work);
#endif

out:
raw_spin_unlock(&ghes_nmi_lock);
return ret;
}
Expand Down

0 comments on commit 2383844

Please sign in to comment.