diff options
| -rw-r--r-- | drivers/acpi/nfit/core.c | 10 | ||||
| -rw-r--r-- | drivers/nvdimm/region_devs.c | 10 |
2 files changed, 13 insertions, 7 deletions
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index bbe48ad20886..eb09ef55c38a 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c | |||
| @@ -2675,10 +2675,14 @@ static int acpi_nfit_register_region(struct acpi_nfit_desc *acpi_desc, | |||
| 2675 | else | 2675 | else |
| 2676 | ndr_desc->numa_node = NUMA_NO_NODE; | 2676 | ndr_desc->numa_node = NUMA_NO_NODE; |
| 2677 | 2677 | ||
| 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) | ||
| 2679 | set_bit(ND_REGION_PERSIST_CACHE, &ndr_desc->flags); | 2684 | set_bit(ND_REGION_PERSIST_CACHE, &ndr_desc->flags); |
| 2680 | 2685 | else if (acpi_desc->platform_cap & ACPI_NFIT_CAPABILITY_MEM_FLUSH) | |
| 2681 | if (acpi_desc->platform_cap & ACPI_NFIT_CAPABILITY_MEM_FLUSH) | ||
| 2682 | set_bit(ND_REGION_PERSIST_MEMCTRL, &ndr_desc->flags); | 2686 | set_bit(ND_REGION_PERSIST_MEMCTRL, &ndr_desc->flags); |
| 2683 | 2687 | ||
| 2684 | list_for_each_entry(nfit_memdev, &acpi_desc->memdevs, list) { | 2688 | list_for_each_entry(nfit_memdev, &acpi_desc->memdevs, list) { |
diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c index a8e9d428c0a5..1593e1806b16 100644 --- a/drivers/nvdimm/region_devs.c +++ b/drivers/nvdimm/region_devs.c | |||
| @@ -532,11 +532,13 @@ static ssize_t persistence_domain_show(struct device *dev, | |||
| 532 | struct device_attribute *attr, char *buf) | 532 | struct device_attribute *attr, char *buf) |
| 533 | { | 533 | { |
| 534 | struct nd_region *nd_region = to_nd_region(dev); | 534 | struct nd_region *nd_region = to_nd_region(dev); |
| 535 | unsigned long flags = nd_region->flags; | ||
| 536 | 535 | ||
| 537 | return sprintf(buf, "%s%s\n", | 536 | if (test_bit(ND_REGION_PERSIST_CACHE, &nd_region->flags)) |
| 538 | flags & BIT(ND_REGION_PERSIST_CACHE) ? "cpu_cache " : "", | 537 | return sprintf(buf, "cpu_cache\n"); |
| 539 | flags & BIT(ND_REGION_PERSIST_MEMCTRL) ? "memory_controller " : ""); | 538 | else if (test_bit(ND_REGION_PERSIST_MEMCTRL, &nd_region->flags)) |
| 539 | return sprintf(buf, "memory_controller\n"); | ||
| 540 | else | ||
| 541 | return sprintf(buf, "\n"); | ||
| 540 | } | 542 | } |
| 541 | static DEVICE_ATTR_RO(persistence_domain); | 543 | static DEVICE_ATTR_RO(persistence_domain); |
| 542 | 544 | ||
