mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
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
This commit is contained in:
@@ -15,6 +15,7 @@ void hmem_register_device(int target_nid, struct resource *r)
|
|||||||
.start = r->start,
|
.start = r->start,
|
||||||
.end = r->end,
|
.end = r->end,
|
||||||
.flags = IORESOURCE_MEM,
|
.flags = IORESOURCE_MEM,
|
||||||
|
.desc = IORES_DESC_SOFT_RESERVED,
|
||||||
};
|
};
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
struct memregion_info info;
|
struct memregion_info info;
|
||||||
|
@@ -1712,8 +1712,6 @@ static struct device *create_namespace_pmem(struct nd_region *nd_region,
|
|||||||
res->flags = IORESOURCE_MEM;
|
res->flags = IORESOURCE_MEM;
|
||||||
|
|
||||||
for (i = 0; i < nd_region->ndr_mappings; i++) {
|
for (i = 0; i < nd_region->ndr_mappings; i++) {
|
||||||
uuid_t uuid;
|
|
||||||
|
|
||||||
nsl_get_uuid(ndd, nd_label, &uuid);
|
nsl_get_uuid(ndd, nd_label, &uuid);
|
||||||
if (has_uuid_at_pos(nd_region, &uuid, cookie, i))
|
if (has_uuid_at_pos(nd_region, &uuid, cookie, i))
|
||||||
continue;
|
continue;
|
||||||
|
@@ -45,7 +45,7 @@ static struct nd_region *to_region(struct pmem_device *pmem)
|
|||||||
return to_nd_region(to_dev(pmem)->parent);
|
return to_nd_region(to_dev(pmem)->parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
static phys_addr_t to_phys(struct pmem_device *pmem, phys_addr_t offset)
|
static phys_addr_t pmem_to_phys(struct pmem_device *pmem, phys_addr_t offset)
|
||||||
{
|
{
|
||||||
return pmem->phys_addr + offset;
|
return pmem->phys_addr + offset;
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ static phys_addr_t to_offset(struct pmem_device *pmem, sector_t sector)
|
|||||||
static void pmem_mkpage_present(struct pmem_device *pmem, phys_addr_t offset,
|
static void pmem_mkpage_present(struct pmem_device *pmem, phys_addr_t offset,
|
||||||
unsigned int len)
|
unsigned int len)
|
||||||
{
|
{
|
||||||
phys_addr_t phys = to_phys(pmem, offset);
|
phys_addr_t phys = pmem_to_phys(pmem, offset);
|
||||||
unsigned long pfn_start, pfn_end, pfn;
|
unsigned long pfn_start, pfn_end, pfn;
|
||||||
|
|
||||||
/* only pmem in the linear map supports HWPoison */
|
/* 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)
|
|||||||
static long __pmem_clear_poison(struct pmem_device *pmem,
|
static long __pmem_clear_poison(struct pmem_device *pmem,
|
||||||
phys_addr_t offset, unsigned int len)
|
phys_addr_t offset, unsigned int len)
|
||||||
{
|
{
|
||||||
phys_addr_t phys = to_phys(pmem, offset);
|
phys_addr_t phys = pmem_to_phys(pmem, offset);
|
||||||
long cleared = nvdimm_clear_poison(to_dev(pmem), phys, len);
|
long cleared = nvdimm_clear_poison(to_dev(pmem), phys, len);
|
||||||
|
|
||||||
if (cleared > 0) {
|
if (cleared > 0) {
|
||||||
|
3
fs/dax.c
3
fs/dax.c
@@ -1445,6 +1445,9 @@ dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
|
|||||||
loff_t done = 0;
|
loff_t done = 0;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (!iomi.len)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (iov_iter_rw(iter) == WRITE) {
|
if (iov_iter_rw(iter) == WRITE) {
|
||||||
lockdep_assert_held_write(&iomi.inode->i_rwsem);
|
lockdep_assert_held_write(&iomi.inode->i_rwsem);
|
||||||
iomi.flags |= IOMAP_WRITE;
|
iomi.flags |= IOMAP_WRITE;
|
||||||
|
@@ -134,39 +134,6 @@ static struct ndtest_mapping region1_mapping[] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct ndtest_mapping region2_mapping[] = {
|
|
||||||
{
|
|
||||||
.dimm = 0,
|
|
||||||
.position = 0,
|
|
||||||
.start = 0,
|
|
||||||
.size = DIMM_SIZE,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct ndtest_mapping region3_mapping[] = {
|
|
||||||
{
|
|
||||||
.dimm = 1,
|
|
||||||
.start = 0,
|
|
||||||
.size = DIMM_SIZE,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct ndtest_mapping region4_mapping[] = {
|
|
||||||
{
|
|
||||||
.dimm = 2,
|
|
||||||
.start = 0,
|
|
||||||
.size = DIMM_SIZE,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct ndtest_mapping region5_mapping[] = {
|
|
||||||
{
|
|
||||||
.dimm = 3,
|
|
||||||
.start = 0,
|
|
||||||
.size = DIMM_SIZE,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct ndtest_region bus0_regions[] = {
|
static struct ndtest_region bus0_regions[] = {
|
||||||
{
|
{
|
||||||
.type = ND_DEVICE_NAMESPACE_PMEM,
|
.type = ND_DEVICE_NAMESPACE_PMEM,
|
||||||
@@ -182,34 +149,6 @@ static struct ndtest_region bus0_regions[] = {
|
|||||||
.size = DIMM_SIZE * 2,
|
.size = DIMM_SIZE * 2,
|
||||||
.range_index = 2,
|
.range_index = 2,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
.type = ND_DEVICE_NAMESPACE_BLK,
|
|
||||||
.num_mappings = ARRAY_SIZE(region2_mapping),
|
|
||||||
.mapping = region2_mapping,
|
|
||||||
.size = DIMM_SIZE,
|
|
||||||
.range_index = 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.type = ND_DEVICE_NAMESPACE_BLK,
|
|
||||||
.num_mappings = ARRAY_SIZE(region3_mapping),
|
|
||||||
.mapping = region3_mapping,
|
|
||||||
.size = DIMM_SIZE,
|
|
||||||
.range_index = 4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.type = ND_DEVICE_NAMESPACE_BLK,
|
|
||||||
.num_mappings = ARRAY_SIZE(region4_mapping),
|
|
||||||
.mapping = region4_mapping,
|
|
||||||
.size = DIMM_SIZE,
|
|
||||||
.range_index = 5,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.type = ND_DEVICE_NAMESPACE_BLK,
|
|
||||||
.num_mappings = ARRAY_SIZE(region5_mapping),
|
|
||||||
.mapping = region5_mapping,
|
|
||||||
.size = DIMM_SIZE,
|
|
||||||
.range_index = 6,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct ndtest_mapping region6_mapping[] = {
|
static struct ndtest_mapping region6_mapping[] = {
|
||||||
@@ -501,21 +440,6 @@ static int ndtest_create_region(struct ndtest_priv *p,
|
|||||||
nd_set->altcookie = nd_set->cookie1;
|
nd_set->altcookie = nd_set->cookie1;
|
||||||
ndr_desc->nd_set = nd_set;
|
ndr_desc->nd_set = nd_set;
|
||||||
|
|
||||||
if (region->type == ND_DEVICE_NAMESPACE_BLK) {
|
|
||||||
mappings[0].start = 0;
|
|
||||||
mappings[0].size = DIMM_SIZE;
|
|
||||||
mappings[0].nvdimm = p->config->dimms[ndimm].nvdimm;
|
|
||||||
|
|
||||||
ndr_desc->mapping = &mappings[0];
|
|
||||||
ndr_desc->num_mappings = 1;
|
|
||||||
ndr_desc->num_lanes = 1;
|
|
||||||
ndbr_desc.enable = ndtest_blk_region_enable;
|
|
||||||
ndbr_desc.do_io = ndtest_blk_do_io;
|
|
||||||
region->region = nvdimm_blk_region_create(p->bus, ndr_desc);
|
|
||||||
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < region->num_mappings; i++) {
|
for (i = 0; i < region->num_mappings; i++) {
|
||||||
ndimm = region->mapping[i].dimm;
|
ndimm = region->mapping[i].dimm;
|
||||||
mappings[i].start = region->mapping[i].start;
|
mappings[i].start = region->mapping[i].start;
|
||||||
@@ -527,7 +451,6 @@ static int ndtest_create_region(struct ndtest_priv *p,
|
|||||||
ndr_desc->num_mappings = region->num_mappings;
|
ndr_desc->num_mappings = region->num_mappings;
|
||||||
region->region = nvdimm_pmem_region_create(p->bus, ndr_desc);
|
region->region = nvdimm_pmem_region_create(p->bus, ndr_desc);
|
||||||
|
|
||||||
done:
|
|
||||||
if (!region->region) {
|
if (!region->region) {
|
||||||
dev_err(&p->pdev.dev, "Error registering region %pR\n",
|
dev_err(&p->pdev.dev, "Error registering region %pR\n",
|
||||||
ndr_desc->res);
|
ndr_desc->res);
|
||||||
|
Reference in New Issue
Block a user