All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: linux-nvdimm@lists.01.org
Subject: [PATCH 1/2] acpi, nfit: hide unknown commands from nmemX/commands
Date: Sun, 29 Oct 2017 12:49:13 -0700	[thread overview]
Message-ID: <150930655324.21067.13218039967325456169.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <150930654766.21067.7295669798909000270.stgit@dwillia2-desk3.amr.corp.intel.com>

For vendor specific commands that do not have a common kernel
translation, hide them from nmemX/commands. For example, the following
results from new enabling to probe for support of the new
NVDIMM_FAMILY_INTEL DSMs specified in v1.6 of the command specification
[1]:

    # cat /sys/bus/nd/devices/nmem0/commands
    smart smart_thresh flags get_size get_data set_data effect_size
    effect_log vendor cmd_call unknown unknown unknown unknown unknown
    unknown unknown unknown

[1]: https://pmem.io/documents/NVDIMM_DSM_Interface-V1.6.pdf

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/acpi/nfit/core.c |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index ebe0857ac346..e0059949700d 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -1769,8 +1769,22 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
 		 * userspace interface.
 		 */
 		cmd_mask = 1UL << ND_CMD_CALL;
-		if (nfit_mem->family == NVDIMM_FAMILY_INTEL)
-			cmd_mask |= nfit_mem->dsm_mask;
+		if (nfit_mem->family == NVDIMM_FAMILY_INTEL) {
+			/*
+			 * These commands have a 1:1 correspondence
+			 * between DSM payload and libnvdimm ioctl
+			 * payload format.
+			 */
+			cmd_mask |= nfit_mem->dsm_mask & (1 << ND_CMD_SMART
+					| 1 << ND_CMD_SMART_THRESHOLD
+					| 1 << ND_CMD_DIMM_FLAGS
+					| 1 << ND_CMD_GET_CONFIG_SIZE
+					| 1 << ND_CMD_GET_CONFIG_DATA
+					| 1 << ND_CMD_SET_CONFIG_DATA
+					| 1 << ND_CMD_VENDOR_EFFECT_LOG_SIZE
+					| 1 << ND_CMD_VENDOR_EFFECT_LOG
+					| 1 << ND_CMD_VENDOR);
+		}
 
 		if (nfit_mem->has_lsi)
 			set_bit(ND_CMD_GET_CONFIG_SIZE, &cmd_mask);

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

  reply	other threads:[~2017-10-29 19:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-29 19:49 [PATCH 0/2] acpi, nfit: support for new NVDIMM_FAMILY_INTEL commands Dan Williams
2017-10-29 19:49 ` Dan Williams [this message]
2017-10-29 19:49 ` [PATCH 2/2] acpi, nfit: add support for NVDIMM_FAMILY_INTEL v1.6 DSMs Dan Williams
2017-10-30 17:37   ` Dave Jiang
2017-10-30 17:43     ` Dan Williams

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=150930655324.21067.13218039967325456169.stgit@dwillia2-desk3.amr.corp.intel.com \
    --to=dan.j.williams@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.