[GIT PULL] libnvdimm fixes for 4.15-rc5

From: Williams, Dan J
Date: Sat Dec 23 2017 - 15:30:02 EST


Hi Linus, please pull from:

git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm libnvdimm-fixes

...to receive:

+ACo- NVDIMM namespaces, configured to enforce 1GB alignment, fail to
initialize on platforms that mis-align the start or end of the physical
address range.

+ACo- The Linux implementation of the BTT (Block Translation Table) is
incompatible with the UEFI 2.7 definition of the BTT format. The BTT
layers a software atomic sector semantic on top of an NVDIMM namespace.
Linux needs to be compatible with the UEFI definition to enable boot
support or any pre-OS access of data on a BTT enabled namespace.

+ACo- A fix for ACPI SMART notification events, this allows a userspace
monitor to register for health events rather than poll. This has been
broken since it was initially merged as the unit test inadvertently
worked around the problem. The urgency for fixing this during the -rc
series is driven by how expensive it is to poll for this data (System
Management Mode entry).

These fixes are all tagged for -stable and have received a build
success notification from the kbuild robot. Full changelogs below:

---

The following changes since commit ae64f9bd1d3621b5e60d7363bc20afb46aede215:

Linux 4.15-rc2 (2017-12-03 11:01:47 -0500)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm libnvdimm-fixes

for you to fetch changes up to 24e3a7fb60a9187e5df90e5fa655ffc94b9c4f77:

libnvdimm, btt: Fix an incompatibility in the log layout (2017-12-21 14:59:27 -0800)

----------------------------------------------------------------
Dan Williams (3):
acpi, nfit: fix health event notification
libnvdimm, pfn: fix start+AF8-pad handling for aligned namespaces
libnvdimm, dax: fix 1GB-aligned namespaces vs physical misalignment

Vishal Verma (2):
libnvdimm, btt: add a couple of missing kernel-doc lines
libnvdimm, btt: Fix an incompatibility in the log layout

drivers/acpi/nfit/core.c +AHw- 9 +-+--
drivers/nvdimm/btt.c +AHw- 201 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+---------
drivers/nvdimm/btt.h +AHw- 47 +-+-+-+-+-+-+-+-+-+--
drivers/nvdimm/pfn+AF8-devs.c +AHw- 20 +-+-+---
4 files changed, 236 insertions(+-), 41 deletions(-)


commit adf6895754e2503d994a765535fd1813f8834674
Author: Dan Williams +ADw-dan.j.williams+AEA-intel.com+AD4-
Date: Thu Nov 30 19:42:52 2017 -0800

acpi, nfit: fix health event notification

Integration testing with a BIOS that generates injected health event
notifications fails to communicate those events to userspace. The nfit
driver neglects to link the ACPI DIMM device with the necessary driver
data so acpi+AF8-nvdimm+AF8-notify() fails this lookup:

nfit+AF8-mem +AD0- dev+AF8-get+AF8-drvdata(dev)+ADs-
if (nfit+AF8-mem +ACYAJg- nfit+AF8-mem-+AD4-flags+AF8-attr)
sysfs+AF8-notify+AF8-dirent(nfit+AF8-mem-+AD4-flags+AF8-attr)+ADs-

Add the necessary linkage when installing the notification handler and
clean it up when the nfit driver instance is torn down.

Cc: +ADw-stable+AEA-vger.kernel.org+AD4-
Cc: Toshi Kani +ADw-toshi.kani+AEA-hpe.com+AD4-
Cc: Vishal Verma +ADw-vishal.l.verma+AEA-intel.com+AD4-
Fixes: ba9c8dd3c222 (+ACI-acpi, nfit: add dimm device notification support+ACI-)
Reported-by: Daniel Osawa +ADw-daniel.k.osawa+AEA-intel.com+AD4-
Tested-by: Daniel Osawa +ADw-daniel.k.osawa+AEA-intel.com+AD4-
Signed-off-by: Dan Williams +ADw-dan.j.williams+AEA-intel.com+AD4-

commit 19deaa217bc04e83b59b5e8c8229eb0e53ad9efc
Author: Dan Williams +ADw-dan.j.williams+AEA-intel.com+AD4-
Date: Tue Dec 19 15:07:10 2017 -0800

