Skip to content

Commit 4207d59

Browse files
committed
Merge tag 'dax-and-nvdimm-fixes-v6.0-final' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm
Pull NVDIMM and DAX fixes from Dan Williams: "A recently discovered one-line fix for devdax that further addresses a v5.5 regression, and (a bit embarrassing) a small batch of fixes that have been sitting in my fixes tree for weeks. The older fixes have soaked in linux-next during that time and address an fsdax infinite loop and some other minor fixups. - Fix a infinite loop bug in fsdax - Fix memory-type detection for devdax (EINJ regression) - Small cleanups" * tag 'dax-and-nvdimm-fixes-v6.0-final' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: devdax: Fix soft-reservation memory description fsdax: Fix infinite loop in dax_iomap_rw() nvdimm/namespace: drop nested variable in create_namespace_pmem() ndtest: Cleanup all of blk namespace specific code pmem: fix a name collision
2 parents f0cc7c0 + b3bbcc5 commit 4207d59

File tree

5 files changed

+7
-82
lines changed

5 files changed

+7
-82
lines changed

drivers/dax/hmem/device.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ void hmem_register_device(int target_nid, struct resource *r)
1515
.start = r->start,
1616
.end = r->end,
1717
.flags = IORESOURCE_MEM,
18+
.desc = IORES_DESC_SOFT_RESERVED,
1819
};
1920
struct platform_device *pdev;
2021
struct memregion_info info;

