瀏覽代碼

acpi: nfit: add persistent memory control flag for nd_region

Propagate the ADR attribute flag from the NFIT platform capabilities
sub-table to nd_region.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Dave Jiang 7 年之前
父節點
當前提交
30e6d7bf29
共有 2 個文件被更改,包括 9 次插入0 次删除
  1. 3 0
      drivers/acpi/nfit/core.c
  2. 6 0
      include/linux/libnvdimm.h

+ 3 - 0
drivers/acpi/nfit/core.c

@@ -2675,6 +2675,9 @@ static int acpi_nfit_register_region(struct acpi_nfit_desc *acpi_desc,
 	if(acpi_desc->platform_cap & ACPI_NFIT_CAPABILITY_CACHE_FLUSH)
 	if(acpi_desc->platform_cap & ACPI_NFIT_CAPABILITY_CACHE_FLUSH)
 		set_bit(ND_REGION_PERSIST_CACHE, &ndr_desc->flags);
 		set_bit(ND_REGION_PERSIST_CACHE, &ndr_desc->flags);
 
 
+	if (acpi_desc->platform_cap & ACPI_NFIT_CAPABILITY_MEM_FLUSH)
+		set_bit(ND_REGION_PERSIST_MEMCTRL, &ndr_desc->flags);
+
 	list_for_each_entry(nfit_memdev, &acpi_desc->memdevs, list) {
 	list_for_each_entry(nfit_memdev, &acpi_desc->memdevs, list) {
 		struct acpi_nfit_memory_map *memdev = nfit_memdev->memdev;
 		struct acpi_nfit_memory_map *memdev = nfit_memdev->memdev;
 		struct nd_mapping_desc *mapping;
 		struct nd_mapping_desc *mapping;

+ 6 - 0
include/linux/libnvdimm.h

@@ -52,6 +52,12 @@ enum {
 	 * system power loss.
 	 * system power loss.
 	 */
 	 */
 	ND_REGION_PERSIST_CACHE = 1,
 	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 */
 	/* mark newly adjusted resources as requiring a label update */
 	DPA_RESOURCE_ADJUSTED = 1 << 0,
 	DPA_RESOURCE_ADJUSTED = 1 << 0,