libnvdimm, pfn: fix start+AF8-pad handling for aligned namespaces

The alignment checks at pfn driver startup fail to properly account for
the 'start+AF8-pad' in the case where the namespace is misaligned relative
to its internal alignment. This is typically triggered in 1G aligned
namespace, but could theoretically trigger with small namespace
alignments. When this triggers the kernel reports messages of the form:

dax2.1: bad offset: 0x3c000000 dax disabled align: 0x40000000

Cc: +ADw-stable+AEA-vger.kernel.org+AD4-
Fixes: 1ee6667cd8d1 (+ACI-libnvdimm, pfn, dax: fix initialization vs autodetect...+ACI-)
Reported-by: Jane Chu +ADw-jane.chu+AEA-oracle.com+AD4-
Signed-off-by: Dan Williams +ADw-dan.j.williams+AEA-intel.com+AD4-

commit 41fce90f26333c4fa82e8e43b9ace86c4e8a0120
Author: Dan Williams +ADw-dan.j.williams+AEA-intel.com+AD4-
Date: Mon Dec 4 14:07:43 2017 -0800

libnvdimm, dax: fix 1GB-aligned namespaces vs physical misalignment

The following namespace configuration attempt:

+ACM- ndctl create-namespace -e namespace0.0 -m devdax -a 1G -f
libndctl: ndctl+AF8-dax+AF8-enable: dax0.1: failed to enable
Error: namespace0.0: failed to enable

failed to reconfigure namespace: No such device or address

...fails when the backing memory range is not physically aligned to 1G:

+ACM- cat /proc/iomem +AHw- grep Persistent
210000000-30fffffff : Persistent Memory (legacy)

In the above example the 4G persistent memory range starts and ends on a
256MB boundary.

We handle this case correctly when needing to handle cases that violate
section alignment (128MB) collisions against +ACI-System RAM+ACI-, and we simply
need to extend that padding/truncation for the 1GB alignment use case.

Cc: +ADw-stable+AEA-vger.kernel.org+AD4-
Fixes: 315c562536c4 (+ACI-libnvdimm, pfn: add 'align' attribute...+ACI-)
Reported-and-tested-by: Jane Chu +ADw-jane.chu+AEA-oracle.com+AD4-
Signed-off-by: Dan Williams +ADw-dan.j.williams+AEA-intel.com+AD4-

commit 13b7954c0b8dd2d6382b4ddb5053f09e389d5c6e
Author: Vishal Verma +ADw-vishal.l.verma+AEA-intel.com+AD4-
Date: Thu Dec 14 17:26:13 2017 -0700

libnvdimm, btt: add a couple of missing kernel-doc lines

Recent updates to btt.h neglected to add corresponding kernel-doc lines
for new structure members. Add them.

Signed-off-by: Vishal Verma +ADw-vishal.l.verma+AEA-intel.com+AD4-
Signed-off-by: Dan Williams +ADw-dan.j.williams+AEA-intel.com+AD4-

commit 24e3a7fb60a9187e5df90e5fa655ffc94b9c4f77
Author: Vishal Verma +ADw-vishal.l.verma+AEA-intel.com+AD4-
Date: Mon Dec 18 09:28:39 2017 -0700

libnvdimm, btt: Fix an incompatibility in the log layout

Due to a spec misinterpretation, the Linux implementation of the BTT log
area had different padding scheme from other implementations, such as
UEFI and NVML.

This fixes the padding scheme, and defaults to it for new BTT layouts.
We attempt to detect the padding scheme in use when probing for an
existing BTT. If we detect the older/incompatible scheme, we continue
using it.

Reported-by: Juston Li +ADw-juston.li+AEA-intel.com+AD4-
Cc: Dan Williams +ADw-dan.j.williams+AEA-intel.com+AD4-
Cc: +ADw-stable+AEA-vger.kernel.org+AD4-
Fixes: 5212e11fde4d (+ACI-nd+AF8-btt: atomic sector updates+ACI-)
Signed-off-by: Vishal Verma +ADw-vishal.l.verma+AEA-intel.com+AD4-
Signed-off-by: Dan Williams +ADw-dan.j.williams+AEA-intel.com+AD4-