diff options
author | Toshi Kani <toshi.kani@hpe.com> | 2017-06-08 14:36:57 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2017-06-15 17:39:42 -0400 |
commit | 56b47fe6579234e3102f1f28e26fa91fb6c38b3d (patch) | |
tree | 12f711e49e89ce38450caf20354ab3717857d907 | |
parent | 975750a98c26769fe54785579f4b26c961a7a6f4 (diff) |
acpi/nfit: Add support of NVDIMM memory error notification in ACPI 6.2
ACPI 6.2 defines a new ACPI notification value to NVDIMM Root Device
in Table 5-169.
0x81 Unconsumed Uncorrectable Memory Error Detected
Used to pro-actively notify OSPM of uncorrectable memory errors
detected (for example a memory scrubbing engine that continuously
scans the NVDIMMs memory). This is an optional notification. Only
locations that were mapped in to SPA by the platform will generate
a notification.
Add support of this notification value by initiating an ARS scan. This
will find new error locations and add their badblocks information.
Link: http://www.uefi.org/sites/default/files/resources/ACPI_6_2.pdf
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: Linda Knippers <linda.knippers@hpe.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | drivers/acpi/nfit/core.c | 28 | ||||
-rw-r--r-- | drivers/acpi/nfit/nfit.h | 1 |
2 files changed, 23 insertions, 6 deletions
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index b930d12f636b..facbc6107165 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c | |||
@@ -3016,7 +3016,7 @@ static int acpi_nfit_remove(struct acpi_device *adev) | |||
3016 | return 0; | 3016 | return 0; |
3017 | } | 3017 | } |
3018 | 3018 | ||
3019 | void __acpi_nfit_notify(struct device *dev, acpi_handle handle, u32 event) | 3019 | static void acpi_nfit_update_notify(struct device *dev, acpi_handle handle) |
3020 | { | 3020 | { |
3021 | struct acpi_nfit_desc *acpi_desc = dev_get_drvdata(dev); | 3021 | struct acpi_nfit_desc *acpi_desc = dev_get_drvdata(dev); |
3022 | struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL }; | 3022 | struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL }; |
@@ -3024,11 +3024,6 @@ void __acpi_nfit_notify(struct device *dev, acpi_handle handle, u32 event) | |||
3024 | acpi_status status; | 3024 | acpi_status status; |
3025 | int ret; | 3025 | int ret; |
3026 | 3026 | ||
3027 | dev_dbg(dev, "%s: event: %d\n", __func__, event); | ||
3028 | |||
3029 | if (event != NFIT_NOTIFY_UPDATE) | ||
3030 | return; | ||
3031 | |||
3032 | if (!dev->driver) { | 3027 | if (!dev->driver) { |
3033 | /* dev->driver may be null if we're being removed */ | 3028 | /* dev->driver may be null if we're being removed */ |
3034 | dev_dbg(dev, "%s: no driver found for dev\n", __func__); | 3029 | dev_dbg(dev, "%s: no driver found for dev\n", __func__); |
@@ -3065,6 +3060,27 @@ void __acpi_nfit_notify(struct device *dev, acpi_handle handle, u32 event) | |||
3065 | dev_err(dev, "Invalid _FIT\n"); | 3060 | dev_err(dev, "Invalid _FIT\n"); |
3066 | kfree(buf.pointer); | 3061 | kfree(buf.pointer); |
3067 | } | 3062 | } |
3063 | |||
3064 | static void acpi_nfit_uc_error_notify(struct device *dev, acpi_handle handle) | ||
3065 | { | ||
3066 | struct acpi_nfit_desc *acpi_desc = dev_get_drvdata(dev); | ||
3067 | |||
3068 | acpi_nfit_ars_rescan(acpi_desc); | ||
3069 | } | ||
3070 | |||
3071 | void __acpi_nfit_notify(struct device *dev, acpi_handle handle, u32 event) | ||
3072 | { | ||
3073 | dev_dbg(dev, "%s: event: 0x%x\n", __func__, event); | ||
3074 | |||
3075 | switch (event) { | ||
3076 | case NFIT_NOTIFY_UPDATE: | ||
3077 | return acpi_nfit_update_notify(dev, handle); | ||
3078 | case NFIT_NOTIFY_UC_MEMORY_ERROR: | ||
3079 | return acpi_nfit_uc_error_notify(dev, handle); | ||
3080 | default: | ||
3081 | return; | ||
3082 | } | ||
3083 | } | ||
3068 | EXPORT_SYMBOL_GPL(__acpi_nfit_notify); | 3084 | EXPORT_SYMBOL_GPL(__acpi_nfit_notify); |
3069 | 3085 | ||
3070 | static void acpi_nfit_notify(struct acpi_device *adev, u32 event) | 3086 | static void acpi_nfit_notify(struct acpi_device *adev, u32 event) |
diff --git a/drivers/acpi/nfit/nfit.h b/drivers/acpi/nfit/nfit.h index 29bdd959517f..e3da60b2d686 100644 --- a/drivers/acpi/nfit/nfit.h +++ b/drivers/acpi/nfit/nfit.h | |||
@@ -79,6 +79,7 @@ enum { | |||
79 | 79 | ||
80 | enum nfit_root_notifiers { | 80 | enum nfit_root_notifiers { |
81 | NFIT_NOTIFY_UPDATE = 0x80, | 81 | NFIT_NOTIFY_UPDATE = 0x80, |
82 | NFIT_NOTIFY_UC_MEMORY_ERROR = 0x81, | ||
82 | }; | 83 | }; |
83 | 84 | ||
84 | enum nfit_dimm_notifiers { | 85 | enum nfit_dimm_notifiers { |