Skip to content

Commit 338f6da

Browse files
kvaneeshdjbw
authored andcommitted
libnvdimm: Update persistence domain value for of_pmem and papr_scm device
Currently, kernel shows the below values "persistence_domain":"cpu_cache" "persistence_domain":"memory_controller" "persistence_domain":"unknown" "cpu_cache" indicates no extra instructions is needed to ensure the persistence of data in the pmem media on power failure. "memory_controller" indicates cpu cache flush instructions are required to flush the data. Platform provides mechanisms to automatically flush outstanding write data from memory controler to pmem on system power loss. Based on the above use memory_controller for non volatile regions on ppc64. Signed-off-by: Aneesh Kumar K.V <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent 9106137 commit 338f6da

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

arch/powerpc/platforms/pseries/papr_scm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,10 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
361361

362362
if (p->is_volatile)
363363
p->region = nvdimm_volatile_region_create(p->bus, &ndr_desc);
364-
else
364+
else {
365+
set_bit(ND_REGION_PERSIST_MEMCTRL, &ndr_desc.flags);
365366
p->region = nvdimm_pmem_region_create(p->bus, &ndr_desc);
367+
}
366368
if (!p->region) {
367369
dev_err(dev, "Error registering region %pR from %pOF\n",
368370
ndr_desc.res, p->dn);

drivers/nvdimm/of_pmem.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ static int of_pmem_region_probe(struct platform_device *pdev)
6262

6363
if (is_volatile)
6464
region = nvdimm_volatile_region_create(bus, &ndr_desc);
65-
else
65+
else {
66+
set_bit(ND_REGION_PERSIST_MEMCTRL, &ndr_desc.flags);
6667
region = nvdimm_pmem_region_create(bus, &ndr_desc);
68+
}
6769

6870
if (!region)
6971
dev_warn(&pdev->dev, "Unable to register region %pR from %pOF\n",

0 commit comments

Comments
 (0)