Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm
Pull libnvdimm fixes from Dan Williams: - a fix for the persistent memory 'struct page' driver. The implementation overlooked the fact that pages are allocated in 2MB units leading to -ENOMEM when establishing some configurations. It's tagged for -stable as the problem was introduced with the initial implementation in 4.5. - The new "error status translation" routine, introduced with the 4.6 updates to the nfit driver, missed a necessary path in acpi_nfit_ctl(). The end result is that we are falsely assuming commands complete successfully when the embedded status says otherwise. * 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: nfit: fix translation of command status results libnvdimm, pfn: fix memmap reservation sizing
This commit is contained in:
commit
7270a3f761
@ -287,8 +287,11 @@ static int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc,
|
||||
offset);
|
||||
rc = -ENXIO;
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
rc = 0;
|
||||
if (cmd_rc)
|
||||
*cmd_rc = xlat_status(buf, cmd);
|
||||
}
|
||||
|
||||
out:
|
||||
ACPI_FREE(out_obj);
|
||||
|
@ -397,10 +397,17 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn)
|
||||
*/
|
||||
start += start_pad;
|
||||
npfns = (pmem->size - start_pad - end_trunc - SZ_8K) / SZ_4K;
|
||||
if (nd_pfn->mode == PFN_MODE_PMEM)
|
||||
offset = ALIGN(start + SZ_8K + 64 * npfns, nd_pfn->align)
|
||||
if (nd_pfn->mode == PFN_MODE_PMEM) {
|
||||
unsigned long memmap_size;
|
||||
|
||||
/*
|
||||
* vmemmap_populate_hugepages() allocates the memmap array in
|
||||
* HPAGE_SIZE chunks.
|
||||
*/
|
||||
memmap_size = ALIGN(64 * npfns, HPAGE_SIZE);
|
||||
offset = ALIGN(start + SZ_8K + memmap_size, nd_pfn->align)
|
||||
- start;
|
||||
else if (nd_pfn->mode == PFN_MODE_RAM)
|
||||
} else if (nd_pfn->mode == PFN_MODE_RAM)
|
||||
offset = ALIGN(start + SZ_8K, nd_pfn->align) - start;
|
||||
else
|
||||
goto err;
|
||||
|
Loading…
Reference in New Issue
Block a user