mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 15:47:36 +00:00
libnvdimm: allow a platform to force enable label support
Platforms like QEMU-KVM implement an NFIT table and label DSMs. However, since that environment does not define an aliased configuration, the labels are currently ignored and the kernel registers a single full-sized pmem-namespace per region. Now that the kernel supports sub-divisions of pmem regions the labels have a purpose. Arrange for the labels to be honored when we find an existing / valid namespace index block. Cc: <qemu-devel@nongnu.org> Cc: Haozhong Zhang <haozhong.zhang@intel.com> Cc: Xiao Guangrong <guangrong.xiao@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
8d7c22ac0c
commit
42237e393f
3 changed files with 10 additions and 0 deletions
|
@ -64,6 +64,8 @@ static int nvdimm_probe(struct device *dev)
|
||||||
nd_label_copy(ndd, to_next_namespace_index(ndd),
|
nd_label_copy(ndd, to_next_namespace_index(ndd),
|
||||||
to_current_namespace_index(ndd));
|
to_current_namespace_index(ndd));
|
||||||
rc = nd_label_reserve_dpa(ndd);
|
rc = nd_label_reserve_dpa(ndd);
|
||||||
|
if (ndd->ns_current >= 0)
|
||||||
|
nvdimm_set_aliasing(dev);
|
||||||
nvdimm_bus_unlock(dev);
|
nvdimm_bus_unlock(dev);
|
||||||
|
|
||||||
if (rc)
|
if (rc)
|
||||||
|
|
|
@ -184,6 +184,13 @@ int nvdimm_set_config_data(struct nvdimm_drvdata *ndd, size_t offset,
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void nvdimm_set_aliasing(struct device *dev)
|
||||||
|
{
|
||||||
|
struct nvdimm *nvdimm = to_nvdimm(dev);
|
||||||
|
|
||||||
|
nvdimm->flags |= NDD_ALIASING;
|
||||||
|
}
|
||||||
|
|
||||||
static void nvdimm_release(struct device *dev)
|
static void nvdimm_release(struct device *dev)
|
||||||
{
|
{
|
||||||
struct nvdimm *nvdimm = to_nvdimm(dev);
|
struct nvdimm *nvdimm = to_nvdimm(dev);
|
||||||
|
|
|
@ -238,6 +238,7 @@ int nvdimm_set_config_data(struct nvdimm_drvdata *ndd, size_t offset,
|
||||||
void *buf, size_t len);
|
void *buf, size_t len);
|
||||||
long nvdimm_clear_poison(struct device *dev, phys_addr_t phys,
|
long nvdimm_clear_poison(struct device *dev, phys_addr_t phys,
|
||||||
unsigned int len);
|
unsigned int len);
|
||||||
|
void nvdimm_set_aliasing(struct device *dev);
|
||||||
struct nd_btt *to_nd_btt(struct device *dev);
|
struct nd_btt *to_nd_btt(struct device *dev);
|
||||||
|
|
||||||
struct nd_gen_sb {
|
struct nd_gen_sb {
|
||||||
|
|
Loading…
Reference in a new issue