Skip to content

Commit be314c9

Browse files
author
CKI KWF Bot
committed
Merge: libnvdimm update
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1482 Update libnvdimm with fixes from upstream. JIRA: https://issues.redhat.com/browse/RHEL-96846 Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Approved-by: bgurney <bgurney@redhat.com> Approved-by: Chris Leech <cleech@redhat.com> Approved-by: Ming Lei <ming.lei@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 7701794 + 10796ac commit be314c9

File tree

9 files changed

+14
-62
lines changed

9 files changed

+14
-62
lines changed

drivers/nvdimm/claim.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,6 @@ bool __nd_attach_ndns(struct device *dev, struct nd_namespace_common *attach,
5656
return true;
5757
}
5858

59-
bool nd_attach_ndns(struct device *dev, struct nd_namespace_common *attach,
60-
struct nd_namespace_common **_ndns)
61-
{
62-
bool claimed;
63-
64-
nvdimm_bus_lock(&attach->dev);
65-
claimed = __nd_attach_ndns(dev, attach, _ndns);
66-
nvdimm_bus_unlock(&attach->dev);
67-
return claimed;
68-
}
69-
7059
static bool is_idle(struct device *dev, struct nd_namespace_common *ndns)
7160
{
7261
struct nd_region *nd_region = to_nd_region(dev->parent);

drivers/nvdimm/dax_devs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ int nd_dax_probe(struct device *dev, struct nd_namespace_common *ndns)
106106

107107
nvdimm_bus_lock(&ndns->dev);
108108
nd_dax = nd_dax_alloc(nd_region);
109-
nd_pfn = &nd_dax->nd_pfn;
110-
dax_dev = nd_pfn_devinit(nd_pfn, ndns);
109+
dax_dev = nd_dax_devinit(nd_dax, ndns);
111110
nvdimm_bus_unlock(&ndns->dev);
112111
if (!dax_dev)
113112
return -ENOMEM;
114113
pfn_sb = devm_kmalloc(dev, sizeof(*pfn_sb), GFP_KERNEL);
114+
nd_pfn = &nd_dax->nd_pfn;
115115
nd_pfn->pfn_sb = pfn_sb;
116116
rc = nd_pfn_validate(nd_pfn, DAX_SIG);
117117
dev_dbg(dev, "dax: %s\n", rc == 0 ? dev_name(dax_dev) : "<none>");

drivers/nvdimm/label.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ int nd_label_data_init(struct nvdimm_drvdata *ndd)
442442
if (ndd->data)
443443
return 0;
444444

445-
if (ndd->nsarea.status || ndd->nsarea.max_xfer == 0) {
445+
if (ndd->nsarea.status || ndd->nsarea.max_xfer == 0 ||
446+
ndd->nsarea.config_size == 0) {
446447
dev_dbg(ndd->dev, "failed to init config data area: (%u:%u)\n",
447448
ndd->nsarea.max_xfer, ndd->nsarea.config_size);
448449
return -ENXIO;

drivers/nvdimm/nd-core.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,13 @@ resource_size_t nd_region_allocatable_dpa(struct nd_region *nd_region);
127127
resource_size_t nd_pmem_available_dpa(struct nd_region *nd_region,
128128
struct nd_mapping *nd_mapping);
129129
resource_size_t nd_region_available_dpa(struct nd_region *nd_region);
130-
int nd_region_conflict(struct nd_region *nd_region, resource_size_t start,
131-
resource_size_t size);
132130
resource_size_t nvdimm_allocated_dpa(struct nvdimm_drvdata *ndd,
133131
struct nd_label_id *label_id);
134132
int nvdimm_num_label_slots(struct nvdimm_drvdata *ndd);
135133
void get_ndd(struct nvdimm_drvdata *ndd);
136134
resource_size_t __nvdimm_namespace_capacity(struct nd_namespace_common *ndns);
137135
void nd_detach_ndns(struct device *dev, struct nd_namespace_common **_ndns);
138136
void __nd_detach_ndns(struct device *dev, struct nd_namespace_common **_ndns);
139-
bool nd_attach_ndns(struct device *dev, struct nd_namespace_common *attach,
140-
struct nd_namespace_common **_ndns);
141137
bool __nd_attach_ndns(struct device *dev, struct nd_namespace_common *attach,
142138
struct nd_namespace_common **_ndns);
143139
ssize_t nd_namespace_store(struct device *dev,

drivers/nvdimm/nd.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,13 @@ struct nd_dax *to_nd_dax(struct device *dev);
600600
int nd_dax_probe(struct device *dev, struct nd_namespace_common *ndns);
601601
bool is_nd_dax(const struct device *dev);
602602
struct device *nd_dax_create(struct nd_region *nd_region);
603+
static inline struct device *nd_dax_devinit(struct nd_dax *nd_dax,
604+
struct nd_namespace_common *ndns)
605+
{
606+
if (!nd_dax)
607+
return NULL;
608+
return nd_pfn_devinit(&nd_dax->nd_pfn, ndns);
609+
}
603610
#else
604611
static inline int nd_dax_probe(struct device *dev,
605612
struct nd_namespace_common *ndns)

drivers/nvdimm/nd_virtio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static int virtio_pmem_flush(struct nd_region *nd_region)
9797
dev_info(&vdev->dev, "failed to send command to virtio pmem device\n");
9898
err = -EIO;
9999
} else {
100-
/* A host repsonse results in "host_ack" getting called */
100+
/* A host response results in "host_ack" getting called */
101101
wait_event(req_data->host_acked, req_data->done);
102102
err = le32_to_cpu(req_data->resp.ret);
103103
}

drivers/nvdimm/pfn_devs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ int nd_pfn_validate(struct nd_pfn *nd_pfn, const char *sig)
540540

541541
if (!nd_pfn->uuid) {
542542
/*
543-
* When probing a namepace via nd_pfn_probe() the uuid
543+
* When probing a namespace via nd_pfn_probe() the uuid
544544
* is NULL (see: nd_pfn_devinit()) we init settings from
545545
* pfn_sb
546546
*/

drivers/nvdimm/pmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ static long pmem_dax_direct_access(struct dax_device *dax_dev,
316316
* range, filesystem turns the normal pwrite to a dax_recovery_write.
317317
*
318318
* The recovery write consists of clearing media poison, clearing page
319-
* HWPoison bit, reenable page-wide read-write permission, flush the
319+
* HWPoison bit, re-enable page-wide read-write permission, flush the
320320
* caches and finally write. A competing pread thread will be held
321321
* off during the recovery process since data read back might not be
322322
* valid, and this is achieved by clearing the badblock records after

drivers/nvdimm/region_devs.c

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,45 +1229,4 @@ bool is_nvdimm_sync(struct nd_region *nd_region)
12291229
}
12301230
EXPORT_SYMBOL_GPL(is_nvdimm_sync);
12311231

1232-
struct conflict_context {
1233-
struct nd_region *nd_region;
1234-
resource_size_t start, size;
1235-
};
1236-
1237-
static int region_conflict(struct device *dev, void *data)
1238-
{
1239-
struct nd_region *nd_region;
1240-
struct conflict_context *ctx = data;
1241-
resource_size_t res_end, region_end, region_start;
1242-
1243-
if (!is_memory(dev))
1244-
return 0;
1245-
1246-
nd_region = to_nd_region(dev);
1247-
if (nd_region == ctx->nd_region)
1248-
return 0;
1249-
1250-
res_end = ctx->start + ctx->size;
1251-
region_start = nd_region->ndr_start;
1252-
region_end = region_start + nd_region->ndr_size;
1253-
if (ctx->start >= region_start && ctx->start < region_end)
1254-
return -EBUSY;
1255-
if (res_end > region_start && res_end <= region_end)
1256-
return -EBUSY;
1257-
return 0;
1258-
}
1259-
1260-
int nd_region_conflict(struct nd_region *nd_region, resource_size_t start,
1261-
resource_size_t size)
1262-
{
1263-
struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(&nd_region->dev);
1264-
struct conflict_context ctx = {
1265-
.nd_region = nd_region,
1266-
.start = start,
1267-
.size = size,
1268-
};
1269-
1270-
return device_for_each_child(&nvdimm_bus->dev, &ctx, region_conflict);
1271-
}
1272-
12731232
MODULE_IMPORT_NS("DEVMEM");

0 commit comments

Comments
 (0)