]> git.baikalelectronics.ru Git - kernel.git/commit
nfit, address-range-scrub: rework and simplify ARS state machine
authorDan Williams <dan.j.williams@intel.com>
Thu, 5 Apr 2018 23:18:55 +0000 (16:18 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sat, 7 Apr 2018 14:55:05 +0000 (07:55 -0700)
commitfe50624243f8d73301d770d108b7b15be6a9ab36
treefcb0a7821f2ebdec33968cc6600b72cd1ee2d123
parent99e8dfdef242070002e660b5605faa7b08c53bce
nfit, address-range-scrub: rework and simplify ARS state machine

ARS is an operation that can take 10s to 100s of seconds to find media
errors that should rarely be present. If the platform crashes due to
media errors in persistent memory, the expectation is that the BIOS will
report those known errors in a 'short' ARS request.

A 'short' ARS request asks platform firmware to return an ARS payload
with all known errors, but without issuing a 'long' scrub. At driver
init a short request is issued to all PMEM ranges before registering
regions. Then, in the background, a long ARS is scheduled for each
region.

The ARS implementation is simplified to centralize ARS completion work
in the ars_complete() helper. The timeout is removed since there is no
facility to cancel ARS, and this otherwise arranges for system init to
never be blocked waiting for a 'long' ARS. The ars_state flags are used
to coordinate ARS requests from driver init, ARS requests from
userspace, and ARS requests in response to media error notifications.

Given that there is no notification of ARS completion the implementation
still needs to poll. It backs off exponentially to a maximum poll period
of 30 minutes.

Suggested-by: Toshi Kani <toshi.kani@hpe.com>
Co-developed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/acpi/nfit/core.c
drivers/acpi/nfit/nfit.h