diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-05-09 09:34:49 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-05-09 09:34:49 +0200 |
commit | 725d0123dfff3d7b666cf57f5d29c50addfc99d3 (patch) | |
tree | 12ec63b2c3965033f30185b4b2f5f12039a9a242 /drivers/nvdimm/pmem.c | |
parent | 8cd1f9d01cbf4f46eace90d9792e65a209c37d31 (diff) | |
parent | 44549e8f5eea4e0a41b487b63e616cb089922b99 (diff) | |
download | linux-725d0123dfff3d7b666cf57f5d29c50addfc99d3.tar.bz2 |
Merge 4.6-rc7 into char-misc-testing
This resolves a merge issue with drivers/hv/ring_buffer.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvdimm/pmem.c')
-rw-r--r-- | drivers/nvdimm/pmem.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index f798899338ed..5101f3ab4f29 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -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; |