]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
nvdimm: only enumerate present nvdimm devices
authorkib <kib@FreeBSD.org>
Thu, 31 Jan 2019 22:47:04 +0000 (22:47 +0000)
committerkib <kib@FreeBSD.org>
Thu, 31 Jan 2019 22:47:04 +0000 (22:47 +0000)
commitf09f11ca04f76075f70bb9941ef66aacfe5ce734
tree18712f2b515b1b2620fccbe2661fb2a15051b031
parent10958ed0fbd1be84238f928ecae89cdb942769f5
nvdimm: only enumerate present nvdimm devices

Not all child devices of the NVDIMM root device represent DIMM devices
which are present in the system. The spec says (ACPI 6.2, sec 9.20.2):

    For each NVDIMM present or intended to be supported by platform,
    platform firmware also exposes an NVDIMM device ... under the
    NVDIMM root device.

Present NVDIMM devices are found by walking all of the NFIT table's
SPA ranges, then walking the NVDIMM regions mentioned by those SPA
ranges.

A set of NFIT walking helper functions are introduced to avoid the
need to splat the enumeration logic across several disparate
callbacks.

Submitted by: D Scott Phillips <d.scott.phillips@intel.com>
Sponsored by: Intel Corporation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D18439
sys/dev/nvdimm/nvdimm.c
sys/dev/nvdimm/nvdimm_nfit.c [new file with mode: 0644]
sys/dev/nvdimm/nvdimm_var.h
sys/modules/nvdimm/Makefile