Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c50ceae authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull libnvdimm fixes from Dan Williams:
 "A regression fix, new unit test infrastructure and a build fix:

   - Regression fix addressing support for the new NVDIMM label storage
     area access commands (_LSI, _LSR, and _LSW).

     The Intel specific version of these commands communicated the
     "Device Locked" status on the label-storage-information command.

     However, these new commands (standardized in ACPI 6.2) communicate
     the "Device Locked" status on the label-storage-read command, and
     the driver was missing the indication.

     Reading from locked persistent memory is similar to reading
     unmapped PCI memory space, returns all 1's.

   - Unit test infrastructure is added to regression test the "Device
     Locked" detection failure.

   - A build fix is included to allow the "of_pmem" driver to be built
     as a module and translate an Open Firmware described device to its
     local numa node"

* 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
  MAINTAINERS: Add backup maintainers for libnvdimm and DAX
  device-dax: allow MAP_SYNC to succeed
  Revert "libnvdimm, of_pmem: workaround OF_NUMA=n build error"
  libnvdimm, of_pmem: use dev_to_node() instead of of_node_to_nid()
  tools/testing/nvdimm: enable labels for nfit_test.1 dimms
  tools/testing/nvdimm: fix missing newline in nfit_test_dimm 'handle' attribute
  tools/testing/nvdimm: support nfit_test_dimm attributes under nfit_test.1
  tools/testing/nvdimm: allow custom error code injection
  libnvdimm, dimm: handle EACCES failures from label reads
parents 5e7c7806 c5794510
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -4248,6 +4248,9 @@ F: include/trace/events/fs_dax.h

DEVICE DIRECT ACCESS (DAX)
M:	Dan Williams <dan.j.williams@intel.com>
M:	Dave Jiang <dave.jiang@intel.com>
M:	Ross Zwisler <ross.zwisler@linux.intel.com>
M:	Vishal Verma <vishal.l.verma@intel.com>
L:	linux-nvdimm@lists.01.org
S:	Supported
F:	drivers/dax/
@@ -8060,6 +8063,9 @@ F: tools/lib/lockdep/

LIBNVDIMM BLK: MMIO-APERTURE DRIVER
M:	Ross Zwisler <ross.zwisler@linux.intel.com>
M:	Dan Williams <dan.j.williams@intel.com>
M:	Vishal Verma <vishal.l.verma@intel.com>
M:	Dave Jiang <dave.jiang@intel.com>
L:	linux-nvdimm@lists.01.org
Q:	https://patchwork.kernel.org/project/linux-nvdimm/list/
S:	Supported
@@ -8068,6 +8074,9 @@ F: drivers/nvdimm/region_devs.c

LIBNVDIMM BTT: BLOCK TRANSLATION TABLE
M:	Vishal Verma <vishal.l.verma@intel.com>
M:	Dan Williams <dan.j.williams@intel.com>
M:	Ross Zwisler <ross.zwisler@linux.intel.com>
M:	Dave Jiang <dave.jiang@intel.com>
L:	linux-nvdimm@lists.01.org
Q:	https://patchwork.kernel.org/project/linux-nvdimm/list/
S:	Supported
@@ -8075,6 +8084,9 @@ F: drivers/nvdimm/btt*

LIBNVDIMM PMEM: PERSISTENT MEMORY DRIVER
M:	Ross Zwisler <ross.zwisler@linux.intel.com>
M:	Dan Williams <dan.j.williams@intel.com>
M:	Vishal Verma <vishal.l.verma@intel.com>
M:	Dave Jiang <dave.jiang@intel.com>
L:	linux-nvdimm@lists.01.org
Q:	https://patchwork.kernel.org/project/linux-nvdimm/list/
S:	Supported
@@ -8090,6 +8102,9 @@ F: Documentation/devicetree/bindings/pmem/pmem-region.txt

LIBNVDIMM: NON-VOLATILE MEMORY DEVICE SUBSYSTEM
M:	Dan Williams <dan.j.williams@intel.com>
M:	Ross Zwisler <ross.zwisler@linux.intel.com>
M:	Vishal Verma <vishal.l.verma@intel.com>
M:	Dave Jiang <dave.jiang@intel.com>
L:	linux-nvdimm@lists.01.org
Q:	https://patchwork.kernel.org/project/linux-nvdimm/list/
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <linux/dax.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/mman.h>
#include "dax-private.h"
#include "dax.h"