drivers/nvdimm/namespace_devs.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,8 +1712,6 @@ static struct device *create_namespace_pmem(struct nd_region *nd_region,
17121712
res->flags = IORESOURCE_MEM;
17131713

17141714
for (i = 0; i < nd_region->ndr_mappings; i++) {
1715-
uuid_t uuid;
1716-
17171715
nsl_get_uuid(ndd, nd_label, &uuid);
17181716
if (has_uuid_at_pos(nd_region, &uuid, cookie, i))
17191717
continue;

drivers/nvdimm/pmem.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static struct nd_region *to_region(struct pmem_device *pmem)
4545
return to_nd_region(to_dev(pmem)->parent);
4646
}
4747

48-
static phys_addr_t to_phys(struct pmem_device *pmem, phys_addr_t offset)
48+
static phys_addr_t pmem_to_phys(struct pmem_device *pmem, phys_addr_t offset)
4949
{
5050
return pmem->phys_addr + offset;
5151
}
@@ -63,7 +63,7 @@ static phys_addr_t to_offset(struct pmem_device *pmem, sector_t sector)
6363
static void pmem_mkpage_present(struct pmem_device *pmem, phys_addr_t offset,
6464
unsigned int len)
6565
{
66-
phys_addr_t phys = to_phys(pmem, offset);
66+
phys_addr_t phys = pmem_to_phys(pmem, offset);
6767
unsigned long pfn_start, pfn_end, pfn;
6868

6969
/* only pmem in the linear map supports HWPoison */
@@ -97,7 +97,7 @@ static void pmem_clear_bb(struct pmem_device *pmem, sector_t sector, long blks)
9797
static long __pmem_clear_poison(struct pmem_device *pmem,
9898
phys_addr_t offset, unsigned int len)
9999
{
100-
phys_addr_t phys = to_phys(pmem, offset);
100+
phys_addr_t phys = pmem_to_phys(pmem, offset);
101101
long cleared = nvdimm_clear_poison(to_dev(pmem), phys, len);
102102

103103
if (cleared > 0) {

fs/dax.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,6 +1445,9 @@ dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
14451445
loff_t done = 0;
14461446
int ret;
14471447

1448+
if (!iomi.len)
1449+
return 0;
1450+
14481451
if (iov_iter_rw(iter) == WRITE) {
14491452
lockdep_assert_held_write(&iomi.inode->i_rwsem);
14501453
iomi.flags |= IOMAP_WRITE;

tools/testing/nvdimm/test/ndtest.c

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -134,39 +134,6 @@ static struct ndtest_mapping region1_mapping[] = {
134134
},
135135
};
136136

137-
static struct ndtest_mapping region2_mapping[] = {
138-
{
139-
.dimm = 0,
140-
.position = 0,
141-
.start = 0,
142-
.size = DIMM_SIZE,
143-
},
144-
};
145-
146-
static struct ndtest_mapping region3_mapping[] = {
147-
{
148-
.dimm = 1,
149-
.start = 0,
150-
.size = DIMM_SIZE,
151-
}
152-
};
153-
154-
static struct ndtest_mapping region4_mapping[] = {
155-
{
156-
.dimm = 2,
157-
.start = 0,
158-
.size = DIMM_SIZE,
159-
}
160-
};
161-
162-
static struct ndtest_mapping region5_mapping[] = {
163-
{
164-
.dimm = 3,
165-
.start = 0,
166-
.size = DIMM_SIZE,
167-
}
168-
};
169-
170137
static struct ndtest_region bus0_regions[] = {
171138
{
172139
.type = ND_DEVICE_NAMESPACE_PMEM,
@@ -182,34 +149,6 @@ static struct ndtest_region bus0_regions[] = {
182149
.size = DIMM_SIZE * 2,
183150
.range_index = 2,
184151
},
185-
{
186-
.type = ND_DEVICE_NAMESPACE_BLK,
187-
.num_mappings = ARRAY_SIZE(region2_mapping),
188-
.mapping = region2_mapping,
189-
.size = DIMM_SIZE,
190-
.range_index = 3,
191-
},
192-
{
193-
.type = ND_DEVICE_NAMESPACE_BLK,
194-
.num_mappings = ARRAY_SIZE(region3_mapping),
195-
.mapping = region3_mapping,
196-
.size = DIMM_SIZE,
197-
.range_index = 4,
198-
},
199-
{
200-
.type = ND_DEVICE_NAMESPACE_BLK,
201-
.num_mappings = ARRAY_SIZE(region4_mapping),
202-
.mapping = region4_mapping,
203-
.size = DIMM_SIZE,
204-
.range_index = 5,
205-
},
206-
{
207-
.type = ND_DEVICE_NAMESPACE_BLK,
208-
.num_mappings = ARRAY_SIZE(region5_mapping),
209-
.mapping = region5_mapping,
210-
.size = DIMM_SIZE,
211-
.range_index = 6,
212-
},
213152
};
214153

215154
static struct ndtest_mapping region6_mapping[] = {
@@ -501,21 +440,6 @@ static int ndtest_create_region(struct ndtest_priv *p,
501440
nd_set->altcookie = nd_set->cookie1;
502441
ndr_desc->nd_set = nd_set;
503442

504-
if (region->type == ND_DEVICE_NAMESPACE_BLK) {
505-
mappings[0].start = 0;
506-
mappings[0].size = DIMM_SIZE;
507-
mappings[0].nvdimm = p->config->dimms[ndimm].nvdimm;
508-
509-
ndr_desc->mapping = &mappings[0];
510-
ndr_desc->num_mappings = 1;
511-
ndr_desc->num_lanes = 1;
512-
ndbr_desc.enable = ndtest_blk_region_enable;
513-
ndbr_desc.do_io = ndtest_blk_do_io;
514-
region->region = nvdimm_blk_region_create(p->bus, ndr_desc);
515-
516-
goto done;
517-
}
518-
519443
for (i = 0; i < region->num_mappings; i++) {
520444
ndimm = region->mapping[i].dimm;
521445
mappings[i].start = region->mapping[i].start;
@@ -527,7 +451,6 @@ static int ndtest_create_region(struct ndtest_priv *p,
527451
ndr_desc->num_mappings = region->num_mappings;
528452
region->region = nvdimm_pmem_region_create(p->bus, ndr_desc);
529453

530-
done:
531454
if (!region->region) {
532455
dev_err(&p->pdev.dev, "Error registering region %pR\n",
533456
ndr_desc->res);

0 commit comments

Comments
 (0)