Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromtorvalds/linux

Commitfe9a552

Browse files
committed
libnvdimm, nfit: fix persistence domain reporting
The persistence domain is a point in the platform where once writesreach that destination the platform claims it will make them persistentrelative to power loss. In the ACPI NFIT this is currently communicatedas 2 bits in the "NFIT - Platform Capabilities Structure". The bitscomprise a hierarchy, i.e. bit0 "CPU Cache Flush to NVDIMM Durability onPower Loss Capable" implies bit1 "Memory Controller Flush to NVDIMMDurability on Power Loss Capable".Commit96c3a23 "libnvdimm: expose platform persistence attr..."shows the persistence domain as flags, but it's really an enumeratedhierarchy.Fix this newly introduced user ABI to show the closest availablepersistence domain before userspace develops dependencies on seeing, orneeding to develop code to tolerate, the raw NFIT flags communicatedthrough the libnvdimm-generic region attribute.Fixes:96c3a23 ("libnvdimm: expose platform persistence attr...")Reviewed-by: Dave Jiang <dave.jiang@intel.com>Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>Cc: Ross Zwisler <ross.zwisler@linux.intel.com>Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent896196d commitfe9a552

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

‎drivers/acpi/nfit/core.c‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2675,10 +2675,14 @@ static int acpi_nfit_register_region(struct acpi_nfit_desc *acpi_desc,
26752675
else
26762676
ndr_desc->numa_node=NUMA_NO_NODE;
26772677

2678-
if(acpi_desc->platform_cap&ACPI_NFIT_CAPABILITY_CACHE_FLUSH)
2678+
/*
2679+
* Persistence domain bits are hierarchical, if
2680+
* ACPI_NFIT_CAPABILITY_CACHE_FLUSH is set then
2681+
* ACPI_NFIT_CAPABILITY_MEM_FLUSH is implied.
2682+
*/
2683+
if (acpi_desc->platform_cap&ACPI_NFIT_CAPABILITY_CACHE_FLUSH)
26792684
set_bit(ND_REGION_PERSIST_CACHE,&ndr_desc->flags);
2680-
2681-
if (acpi_desc->platform_cap&ACPI_NFIT_CAPABILITY_MEM_FLUSH)
2685+
elseif (acpi_desc->platform_cap&ACPI_NFIT_CAPABILITY_MEM_FLUSH)
26822686
set_bit(ND_REGION_PERSIST_MEMCTRL,&ndr_desc->flags);
26832687

26842688
list_for_each_entry(nfit_memdev,&acpi_desc->memdevs,list) {

‎drivers/nvdimm/region_devs.c‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,11 +532,13 @@ static ssize_t persistence_domain_show(struct device *dev,
532532
structdevice_attribute*attr,char*buf)
533533
{
534534
structnd_region*nd_region=to_nd_region(dev);
535-
unsigned longflags=nd_region->flags;
536535

537-
returnsprintf(buf,"%s%s\n",
538-
flags&BIT(ND_REGION_PERSIST_CACHE) ?"cpu_cache " :"",
539-
flags&BIT(ND_REGION_PERSIST_MEMCTRL) ?"memory_controller " :"");
536+
if (test_bit(ND_REGION_PERSIST_CACHE,&nd_region->flags))
537+
returnsprintf(buf,"cpu_cache\n");
538+
elseif (test_bit(ND_REGION_PERSIST_MEMCTRL,&nd_region->flags))
539+
returnsprintf(buf,"memory_controller\n");
540+
else
541+
returnsprintf(buf,"\n");
540542
}
541543
staticDEVICE_ATTR_RO(persistence_domain);
542544

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp