Skip to content

Commit a01da6c

Browse files
committed
cxl/pmem: Fix Documentation warning
Commit 06737cd ("cxl/core: Move pmem functionality") neglected to add a DOC header for the new drivers/cxl/core/pmem.c file. Reported-by: Ben Widawsky <ben.widawsky@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huwei.com> Link: https://lore.kernel.org/r/163072206163.2250120.11486436976516079516.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 9d1b3af commit a01da6c

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

Documentation/driver-api/cxl/memory-devices.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ CXL Core
4040
:doc: cxl core
4141

4242
.. kernel-doc:: drivers/cxl/core/pmem.c
43-
:internal:
43+
:doc: cxl pmem
4444

4545
.. kernel-doc:: drivers/cxl/core/regs.c
4646
:internal:

drivers/cxl/core/pmem.c

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/* Copyright(c) 2020 Intel Corporation. */
3-
43
#include <linux/device.h>
54
#include <linux/slab.h>
65
#include <cxlmem.h>
76
#include <cxl.h>
8-
97
#include "core.h"
108

9+
/**
10+
* DOC: cxl pmem
11+
*
12+
* The core CXL PMEM infrastructure supports persistent memory
13+
* provisioning and serves as a bridge to the LIBNVDIMM subsystem. A CXL
14+
* 'bridge' device is added at the root of a CXL device topology if
15+
* platform firmware advertises at least one persistent memory capable
16+
* CXL window. That root-level bridge corresponds to a LIBNVDIMM 'bus'
17+
* device. Then for each cxl_memdev in the CXL device topology a bridge
18+
* device is added to host a LIBNVDIMM dimm object. When these bridges
19+
* are registered native LIBNVDIMM uapis are translated to CXL
20+
* operations, for example, namespace label access commands.
21+
*/
22+
1123
static void cxl_nvdimm_bridge_release(struct device *dev)
1224
{
1325
struct cxl_nvdimm_bridge *cxl_nvb = to_cxl_nvdimm_bridge(dev);
@@ -85,6 +97,13 @@ static void unregister_nvb(void *_cxl_nvb)
8597
device_unregister(&cxl_nvb->dev);
8698
}
8799

100+
/**
101+
* devm_cxl_add_nvdimm_bridge() - add the root of a LIBNVDIMM topology
102+
* @host: platform firmware root device
103+
* @port: CXL port at the root of a CXL topology
104+
*
105+
* Return: bridge device that can host cxl_nvdimm objects
106+
*/
88107
struct cxl_nvdimm_bridge *devm_cxl_add_nvdimm_bridge(struct device *host,
89108
struct cxl_port *port)
90109
{
@@ -173,6 +192,13 @@ static struct cxl_nvdimm *cxl_nvdimm_alloc(struct cxl_memdev *cxlmd)
173192
return cxl_nvd;
174193
}
175194

195+
/**
196+
* devm_cxl_add_nvdimm() - add a bridge between a cxl_memdev and an nvdimm
197+
* @host: same host as @cxlmd
198+
* @cxlmd: cxl_memdev instance that will perform LIBNVDIMM operations
199+
*
200+
* Return: 0 on success negative error code on failure.
201+
*/
176202
int devm_cxl_add_nvdimm(struct device *host, struct cxl_memdev *cxlmd)
177203
{
178204
struct cxl_nvdimm *cxl_nvd;

0 commit comments

Comments
 (0)