linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
* [4.4, 4.7 stable PATCH] acpi, nfit: check for the correct event code in notifications
@ 2016-10-24 21:58 Vishal Verma
  2016-10-26  9:23 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Vishal Verma @ 2016-10-24 21:58 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, linux-nvdimm

commit c09f12186d6b03b798832d95289af76495990192 upstream.

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")
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---

Note that the patch doesn't directly apply to stable-4.4, but using
'git am -3' works. Is this sufficient, or should I send a sepatate
patch for 4.4?

 drivers/acpi/nfit.c | 3 +++
 drivers/acpi/nfit.h | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index 375c10f..a071fe4 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -2605,6 +2605,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.h b/drivers/acpi/nfit.h
index 02b9ea1..e602fd2 100644
--- a/drivers/acpi/nfit.h
+++ b/drivers/acpi/nfit.h
@@ -73,6 +73,10 @@ enum {
 	NFIT_ARS_TIMEOUT = 90,
 };
 
+enum nfit_root_notifiers {
+	NFIT_NOTIFY_UPDATE = 0x80,
+};
+
 struct nfit_spa {
 	struct acpi_nfit_system_address *spa;
 	struct list_head list;
-- 
2.7.4

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [4.4, 4.7 stable PATCH] acpi, nfit: check for the correct event code in notifications
  2016-10-24 21:58 [4.4, 4.7 stable PATCH] acpi, nfit: check for the correct event code in notifications Vishal Verma
@ 2016-10-26  9:23 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2016-10-26  9:23 UTC (permalink / raw)
  To: Vishal Verma; +Cc: stable, linux-nvdimm

On Mon, Oct 24, 2016 at 03:58:06PM -0600, Vishal Verma wrote:
> commit c09f12186d6b03b798832d95289af76495990192 upstream.
> 
> 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")
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
> 
> Note that the patch doesn't directly apply to stable-4.4, but using
> 'git am -3' works. Is this sufficient, or should I send a sepatate
> patch for 4.4?

I've made it fit :)

thanks,

greg k-h
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

end of thread, other threads:[~2016-10-26  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-24 21:58 [4.4, 4.7 stable PATCH] acpi, nfit: check for the correct event code in notifications Vishal Verma
2016-10-26  9:23 ` Greg Kroah-Hartman

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).