Skip to content

Commit 9d15ce9

Browse files
committed
tools/testing/nvdimm: fix allocation range for mock flush hint tables
Commit 480b683 "nvdimm: fix PHYS_PFN/PFN_PHYS mixup" identified that we were passing an invalid address to devm_nvdimm_ioremap(). With that fixed it exposed a bug in the memory reservation size for flush hint tables. Since we map a full page we need to mock a full page of memory to back the flush hint table entries. Cc: Oliver O'Halloran <[email protected]> Signed-off-by: Dan Williams <[email protected]>
1 parent 480b683 commit 9d15ce9

File tree

1 file changed

+2
-1
lines changed
  • tools/testing/nvdimm/test

1 file changed

+2
-1
lines changed

tools/testing/nvdimm/test/nfit.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,8 @@ static int nfit_test0_alloc(struct nfit_test *t)
603603
return -ENOMEM;
604604
sprintf(t->label[i], "label%d", i);
605605

606-
t->flush[i] = test_alloc(t, sizeof(u64) * NUM_HINTS,
606+
t->flush[i] = test_alloc(t, max(PAGE_SIZE,
607+
sizeof(u64) * NUM_HINTS),
607608
&t->flush_dma[i]);
608609
if (!t->flush[i])
609610
return -ENOMEM;

0 commit comments

Comments
 (0)