[PATCH 2/3] libnvdimm, namespace_devs: add function nd_region_reset_ns_seed for namespace seed reset

2018-09-10 Thread Ocean He
From: Ocean He During runtime, if a namespace seed is used for new namespace creation but fail, then it needs to be reset for next namespace creation. Add function nd_region_reset_ns_seed for namespace seed reset and declare it in nd-core.h. Signed-off-by: Ocean He --- drivers/nvdimm

[PATCH 3/3] libnvdimm, region_devs: reset related seeds when fail to create namespace

2018-09-10 Thread Ocean He
From: Ocean He During runtime, namespace creation may fail if blocked by commit 15d36fecd0bdc7510b70 ("mm: disallow mappings that conflict for devm_memremap_pages()"). To ensure pfn_seed/dax_seed and namespace_seed are ready for next namespace creation, here to do detach and reset.

[PATCH 1/3] libnvdimm, claim: remove static attribute of nd_detach_and_reset

2018-09-10 Thread Ocean He
From: Ocean He The function nd_detach_and_reset needs to be called externally, so remove the static attribute and declare it in nd-core.h. Signed-off-by: Ocean He --- drivers/nvdimm/claim.c | 2 +- drivers/nvdimm/nd-core.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH 0/3] libnvdimm: reset seeds for next namespace creation

2018-09-10 Thread Ocean He
From: Ocean He When pmem namespaces created are smaller than section size twice, the second creation would fail and meanwhile there is a kernel call trace which comes from commit 15d36fecd0bdc7510b70 ("mm: disallow mappings that conflict for devm_memremap_pages()"). ---

[PATCH v2] libnvdimm, region_devs: stop NDD_ALIASING bit test if one test pass

2018-09-04 Thread Ocean He
From: Ocean He There is no need to finish entire loop to execute NDD_ALIASING bit test against every nvdimm->flags. In practice, all the nd_mapping->nvdimm have the same flags. So it's safe to return ND_DEVICE_NAMESPACE_PMEM if the NDD_ALIASING bit is found inside the loop, while saving

[PATCH] libnvdimm, region_devs: stop NDD_ALIASING bit test if one test pass

2018-08-18 Thread Ocean He
From: Ocean He There is no need to finish entire loop to execute NDD_ALIASING bit test against every nvdimm->flags. In practice, all the nd_mapping->nvdimm have the same flags. Because the check of alias is "if (alias)" but not "if (alias == nd_region->ndr_mappings

[PATCH] ACPI: nfit: check dcr immediately following its assignment codes

2018-08-08 Thread Ocean He
From: Ocean He In commit 6697b2cf69d43632 ("nfit: fix multi-interface dimm handling, acpi6.1 compatibility"), the check codes of dcr were just following its assignment codes. But they were separated by commit ad9ac5e1957531a8 ("nfit: always associate flush hints"). Just ch

[PATCH] ACPI: nfit: adjust annotation for why return 0 if fail to find NFIT at startup

2018-08-07 Thread Ocean He
From: Ocean He Add detail explanation why it's ok to return 0 if fail to find NFIT at startup, refer to chapter 9.20.2 NVDIMM Root Device in ACPI 6.2 spec. Signed-off-by: Ocean He --- v1: https://lists.01.org/pipermail/linux-nvdimm/2018-August/017311.html v2: Per Vishal's comments of v1

[PATCH] libnvdimm, bus: check id immediately following ida_simple_get

2018-08-03 Thread Ocean He
From: Ocean He The id check was not executed immediately following ida_simple_get. Just change the codes position, without function change. Signed-off-by: Ocean He --- drivers/nvdimm/bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvdimm/bus.c b/drivers

[PATCH] ACPI: nfit: return -ENODEV if fail to find NFIT at startup

2018-08-03 Thread Ocean He
From: Ocean He In the beginning of acpi_nfit_add, if fail to find NFIT table then should return -ENODEV, instead of 0. Signed-off-by: Ocean He --- drivers/acpi/nfit/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c