@@ -540,6 +541,7 @@ static const struct file_operations dax_fops = {
	.release = dax_release,
	.get_unmapped_area = dax_get_unmapped_area,
	.mmap = dax_mmap,
	.mmap_supported_flags = MAP_SYNC,
};

static void dev_dax_release(struct device *dev)
+1 −2
Original line number Diff line number Diff line
@@ -103,8 +103,7 @@ config NVDIMM_DAX
	  Select Y if unsure

config OF_PMEM
	# FIXME: make tristate once OF_NUMA dependency removed
	bool "Device-tree support for persistent memory regions"
	tristate "Device-tree support for persistent memory regions"
	depends on OF
	default LIBNVDIMM
	help
+12 −10
Original line number Diff line number Diff line
@@ -88,9 +88,9 @@ int nvdimm_init_nsarea(struct nvdimm_drvdata *ndd)
int nvdimm_init_config_data(struct nvdimm_drvdata *ndd)
{
	struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(ndd->dev);
	int rc = validate_dimm(ndd), cmd_rc = 0;
	struct nd_cmd_get_config_data_hdr *cmd;
	struct nvdimm_bus_descriptor *nd_desc;
	int rc = validate_dimm(ndd);
	u32 max_cmd_size, config_size;
	size_t offset;

@@ -124,9 +124,11 @@ int nvdimm_init_config_data(struct nvdimm_drvdata *ndd)
		cmd->in_offset = offset;
		rc = nd_desc->ndctl(nd_desc, to_nvdimm(ndd->dev),
				ND_CMD_GET_CONFIG_DATA, cmd,
				cmd->in_length + sizeof(*cmd), NULL);
		if (rc || cmd->status) {
			rc = -ENXIO;
				cmd->in_length + sizeof(*cmd), &cmd_rc);
		if (rc < 0)
			break;
		if (cmd_rc < 0) {
			rc = cmd_rc;
			break;
		}
		memcpy(ndd->data + offset, cmd->out_buf, cmd->in_length);
@@ -140,9 +142,9 @@ int nvdimm_init_config_data(struct nvdimm_drvdata *ndd)
int nvdimm_set_config_data(struct nvdimm_drvdata *ndd, size_t offset,
		void *buf, size_t len)
{
	int rc = validate_dimm(ndd);
	size_t max_cmd_size, buf_offset;
	struct nd_cmd_set_config_hdr *cmd;
	int rc = validate_dimm(ndd), cmd_rc = 0;
	struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(ndd->dev);
	struct nvdimm_bus_descriptor *nd_desc = nvdimm_bus->nd_desc;

@@ -164,7 +166,6 @@ int nvdimm_set_config_data(struct nvdimm_drvdata *ndd, size_t offset,
	for (buf_offset = 0; len; len -= cmd->in_length,
			buf_offset += cmd->in_length) {
		size_t cmd_size;
		u32 *status;

		cmd->in_offset = offset + buf_offset;
		cmd->in_length = min(max_cmd_size, len);
@@ -172,12 +173,13 @@ int nvdimm_set_config_data(struct nvdimm_drvdata *ndd, size_t offset,

		/* status is output in the last 4-bytes of the command buffer */
		cmd_size = sizeof(*cmd) + cmd->in_length + sizeof(u32);
		status = ((void *) cmd) + cmd_size - sizeof(u32);

		rc = nd_desc->ndctl(nd_desc, to_nvdimm(ndd->dev),
				ND_CMD_SET_CONFIG_DATA, cmd, cmd_size, NULL);
		if (rc || *status) {
			rc = rc ? rc : -ENXIO;
				ND_CMD_SET_CONFIG_DATA, cmd, cmd_size, &cmd_rc);
		if (rc < 0)
			break;
		if (cmd_rc < 0) {
			rc = cmd_rc;
			break;
		}
	}
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ static int of_pmem_region_probe(struct platform_device *pdev)
		 */
		memset(&ndr_desc, 0, sizeof(ndr_desc));
		ndr_desc.attr_groups = region_attr_groups;
		ndr_desc.numa_node = of_node_to_nid(np);
		ndr_desc.numa_node = dev_to_node(&pdev->dev);
		ndr_desc.res = &pdev->resource[i];
		ndr_desc.of_node = np;
		set_bit(ND_REGION_PAGEMAP, &ndr_desc.flags);
Loading