linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: linux-nvdimm@lists.01.org
Cc: Dexuan Cui <decui@microsoft.com>, linux-kernel@vger.kernel.org
Subject: [PATCH] acpi/nfit: Require opt-in for read-only label configurations
Date: Sun, 03 Feb 2019 11:28:50 -0800	[thread overview]
Message-ID: <154922213038.3561630.15221922065373676874.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <CAPcyv4iMau=fvOfubDvK=cg5v5287TvXqBCm=p8nqbz2es6YEg@mail.gmail.com>

Recent fixes to command handling enabled Linux to read label
configurations that it could not before. Unfortunately that means that
configurations that were operating in label-less mode will be broken as
the kernel ignores the existing namespace configuration and tries to
honor the new found labels.

Fortunately this seems limited to a case where Linux can quirk the
behavior and maintain the existing label-less semantics by default.
When the platform does not emit an _LSW method, disable all label access
methods. Provide a 'force_labels' module parameter to allow read-only
label operation.

Fixes: 11189c1089da ("acpi/nfit: Fix command-supported detection")
Reported-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/acpi/nfit/core.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 811c399a3a76..5b5e802de7b8 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -56,6 +56,10 @@ static bool no_init_ars;
 module_param(no_init_ars, bool, 0644);
 MODULE_PARM_DESC(no_init_ars, "Skip ARS run at nfit init time");
 
+static bool force_labels;
+module_param(force_labels, bool, 0444);
+MODULE_PARM_DESC(force_labels, "Opt-in to labels despite missing methods");
+
 LIST_HEAD(acpi_descs);
 DEFINE_MUTEX(acpi_desc_lock);
 
@@ -1916,6 +1920,19 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
 			dev_dbg(dev, "%s: has _LSW\n", dev_name(&adev_dimm->dev));
 			set_bit(NFIT_MEM_LSW, &nfit_mem->flags);
 		}
+
+		/*
+		 * Quirk read-only label configurations to preserve
+		 * access to label-less namespaces by default.
+		 */
+		if (!test_bit(NFIT_MEM_LSW, &nfit_mem->flags)
+				&& !force_labels) {
+			dev_dbg(dev, "%s: No _LSW, disable labels\n",
+					dev_name(&adev_dimm->dev));
+			clear_bit(NFIT_MEM_LSR, &nfit_mem->flags);
+		} else
+			dev_dbg(dev, "%s: Force enable labels\n",
+					dev_name(&adev_dimm->dev));
 	}
 
 	populate_shutdown_status(nfit_mem);


  reply	other threads:[~2019-02-03 19:41 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-29  0:56 [PATCH v2] nfit: add Hyper-V NVDIMM DSM command set to white list Dexuan Cui
2019-01-30  6:23 ` Dan Williams
2019-02-01 17:14   ` Dexuan Cui
2019-02-01 17:29     ` Dan Williams
2019-02-01 23:17       ` Dexuan Cui
2019-02-01 23:47         ` Dan Williams
2019-02-02  0:34           ` Dexuan Cui
2019-02-02  0:47             ` Dan Williams
2019-02-02  1:06             ` Dexuan Cui
2019-02-02  1:28               ` Dan Williams
2019-02-02  2:17                 ` Dexuan Cui
2019-02-02  5:27                   ` Dan Williams
2019-02-02  3:32                 ` Dexuan Cui
2019-02-02  5:26                   ` Dan Williams
2019-02-03  1:13     ` [PATCH] libnvdimm/dimm: Add a no-BLK quirk based on NVDIMM family Dan Williams
2019-02-03 14:31       ` kbuild test robot
2019-02-03 17:39         ` Dexuan Cui
2019-02-03 14:38       ` kbuild test robot
2019-02-03 17:40         ` Dexuan Cui
2019-02-03 17:21       ` Dexuan Cui
2019-02-03 17:49         ` Dan Williams
2019-02-03 18:13           ` Dexuan Cui
2019-02-03 19:13             ` Dan Williams
2019-02-03 19:28               ` Dan Williams [this message]
2019-02-04  5:45                 ` [PATCH] acpi/nfit: Require opt-in for read-only label configurations Dexuan Cui
2019-02-05 16:53               ` [PATCH] libnvdimm/dimm: Add a no-BLK quirk based on NVDIMM family Dexuan Cui
2019-02-05 17:11                 ` Dan Williams
2019-02-06  0:57                   ` Dexuan Cui
2019-02-13  4:14       ` [PATCH v2] " Dan Williams
2019-02-13  9:41         ` Johannes Thumshirn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=154922213038.3561630.15221922065373676874.stgit@dwillia2-desk3.amr.corp.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=decui@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).