arm64: acpi: Make apei_claim_sea() synchronise with APEI's irq work
authorJames Morse <james.morse@arm.com>
Fri, 1 May 2020 16:45:43 +0000 (17:45 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 19 May 2020 17:51:11 +0000 (19:51 +0200)
commit8fcc4ae6faf8b455eeef00bc9ae70744e3b0f462
tree88aa885e59229f4f1b59b7fa0972aa43b642ed6c
parent7f17b4a121d0d50eca22cb1edebf0a157f3e43bf
arm64: acpi: Make apei_claim_sea() synchronise with APEI's irq work

APEI is unable to do all of its error handling work in nmi-context, so
it defers non-fatal work onto the irq_work queue. arch_irq_work_raise()
sends an IPI to the calling cpu, but this is not guaranteed to be taken
before returning to user-space.

Unless the exception interrupted a context with irqs-masked,
irq_work_run() can run immediately. Otherwise return -EINPROGRESS to
indicate ghes_notify_sea() found some work to do, but it hasn't
finished yet.

With this apei_claim_sea() returning '0' means this external-abort was
also notification of a firmware-first RAS error, and that APEI has
processed the CPER records.

Signed-off-by: James Morse <james.morse@arm.com>
Tested-by: Tyler Baicar <baicar@os.amperecomputing.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
arch/arm64/kernel/acpi.c
arch/arm64/mm/fault.c