Returned mail: see transcript for details

2018-01-30 Thread cowboy
The original message was received at Wed, 31 Jan 2018 11:37:21 +0800
from rj3.net [204.6.51.242]

- The following addresses had permanent fatal errors -


- Transcript of session follows -
  while talking to lists.01.org.:
>>> MAIL From:cow...@rj3.net
<<< 501 cow...@rj3.net... Refused



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


[PATCH v4 2/4] acpi: nfit: add persistent memory control flag for nd_region

2018-01-30 Thread Dave Jiang
Propagate the ADR attribute flag from the NFIT platform capabilities
sub-table to nd_region.

Signed-off-by: Dave Jiang 
Reviewed-by: Ross Zwisler 
---
 drivers/acpi/nfit/core.c  |3 +++
 include/linux/libnvdimm.h |6 ++
 2 files changed, 9 insertions(+)

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index bcf52bb93b65..b1616120ca57 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -2668,6 +2668,9 @@ static int acpi_nfit_register_region(struct 
acpi_nfit_desc *acpi_desc,
if(acpi_desc->platform_cap & ACPI_NFIT_CAPABILITY_CACHE_FLUSH)
set_bit(ND_REGION_PERSIST_CACHE, _desc->flags);
 
+   if (acpi_desc->platform_cap & ACPI_NFIT_CAPABILITY_MEM_FLUSH)
+   set_bit(ND_REGION_PERSIST_MEMCTRL, _desc->flags);
+
list_for_each_entry(nfit_memdev, _desc->memdevs, list) {
struct acpi_nfit_memory_map *memdev = nfit_memdev->memdev;
struct nd_mapping_desc *mapping;
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h
index f2fc0da4da04..ff855ed965fb 100644
--- a/include/linux/libnvdimm.h
+++ b/include/linux/libnvdimm.h
@@ -52,6 +52,12 @@ enum {
 * system power loss.
 */
ND_REGION_PERSIST_CACHE = 1,
+   /*
+* Platform provides mechanisms to automatically flush outstanding
+* write data from memory controler to pmem on system power loss.
+* (ADR)
+*/
+   ND_REGION_PERSIST_MEMCTRL = 2,
 
/* mark newly adjusted resources as requiring a label update */
DPA_RESOURCE_ADJUSTED = 1 << 0,

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


[PATCH v4 3/4] libnvdimm: expose platform persistence attribute for nd_region

2018-01-30 Thread Dave Jiang
Providing a sysfs attribute for nd_region that shows the persistence
capabilities for the platform.

Signed-off-by: Dave Jiang 
Reviewed-by: Ross Zwisler 
---
 drivers/nvdimm/region_devs.c |   13 +
 1 file changed, 13 insertions(+)

diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c
index abaf38c61220..e6d01911e092 100644
--- a/drivers/nvdimm/region_devs.c
+++ b/drivers/nvdimm/region_devs.c
@@ -528,6 +528,18 @@ static ssize_t resource_show(struct device *dev,
 }
 static DEVICE_ATTR_RO(resource);
 
+static ssize_t persistence_domain_show(struct device *dev,
+   struct device_attribute *attr, char *buf)
+{
+   struct nd_region *nd_region = to_nd_region(dev);
+   unsigned long flags = nd_region->flags;
+
+   return sprintf(buf, "%s%s\n",
+   flags & BIT(ND_REGION_PERSIST_CACHE) ? "cpu_cache " : 
"",
+   flags & BIT(ND_REGION_PERSIST_MEMCTRL) ? 
"memory_controller " : "");
+}
+static DEVICE_ATTR_RO(persistence_domain);
+
 static struct attribute *nd_region_attributes[] = {
_attr_size.attr,
_attr_nstype.attr,
@@ -543,6 +555,7 @@ static struct attribute *nd_region_attributes[] = {
_attr_init_namespaces.attr,
_attr_badblocks.attr,
_attr_resource.attr,
+   _attr_persistence_domain.attr,
NULL,
 };
 

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


[PATCH v4 0/4] add support for platform persistence capabilities

2018-01-30 Thread Dave Jiang
ACPI 6.2a provides an NFIT sub-table that informs if the platform has
auto CPU flush and memory flush on unexpected power loss events. This series
propogates those attributes to nd_region and add sysfs attribute to show
those capabilities.

v4:
Fixed typos and added Reviewed-by tags from Ross.

v3:
Addressed Ross's comments
- fixed mask calculation for platform cap
- fixed nfit_test nfit_buf size calcuation
- fixed offset for test data structure

v2:
Per Dan's comments
- Added ADR cap flags propogation
- Added sysfs attribute

---

Dave Jiang (4):
  acpi: nfit: Add support for detect platform CPU cache flush on power loss
  acpi: nfit: add persistent memory control flag for nd_region
  libnvdimm: expose platform persistence attribute for nd_region
  nfit-test: Add platform cap support from ACPI 6.2a to test


 drivers/acpi/nfit/core.c |   23 +++
 drivers/acpi/nfit/nfit.h |1 +
 drivers/nvdimm/pmem.c|4 +++-
 drivers/nvdimm/region_devs.c |   13 +
 include/linux/libnvdimm.h|   11 +++
 tools/testing/nvdimm/test/nfit.c |   14 --
 6 files changed, 63 insertions(+), 3 deletions(-)

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


[PATCH v4 1/4] acpi: nfit: Add support for detect platform CPU cache flush on power loss

2018-01-30 Thread Dave Jiang
In ACPI 6.2a the platform capability structure has been added to the NFIT
tables. That provides software the ability to determine whether a system
supports the auto flushing of CPU caches on power loss. If the capability
is supported, we do not need to do dax_flush(). Plumbing the path to set the
property on per region from the NFIT tables.

This patch depends on the ACPI NFIT 6.2a platform capabilities support code
in include/acpi/actbl1.h.

Signed-off-by: Dave Jiang 
Reviewed-by: Ross Zwisler 
---
 drivers/acpi/nfit/core.c  |   20 
 drivers/acpi/nfit/nfit.h  |1 +
 drivers/nvdimm/pmem.c |4 +++-
 include/linux/libnvdimm.h |5 +
 4 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index ff2580e7611d..bcf52bb93b65 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -838,6 +838,18 @@ static bool add_flush(struct acpi_nfit_desc *acpi_desc,
return true;
 }
 
+static bool add_platform_cap(struct acpi_nfit_desc *acpi_desc,
+   struct acpi_nfit_capabilities *pcap)
+{
+   struct device *dev = acpi_desc->dev;
+   u32 mask;
+
+   mask = (1 << (pcap->highest_capability + 1)) - 1;
+   acpi_desc->platform_cap = pcap->capabilities & mask;
+   dev_dbg(dev, "%s: cap: %#x\n", __func__, acpi_desc->platform_cap);
+   return true;
+}
+
 static void *add_table(struct acpi_nfit_desc *acpi_desc,
struct nfit_table_prev *prev, void *table, const void *end)
 {
@@ -883,6 +895,10 @@ static void *add_table(struct acpi_nfit_desc *acpi_desc,
case ACPI_NFIT_TYPE_SMBIOS:
dev_dbg(dev, "%s: smbios\n", __func__);
break;
+   case ACPI_NFIT_TYPE_CAPABILITIES:
+   if (!add_platform_cap(acpi_desc, table))
+   return err;
+   break;
default:
dev_err(dev, "unknown table '%d' parsing nfit\n", hdr->type);
break;
@@ -2649,6 +2665,9 @@ static int acpi_nfit_register_region(struct 
acpi_nfit_desc *acpi_desc,
else
ndr_desc->numa_node = NUMA_NO_NODE;
 
+   if(acpi_desc->platform_cap & ACPI_NFIT_CAPABILITY_CACHE_FLUSH)
+   set_bit(ND_REGION_PERSIST_CACHE, _desc->flags);
+
list_for_each_entry(nfit_memdev, _desc->memdevs, list) {
struct acpi_nfit_memory_map *memdev = nfit_memdev->memdev;
struct nd_mapping_desc *mapping;
@@ -3457,6 +3476,7 @@ static __init int nfit_init(void)
BUILD_BUG_ON(sizeof(struct acpi_nfit_smbios) != 9);
BUILD_BUG_ON(sizeof(struct acpi_nfit_control_region) != 80);
BUILD_BUG_ON(sizeof(struct acpi_nfit_data_region) != 40);
+   BUILD_BUG_ON(sizeof(struct acpi_nfit_capabilities) != 16);
 
guid_parse(UUID_VOLATILE_MEMORY, _uuid[NFIT_SPA_VOLATILE]);
guid_parse(UUID_PERSISTENT_MEMORY, _uuid[NFIT_SPA_PM]);
diff --git a/drivers/acpi/nfit/nfit.h b/drivers/acpi/nfit/nfit.h
index f0cf18b2da8b..50d36e166d70 100644
--- a/drivers/acpi/nfit/nfit.h
+++ b/drivers/acpi/nfit/nfit.h
@@ -202,6 +202,7 @@ struct acpi_nfit_desc {
unsigned long dimm_cmd_force_en;
unsigned long bus_cmd_force_en;
unsigned long bus_nfit_cmd_force_en;
+   unsigned int platform_cap;
int (*blk_do_io)(struct nd_blk_region *ndbr, resource_size_t dpa,
void *iobuf, u64 len, int rw);
 };
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 7fbc5c5dc8e1..8aa542398db4 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -35,6 +35,7 @@
 #include "pmem.h"
 #include "pfn.h"
 #include "nd.h"
+#include "nd-core.h"
 
 static struct device *to_dev(struct pmem_device *pmem)
 {
@@ -334,7 +335,8 @@ static int pmem_attach_disk(struct device *dev,
dev_warn(dev, "unable to guarantee persistence of writes\n");
fua = 0;
}
-   wbc = nvdimm_has_cache(nd_region);
+   wbc = nvdimm_has_cache(nd_region) &&
+   !test_bit(ND_REGION_PERSIST_CACHE, _region->flags);
 
if (!devm_request_mem_region(dev, res->start, resource_size(res),
dev_name(>dev))) {
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h
index f8109ddb5ef1..f2fc0da4da04 100644
--- a/include/linux/libnvdimm.h
+++ b/include/linux/libnvdimm.h
@@ -47,6 +47,11 @@ enum {
 
/* region flag indicating to direct-map persistent memory by default */
ND_REGION_PAGEMAP = 0,
+   /*
+* Platform ensures entire CPU store data path is flushed to pmem on
+* system power loss.
+*/
+   ND_REGION_PERSIST_CACHE = 1,
 
/* mark newly adjusted resources as requiring a label update */
DPA_RESOURCE_ADJUSTED = 1 << 0,

___
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org

[PATCH v4 4/4] nfit-test: Add platform cap support from ACPI 6.2a to test

2018-01-30 Thread Dave Jiang
Adding NFIT platform capabilities sub table in nfit_test simulated ACPI
NFIT table. Only the first NFIT table is added with the capability
sub-table.

Signed-off-by: Dave Jiang 
Reviewed-by: Ross Zwisler 
---
 tools/testing/nvdimm/test/nfit.c |   14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
index 7217b2b953b5..f4791e6e70cf 100644
--- a/tools/testing/nvdimm/test/nfit.c
+++ b/tools/testing/nvdimm/test/nfit.c
@@ -881,7 +881,8 @@ static int nfit_test0_alloc(struct nfit_test *t)
window_size) * NUM_DCR
+ sizeof(struct acpi_nfit_data_region) * NUM_BDW
+ (sizeof(struct acpi_nfit_flush_address)
-   + sizeof(u64) * NUM_HINTS) * NUM_DCR;
+   + sizeof(u64) * NUM_HINTS) * NUM_DCR
+   + sizeof(struct acpi_nfit_capabilities);
int i;
 
t->nfit_buf = test_alloc(t, nfit_size, >nfit_dma);
@@ -993,6 +994,7 @@ static void nfit_test0_setup(struct nfit_test *t)
struct acpi_nfit_control_region *dcr;
struct acpi_nfit_data_region *bdw;
struct acpi_nfit_flush_address *flush;
+   struct acpi_nfit_capabilities *pcap;
unsigned int offset, i;
 
/*
@@ -1500,8 +1502,16 @@ static void nfit_test0_setup(struct nfit_test *t)
for (i = 0; i < NUM_HINTS; i++)
flush->hint_address[i] = t->flush_dma[3] + i * sizeof(u64);
 
+   /* platform capabilities */
+   pcap = nfit_buf + offset + flush_hint_size * 4;
+   pcap->header.type = ACPI_NFIT_TYPE_CAPABILITIES;
+   pcap->header.length = sizeof(*pcap);
+   pcap->highest_capability = BIT(2);
+   pcap->capabilities = ACPI_NFIT_CAPABILITY_CACHE_FLUSH |
+   ACPI_NFIT_CAPABILITY_MEM_FLUSH;
+
if (t->setup_hotplug) {
-   offset = offset + flush_hint_size * 4;
+   offset = offset + flush_hint_size * 4 + sizeof(*pcap);
/* dcr-descriptor4: blk */
dcr = nfit_buf + offset;
dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION;

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


Re: [PATCH v3 4/4] nfit-test: Add platform cap support from ACPI 6.2a to test

2018-01-30 Thread Ross Zwisler
On Tue, Jan 30, 2018 at 05:01:29PM -0700, Dave Jiang wrote:
> Adding NFIT platform capabilities sub table in nfit_test simulated ACPI
> NFIT table. Only the first NFIT table is added with the capability
> sub-table.
> 
> Signed-off-by: Dave Jiang 

This looks good to me.  You can add:

Reviewed-by: Ross Zwisler 
___
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm


Re: [PATCH v3 1/4] acpi: nfit: Add support for detect platform CPU cache flush on power loss

2018-01-30 Thread Ross Zwisler
On Tue, Jan 30, 2018 at 05:01:13PM -0700, Dave Jiang wrote:
> In ACPI 6.2a the platform capability structure has been added to the NFIT
> tables. That provides software the ability to determine whether a system
> supports the auto flushing of CPU caches on power loss. If the capability
> is supported, we do not need to do dax_flush(). Plumbing the path to set the
> property on per region from the NFTI tables.
  NFIT
> 
> This patch depends on the ACPI NFIT 6.2a platform capabilities support code
> in include/acpi/actbl1.h.
> 
> Signed-off-by: Dave Jiang 

Looks good aside from the one nit.

Reviewed-by: Ross Zwisler 
___
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm


[PATCH v3 4/4] nfit-test: Add platform cap support from ACPI 6.2a to test

2018-01-30 Thread Dave Jiang
Adding NFIT platform capabilities sub table in nfit_test simulated ACPI
NFIT table. Only the first NFIT table is added with the capability
sub-table.

Signed-off-by: Dave Jiang 
---
 tools/testing/nvdimm/test/nfit.c |   14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
index 7217b2b953b5..f4791e6e70cf 100644
--- a/tools/testing/nvdimm/test/nfit.c
+++ b/tools/testing/nvdimm/test/nfit.c
@@ -881,7 +881,8 @@ static int nfit_test0_alloc(struct nfit_test *t)
window_size) * NUM_DCR
+ sizeof(struct acpi_nfit_data_region) * NUM_BDW
+ (sizeof(struct acpi_nfit_flush_address)
-   + sizeof(u64) * NUM_HINTS) * NUM_DCR;
+   + sizeof(u64) * NUM_HINTS) * NUM_DCR
+   + sizeof(struct acpi_nfit_capabilities);
int i;
 
t->nfit_buf = test_alloc(t, nfit_size, >nfit_dma);
@@ -993,6 +994,7 @@ static void nfit_test0_setup(struct nfit_test *t)
struct acpi_nfit_control_region *dcr;
struct acpi_nfit_data_region *bdw;
struct acpi_nfit_flush_address *flush;
+   struct acpi_nfit_capabilities *pcap;
unsigned int offset, i;
 
/*
@@ -1500,8 +1502,16 @@ static void nfit_test0_setup(struct nfit_test *t)
for (i = 0; i < NUM_HINTS; i++)
flush->hint_address[i] = t->flush_dma[3] + i * sizeof(u64);
 
+   /* platform capabilities */
+   pcap = nfit_buf + offset + flush_hint_size * 4;
+   pcap->header.type = ACPI_NFIT_TYPE_CAPABILITIES;
+   pcap->header.length = sizeof(*pcap);
+   pcap->highest_capability = BIT(2);
+   pcap->capabilities = ACPI_NFIT_CAPABILITY_CACHE_FLUSH |
+   ACPI_NFIT_CAPABILITY_MEM_FLUSH;
+
if (t->setup_hotplug) {
-   offset = offset + flush_hint_size * 4;
+   offset = offset + flush_hint_size * 4 + sizeof(*pcap);
/* dcr-descriptor4: blk */
dcr = nfit_buf + offset;
dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION;

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


[PATCH v3 1/4] acpi: nfit: Add support for detect platform CPU cache flush on power loss

2018-01-30 Thread Dave Jiang
In ACPI 6.2a the platform capability structure has been added to the NFIT
tables. That provides software the ability to determine whether a system
supports the auto flushing of CPU caches on power loss. If the capability
is supported, we do not need to do dax_flush(). Plumbing the path to set the
property on per region from the NFTI tables.

This patch depends on the ACPI NFIT 6.2a platform capabilities support code
in include/acpi/actbl1.h.

Signed-off-by: Dave Jiang 
---
 drivers/acpi/nfit/core.c  |   20 
 drivers/acpi/nfit/nfit.h  |1 +
 drivers/nvdimm/pmem.c |4 +++-
 include/linux/libnvdimm.h |5 +
 4 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index ff2580e7611d..bcf52bb93b65 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -838,6 +838,18 @@ static bool add_flush(struct acpi_nfit_desc *acpi_desc,
return true;
 }
 
+static bool add_platform_cap(struct acpi_nfit_desc *acpi_desc,
+   struct acpi_nfit_capabilities *pcap)
+{
+   struct device *dev = acpi_desc->dev;
+   u32 mask;
+
+   mask = (1 << (pcap->highest_capability + 1)) - 1;
+   acpi_desc->platform_cap = pcap->capabilities & mask;
+   dev_dbg(dev, "%s: cap: %#x\n", __func__, acpi_desc->platform_cap);
+   return true;
+}
+
 static void *add_table(struct acpi_nfit_desc *acpi_desc,
struct nfit_table_prev *prev, void *table, const void *end)
 {
@@ -883,6 +895,10 @@ static void *add_table(struct acpi_nfit_desc *acpi_desc,
case ACPI_NFIT_TYPE_SMBIOS:
dev_dbg(dev, "%s: smbios\n", __func__);
break;
+   case ACPI_NFIT_TYPE_CAPABILITIES:
+   if (!add_platform_cap(acpi_desc, table))
+   return err;
+   break;
default:
dev_err(dev, "unknown table '%d' parsing nfit\n", hdr->type);
break;
@@ -2649,6 +2665,9 @@ static int acpi_nfit_register_region(struct 
acpi_nfit_desc *acpi_desc,
else
ndr_desc->numa_node = NUMA_NO_NODE;
 
+   if(acpi_desc->platform_cap & ACPI_NFIT_CAPABILITY_CACHE_FLUSH)
+   set_bit(ND_REGION_PERSIST_CACHE, _desc->flags);
+
list_for_each_entry(nfit_memdev, _desc->memdevs, list) {
struct acpi_nfit_memory_map *memdev = nfit_memdev->memdev;
struct nd_mapping_desc *mapping;
@@ -3457,6 +3476,7 @@ static __init int nfit_init(void)
BUILD_BUG_ON(sizeof(struct acpi_nfit_smbios) != 9);
BUILD_BUG_ON(sizeof(struct acpi_nfit_control_region) != 80);
BUILD_BUG_ON(sizeof(struct acpi_nfit_data_region) != 40);
+   BUILD_BUG_ON(sizeof(struct acpi_nfit_capabilities) != 16);
 
guid_parse(UUID_VOLATILE_MEMORY, _uuid[NFIT_SPA_VOLATILE]);
guid_parse(UUID_PERSISTENT_MEMORY, _uuid[NFIT_SPA_PM]);
diff --git a/drivers/acpi/nfit/nfit.h b/drivers/acpi/nfit/nfit.h
index f0cf18b2da8b..50d36e166d70 100644
--- a/drivers/acpi/nfit/nfit.h
+++ b/drivers/acpi/nfit/nfit.h
@@ -202,6 +202,7 @@ struct acpi_nfit_desc {
unsigned long dimm_cmd_force_en;
unsigned long bus_cmd_force_en;
unsigned long bus_nfit_cmd_force_en;
+   unsigned int platform_cap;
int (*blk_do_io)(struct nd_blk_region *ndbr, resource_size_t dpa,
void *iobuf, u64 len, int rw);
 };
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 7fbc5c5dc8e1..8aa542398db4 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -35,6 +35,7 @@
 #include "pmem.h"
 #include "pfn.h"
 #include "nd.h"
+#include "nd-core.h"
 
 static struct device *to_dev(struct pmem_device *pmem)
 {
@@ -334,7 +335,8 @@ static int pmem_attach_disk(struct device *dev,
dev_warn(dev, "unable to guarantee persistence of writes\n");
fua = 0;
}
-   wbc = nvdimm_has_cache(nd_region);
+   wbc = nvdimm_has_cache(nd_region) &&
+   !test_bit(ND_REGION_PERSIST_CACHE, _region->flags);
 
if (!devm_request_mem_region(dev, res->start, resource_size(res),
dev_name(>dev))) {
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h
index f8109ddb5ef1..f2fc0da4da04 100644
--- a/include/linux/libnvdimm.h
+++ b/include/linux/libnvdimm.h
@@ -47,6 +47,11 @@ enum {
 
/* region flag indicating to direct-map persistent memory by default */
ND_REGION_PAGEMAP = 0,
+   /*
+* Platform ensures entire CPU store data path is flushed to pmem on
+* system power loss.
+*/
+   ND_REGION_PERSIST_CACHE = 1,
 
/* mark newly adjusted resources as requiring a label update */
DPA_RESOURCE_ADJUSTED = 1 << 0,

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


[PATCH v3 3/4] libnvdimm: expose platform persistence attribute for nd_region

2018-01-30 Thread Dave Jiang
Providing a sysfs attribute for nd_region that shows the persistence
capabilities for the platform.

Signed-off-by: Dave Jiang 
---
 drivers/nvdimm/region_devs.c |   13 +
 1 file changed, 13 insertions(+)

diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c
index abaf38c61220..e6d01911e092 100644
--- a/drivers/nvdimm/region_devs.c
+++ b/drivers/nvdimm/region_devs.c
@@ -528,6 +528,18 @@ static ssize_t resource_show(struct device *dev,
 }
 static DEVICE_ATTR_RO(resource);
 
+static ssize_t persistence_domain_show(struct device *dev,
+   struct device_attribute *attr, char *buf)
+{
+   struct nd_region *nd_region = to_nd_region(dev);
+   unsigned long flags = nd_region->flags;
+
+   return sprintf(buf, "%s%s\n",
+   flags & BIT(ND_REGION_PERSIST_CACHE) ? "cpu_cache " : 
"",
+   flags & BIT(ND_REGION_PERSIST_MEMCTRL) ? 
"memory_controller " : "");
+}
+static DEVICE_ATTR_RO(persistence_domain);
+
 static struct attribute *nd_region_attributes[] = {
_attr_size.attr,
_attr_nstype.attr,
@@ -543,6 +555,7 @@ static struct attribute *nd_region_attributes[] = {
_attr_init_namespaces.attr,
_attr_badblocks.attr,
_attr_resource.attr,
+   _attr_persistence_domain.attr,
NULL,
 };
 

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


[PATCH v3 2/4] acpi: nfit: add persistent memory control flag for nd_region

2018-01-30 Thread Dave Jiang
Propagate the ADR attribute flag from the NFIT platform capabilities
sub-table to nd_region.

Signed-off-by: Dave Jiang 
---
 drivers/acpi/nfit/core.c  |3 +++
 include/linux/libnvdimm.h |6 ++
 2 files changed, 9 insertions(+)

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index bcf52bb93b65..b1616120ca57 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -2668,6 +2668,9 @@ static int acpi_nfit_register_region(struct 
acpi_nfit_desc *acpi_desc,
if(acpi_desc->platform_cap & ACPI_NFIT_CAPABILITY_CACHE_FLUSH)
set_bit(ND_REGION_PERSIST_CACHE, _desc->flags);
 
+   if (acpi_desc->platform_cap & ACPI_NFIT_CAPABILITY_MEM_FLUSH)
+   set_bit(ND_REGION_PERSIST_MEMCTRL, _desc->flags);
+
list_for_each_entry(nfit_memdev, _desc->memdevs, list) {
struct acpi_nfit_memory_map *memdev = nfit_memdev->memdev;
struct nd_mapping_desc *mapping;
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h
index f2fc0da4da04..ff855ed965fb 100644
--- a/include/linux/libnvdimm.h
+++ b/include/linux/libnvdimm.h
@@ -52,6 +52,12 @@ enum {
 * system power loss.
 */
ND_REGION_PERSIST_CACHE = 1,
+   /*
+* Platform provides mechanisms to automatically flush outstanding
+* write data from memory controler to pmem on system power loss.
+* (ADR)
+*/
+   ND_REGION_PERSIST_MEMCTRL = 2,
 
/* mark newly adjusted resources as requiring a label update */
DPA_RESOURCE_ADJUSTED = 1 << 0,

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


[PATCH v3 0/4] add support for platform persistence capabilities

2018-01-30 Thread Dave Jiang
ACPI 6.2a provides an NFIT sub-table that informs if the platform has
auto CPU flush and memory flush on unexpected power loss events. This series
propogates those attributes to nd_region and add sysfs attribute to show
those capabilities.

v3:
Addressed Ross's comments
- fixed mask calculation for platform cap
- fixed nfit_test nfit_buf size calcuation
- fixed offset for test data structure

v2:
Per Dan's comments
- Added ADR cap flags propogation
- Added sysfs attribute

---

Dave Jiang (4):
  acpi: nfit: Add support for detect platform CPU cache flush on power loss
  acpi: nfit: add persistent memory control flag for nd_region
  libnvdimm: expose platform persistence attribute for nd_region
  nfit-test: Add platform cap support from ACPI 6.2a to test


 drivers/acpi/nfit/core.c |   23 +++
 drivers/acpi/nfit/nfit.h |1 +
 drivers/nvdimm/pmem.c|4 +++-
 drivers/nvdimm/region_devs.c |   13 +
 include/linux/libnvdimm.h|   11 +++
 tools/testing/nvdimm/test/nfit.c |   14 --
 6 files changed, 63 insertions(+), 3 deletions(-)

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


Re: [PATCH] libnvdimm, namespace: remove redundant initialization of 'nd_mapping'

2018-01-30 Thread Ross Zwisler
On Tue, Jan 30, 2018 at 05:47:07PM +, Colin King wrote:
> From: Colin Ian King 
> 
> Pointer nd_mapping is being initialized to a value that is never read,
> instead it is being updated to a new value in all the cases where it
> is being read afterwards, hence the initialization is redundant and
> can be removed.
> 
> Cleans up clang warning:
> drivers/nvdimm/namespace_devs.c:2411:21: warning: Value stored to
> 'nd_mapping' during its initialization is never rea
> 
> Signed-off-by: Colin Ian King 

Sure, this looks good.  Thanks.

Reviewed-by: Ross Zwisler 
___
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm


Re: [PATCH v2 3/4] libnvdimm: expose platform persistence attribute for nd_region

2018-01-30 Thread Ross Zwisler
On Fri, Dec 08, 2017 at 02:00:20PM -0700, Dave Jiang wrote:
> Providing a sysfs attribute for nd_region that shows the persistence
> capabilities for the platform.
> 
> Signed-off-by: Dave Jiang 

Sure, looks fine.

Reviewed-by: Ross Zwisler 
___
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm


Re: [PATCH v2 2/4] acpi: nfit: add persistent memory control flag for nd_region

2018-01-30 Thread Ross Zwisler
On Fri, Dec 08, 2017 at 02:00:14PM -0700, Dave Jiang wrote:
> Propogate the ADR attribute flag from the NFIT platform capabilities
> sub-table to nd_region.
> 
> Signed-off-by: Dave Jiang 

Sure, looks fine.

Reviewed-by: Ross Zwisler 
___
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm


Re: [PATCH v2 4/4] nfit-test: Add platform cap support from ACPI 6.2a to test

2018-01-30 Thread Ross Zwisler
On Fri, Dec 08, 2017 at 02:00:25PM -0700, Dave Jiang wrote:
> Adding NFIT platform capabilities sub table in nfit_test simulated ACPI
> NFIT table. Only the first NFIT table is added with the capability
> sub-table.
> 
> Signed-off-by: Dave Jiang 
> ---
>  tools/testing/nvdimm/test/nfit.c |   11 ++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/nvdimm/test/nfit.c 
> b/tools/testing/nvdimm/test/nfit.c
> index 7217b2b953b5..8a16f90a9573 100644
> --- a/tools/testing/nvdimm/test/nfit.c
> +++ b/tools/testing/nvdimm/test/nfit.c
> @@ -993,6 +993,7 @@ static void nfit_test0_setup(struct nfit_test *t)
>   struct acpi_nfit_control_region *dcr;
>   struct acpi_nfit_data_region *bdw;
>   struct acpi_nfit_flush_address *flush;
> + struct acpi_nfit_capabilities *pcap;
>   unsigned int offset, i;
>  
>   /*
> @@ -1500,8 +1501,16 @@ static void nfit_test0_setup(struct nfit_test *t)
>   for (i = 0; i < NUM_HINTS; i++)
>   flush->hint_address[i] = t->flush_dma[3] + i * sizeof(u64);
>  
> + /* platform capabilities */
> + pcap = nfit_buf + offset + flush_hint_size * 4;
> + pcap->header.type = ACPI_NFIT_TYPE_CAPABILITIES;
> + pcap->header.length = sizeof(*pcap);
> + pcap->highest_capability = BIT(2);
> + pcap->capabilities = ACPI_NFIT_CAPABILITY_CACHE_FLUSH |
> + ACPI_NFIT_CAPABILITY_MEM_FLUSH;
> +
>   if (t->setup_hotplug) {
> - offset = offset + flush_hint_size * 4;
> + offset = offset + sizeof(*pcap);

You still need to increase the offset by flush_hint_size*4, in addition to
sizeof(*pcap):

offset = offset + flush_hint_size * 4 + sizeof(*pcap);

Also, you need to increase the size of the memory allocation for t->nfit_buf
in nfit_test_alloc() by adding in a sizeof(struct acpi_nfit_capabilities) to
the calculation of nfit_size.  Otherwise you'll increment offset off the end
of nfit_buf in nfit_test0_setup().

>   /* dcr-descriptor4: blk */
>   dcr = nfit_buf + offset;
>   dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION;
> 
> ___
> Linux-nvdimm mailing list
> Linux-nvdimm@lists.01.org
> https://lists.01.org/mailman/listinfo/linux-nvdimm
___
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm


Re: [PATCH v2 1/4] acpi: nfit: Add support for detect platform CPU cache flush on power loss

2018-01-30 Thread Ross Zwisler
On Fri, Dec 08, 2017 at 02:00:09PM -0700, Dave Jiang wrote:
> In ACPI 6.2a the platform capability structure has been added to the NFIT
> tables. That provides software the ability to determine whether a system
> supports the auto flushing of CPU caches on power loss. If the capability
> is supported, we do not need to do dax_write_cache(). Plumbing the path
 dax_flush() ?

dax_write_cache() just sets or clears DAXDEV_WRITE_CACHE.  dax_flush() is the
place where we check DAXDEV_WRITE_CACHE and avoid calling arch_wb_cache_pmem()
if the platform supports a flush-on-fail CPU cache.

> to set the property on per region from the NFTI tables.
 NFIT
> 
> This patch depends on the ACPI NFIT 6.2a platform capabilities support code
> in include/acpi/actbl1.h.
>
> Signed-off-by: Dave Jiang 
> ---
>  drivers/acpi/nfit/core.c |   20 
>  drivers/acpi/nfit/nfit.h |1 +
>  drivers/nvdimm/pmem.c|4 +++-
>  drivers/nvdimm/region_devs.c |1 +
>  include/linux/libnvdimm.h|5 +
>  5 files changed, 30 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index ff2580e7611d..c08b3da61b93 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -838,6 +838,18 @@ static bool add_flush(struct acpi_nfit_desc *acpi_desc,
>   return true;
>  }
>  
> +static bool add_platform_cap(struct acpi_nfit_desc *acpi_desc,
> + struct acpi_nfit_capabilities *pcap)
> +{
> + struct device *dev = acpi_desc->dev;
> + u8 mask;

'mask' cannot be a u8, else you'll lose all the upper bits when you compute
it.  It needs to be a u32.

> +
> + mask = pcap->highest_capability - 1 + pcap->highest_capability;

This calculation is broken.   Take the simplest case, highest_capability = 0.
This should translate into a mask of 0x1, so you only look at bit 0, but:

0 - 1 + 0 == -1

giving you a mask that includes all the bits.  I think the mask you're looking
for is:
mask = (1 << (pcap->highest_capability + 1)) - 1;

> + acpi_desc->platform_cap = pcap->capabilities & (u32)mask;
> + dev_dbg(dev, "%s: cap: %#x\n", __func__, acpi_desc->platform_cap);
> + return true;
> +}
> +
>  static void *add_table(struct acpi_nfit_desc *acpi_desc,
>   struct nfit_table_prev *prev, void *table, const void *end)
>  {
<>
> diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
> index 7fbc5c5dc8e1..13f2ed80899e 100644
> --- a/drivers/nvdimm/pmem.c
> +++ b/drivers/nvdimm/pmem.c
> @@ -35,6 +35,7 @@
>  #include "pmem.h"
>  #include "pfn.h"
>  #include "nd.h"
> +#include "nd-core.h"
>  
>  static struct device *to_dev(struct pmem_device *pmem)
>  {
> @@ -334,7 +335,8 @@ static int pmem_attach_disk(struct device *dev,
>   dev_warn(dev, "unable to guarantee persistence of writes\n");
>   fua = 0;
>   }
> - wbc = nvdimm_has_cache(nd_region);
> + wbc = nvdimm_has_cache(nd_region) &
I'm guessing you meant:   &&

> + !test_bit(ND_REGION_PERSIST_CACHE, _region->flags);
>  
>   if (!devm_request_mem_region(dev, res->start, resource_size(res),
>   dev_name(>dev))) {
> diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c
> index abaf38c61220..87e8cd10de05 100644
> --- a/drivers/nvdimm/region_devs.c
> +++ b/drivers/nvdimm/region_devs.c
> @@ -994,6 +994,7 @@ static struct nd_region *nd_region_create(struct 
> nvdimm_bus *nvdimm_bus,
>   dev->groups = ndr_desc->attr_groups;
>   nd_region->ndr_size = resource_size(ndr_desc->res);
>   nd_region->ndr_start = ndr_desc->res->start;
> +
Unrelated whitespace change.

>   nd_device_register(dev);
>  
>   return nd_region;
___
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm


[PATCH] libnvdimm, namespace: remove redundant initialization of 'nd_mapping'

2018-01-30 Thread Colin King
From: Colin Ian King 

Pointer nd_mapping is being initialized to a value that is never read,
instead it is being updated to a new value in all the cases where it
is being read afterwards, hence the initialization is redundant and
can be removed.

Cleans up clang warning:
drivers/nvdimm/namespace_devs.c:2411:21: warning: Value stored to
'nd_mapping' during its initialization is never rea

Signed-off-by: Colin Ian King 
---
 drivers/nvdimm/namespace_devs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index bb3ba8cf24d4..658ada497be0 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -2408,7 +2408,7 @@ static struct device **scan_labels(struct nd_region 
*nd_region)
 
 static struct device **create_namespaces(struct nd_region *nd_region)
 {
-   struct nd_mapping *nd_mapping = _region->mapping[0];
+   struct nd_mapping *nd_mapping;
struct device **devs;
int i;
 
-- 
2.15.1

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


Kaggle and Interactions user's List

2018-01-30 Thread Vivian Gray
Hi,

Hope you're doing great. We are a global database provider and preferred 
partners for Enterprise, Media and Small size companies.

I am writing to you in regards to our recent lists released, and check if you 
would be interested in acquiring our recently verified Machine Learning 
Software User's list and Other Related Software User's database.

We do have Users of:


  *   Kaggle
  *   Interactions
  *   Tractica
  *   arya.ai and many more.


We can also provide other Technologies users such as MS Dynamics users, SAP 
users, Citrix users, Avaya users, VMware users, JD Edward users, IBM users, 
Sage users and many more

List Source:
"  Direct Research & Subscriptions from websites
"  Government records and listings
"  Annual reports and public filings
"  Yellow pages
"  Opt-in email campaigns
"  Online Surveys and feedback forms
"  Tradeshows and conferences

Other multi-channel programs we are mainly specialized in Technology Industry 
Database currently holding 3200+ application users type.

This list comes with full contact details like: First and Last names, 
Organization, Job title and responsibility, Company mailing address, Opt-In 
Email address, telephone number, email address, fax number, zip code, Province, 
State, Country, Employee Size, Industry, SIC Code, Zip code etc. across USA, UK 
and more over the globe. Which help you reach out to your potential clients / 
market expansion.

Every contact from this database has completed verification as on 30th of 
December 2017 to give you 95%+ accuracy.

If you are interested, please mention your target geography and which software 
users list require to you. Then we will furnish you with counts, pricing, 
samples and more information.

Regards,
Vivian Gray
Sr. Demand Generation Executive

If you don't wish to receive any further emails plz reply with Opt Out.

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