linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] acpi, nfit: check for the correct event code in notifications
@ 2016-08-19 20:40 Vishal Verma
  2016-08-22 22:43 ` Dan Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Vishal Verma @ 2016-08-19 20:40 UTC (permalink / raw)
  To: linux-nvdimm
  Cc: linux-kernel, Linda Knippers, Vishal Verma, stable, linux-acpi,
	Dan Williams

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>
---
 drivers/acpi/nfit/core.c | 3 +++
 drivers/acpi/nfit/nfit.h | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 80cc7c0..4a363be 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)
 
 	dev_dbg(dev, "%s: event: %d\n", __func__, event);
 
+	if (event != NFIT_NOTIFY_UPDATE)
+		return;
+
 	device_lock(dev);
 	if (!dev->driver) {
 		/* 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 e894ded..51d23f1 100644
--- a/drivers/acpi/nfit/nfit.h
+++ b/drivers/acpi/nfit/nfit.h
@@ -78,6 +78,10 @@ enum {
 	NFIT_ARS_TIMEOUT = 90,
 };
 
+enum nfit_root_notifiers {
+	NFIT_NOTIFY_UPDATE = 0x80,
+};
+
 struct nfit_spa {
 	struct list_head list;
 	struct nd_region *nd_region;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] acpi, nfit: check for the correct event code in notifications
  2016-08-19 20:40 [PATCH] acpi, nfit: check for the correct event code in notifications Vishal Verma
@ 2016-08-22 22:43 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2016-08-22 22:43 UTC (permalink / raw)
  To: Vishal Verma
  Cc: linux-nvdimm@lists.01.org, linux-kernel, Linda Knippers, stable,
	Linux ACPI

On Fri, Aug 19, 2016 at 1:40 PM, Vishal Verma <vishal.l.verma@intel.com> wrote:
> 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>

Looks good to me.  Given the lead time of spec changes I think this
can wait for the 4.9 merge window.  I'll add it to the -next branch.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-22 22:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-19 20:40 [PATCH] acpi, nfit: check for the correct event code in notifications Vishal Verma
2016-08-22 22:43 ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).