aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishal Verma <vishal.l.verma@intel.com>2016-08-19 16:40:58 -0400
committerDan Williams <dan.j.williams@intel.com>2016-08-23 10:49:08 -0400
commitc09f12186d6b03b798832d95289af76495990192 (patch)
treee13e47bd7190438874b9a470a099f6d396ebeb23
parent02486c2905a7caa50b0f508a86e03d12d8d24ac4 (diff)
acpi, nfit: check for the correct event code in notifications
Commit 209851649dc4 "acpi: nfit: Add support for hot-add" added support for _FIT notifications, but it neglected to verify the notification event code matches the one in the ACPI spec for "NFIT Update". Currently there is only one code in the spec, but once additional codes are added, older kernels (without this fix) will misbehave by assuming all event notifications are for an NFIT Update. Fixes: 209851649dc4 ("acpi: nfit: Add support for hot-add") Cc: <stable@vger.kernel.org> Cc: <linux-acpi@vger.kernel.org> Cc: Dan Williams <dan.j.williams@intel.com> Reported-by: Linda Knippers <linda.knippers@hpe.com> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r--drivers/acpi/nfit/core.c3
-rw-r--r--drivers/acpi/nfit/nfit.h4
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 80cc7c089a15..4a363bed89b3 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -2681,6 +2681,9 @@ static void acpi_nfit_notify(struct acpi_device *adev, u32 event)
2681 2681
2682 dev_dbg(dev, "%s: event: %d\n", __func__, event); 2682 dev_dbg(dev, "%s: event: %d\n", __func__, event);
2683 2683
2684 if (event != NFIT_NOTIFY_UPDATE)
2685 return;
2686
2684 device_lock(dev); 2687 device_lock(dev);
2685 if (!dev->driver) { 2688 if (!dev->driver) {
2686 /* dev->driver may be null if we're being removed */ 2689 /* dev->driver may be null if we're being removed */
diff --git a/drivers/acpi/nfit/nfit.h b/drivers/acpi/nfit/nfit.h
index e894ded24d99..51d23f130d86 100644
--- a/drivers/acpi/nfit/nfit.h
+++ b/drivers/acpi/nfit/nfit.h
@@ -78,6 +78,10 @@ enum {
78 NFIT_ARS_TIMEOUT = 90, 78 NFIT_ARS_TIMEOUT = 90,
79}; 79};
80 80
81enum nfit_root_notifiers {
82 NFIT_NOTIFY_UPDATE = 0x80,
83};
84
81struct nfit_spa { 85struct nfit_spa {
82 struct list_head list; 86 struct list_head list;
83 struct nd_region *nd_region; 87 struct nd_region *nd_region;