Skip to content

Commit 5c98bcc

Browse files
committed
Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm
Pull nvdimm fixlet from Dan Williams: "This is a libnvdimm ABI fixup. I pushed back on this change quite hard given the late date, that it appears to be purely cosmetic, sysfs is not necessarily meant to be a user friendly UI, and the kernel interprets the reversed polarity of the ACPI_NFIT_MEM_ARMED flag correctly. When this flag is set, the energy source of an NVDIMM is not armed and any new writes to the DIMM may not be preserved. However, Bob Moore warned me that it is important to get these things named correctly wherever they appear otherwise we run the risk of a less than cautious firmware engineer implementing the polarity the wrong way. Once a mistake like that escapes into production platforms the flag becomes useless and we need to move to a new bit position. Bob has agreed to take a change through ACPICA to rename ACPI_NFIT_MEM_ARMED to ACPI_NFIT_MEM_NOT_ARMED, and the patch below from Toshi brings the sysfs representation of these flags in line with their respective polarities. Please pull for 4.2 as this is the first kernel to expose the ACPI NFIT sysfs representation, and this is likely a kernel that firmware developers will be using for checking out their NVDIMM enabling" * 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: nfit: Clarify memory device state flags strings
2 parents 9580381 + 402bae5 commit 5c98bcc

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

drivers/acpi/nfit.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -702,11 +702,11 @@ static ssize_t flags_show(struct device *dev,
702702
u16 flags = to_nfit_memdev(dev)->flags;
703703

704704
return sprintf(buf, "%s%s%s%s%s\n",
705-
flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save " : "",
706-
flags & ACPI_NFIT_MEM_RESTORE_FAILED ? "restore " : "",
707-
flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush " : "",
708-
flags & ACPI_NFIT_MEM_ARMED ? "arm " : "",
709-
flags & ACPI_NFIT_MEM_HEALTH_OBSERVED ? "smart " : "");
705+
flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save_fail " : "",
706+
flags & ACPI_NFIT_MEM_RESTORE_FAILED ? "restore_fail " : "",
707+
flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush_fail " : "",
708+
flags & ACPI_NFIT_MEM_ARMED ? "not_armed " : "",
709+
flags & ACPI_NFIT_MEM_HEALTH_OBSERVED ? "smart_event " : "");
710710
}
711711
static DEVICE_ATTR_RO(flags);
712712

@@ -849,12 +849,12 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
849849
if ((mem_flags & ACPI_NFIT_MEM_FAILED_MASK) == 0)
850850
continue;
851851

852-
dev_info(acpi_desc->dev, "%s: failed: %s%s%s%s\n",
852+
dev_info(acpi_desc->dev, "%s flags:%s%s%s%s\n",
853853
nvdimm_name(nvdimm),
854-
mem_flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save " : "",
855-
mem_flags & ACPI_NFIT_MEM_RESTORE_FAILED ? "restore " : "",
856-
mem_flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush " : "",
857-
mem_flags & ACPI_NFIT_MEM_ARMED ? "arm " : "");
854+
mem_flags & ACPI_NFIT_MEM_SAVE_FAILED ? " save_fail" : "",
855+
mem_flags & ACPI_NFIT_MEM_RESTORE_FAILED ? " restore_fail":"",
856+
mem_flags & ACPI_NFIT_MEM_FLUSH_FAILED ? " flush_fail" : "",
857+
mem_flags & ACPI_NFIT_MEM_ARMED ? " not_armed" : "");
858858

859859
}
860860

0 commit comments

Comments
 (0)