[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241230214445.27602-12-alejandro.lucero-palau@amd.com>
Date: Mon, 30 Dec 2024 21:44:29 +0000
From: <alejandro.lucero-palau@....com>
To: <linux-cxl@...r.kernel.org>, <netdev@...r.kernel.org>,
<dan.j.williams@...el.com>, <edward.cree@....com>, <davem@...emloft.net>,
<kuba@...nel.org>, <pabeni@...hat.com>, <edumazet@...gle.com>,
<dave.jiang@...el.com>
CC: Alejandro Lucero <alucerop@....com>
Subject: [PATCH v9 11/27] cxl: add function for setting media ready by a driver
From: Alejandro Lucero <alucerop@....com>
A Type-2 driver may be required to set the memory availability explicitly,
for example because there is not a mailbox for doing so through a specific
command.
Add a function to the exported CXL API for accelerator drivers having this
possibility.
Signed-off-by: Alejandro Lucero <alucerop@....com>
Reviewed-by: Dave Jiang <dave.jiang@...el.com>
Reviewed-by: Ben Cheatham <benjamin.cheatham@....com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
---
drivers/cxl/core/memdev.c | 6 ++++++
include/cxl/cxl.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/drivers/cxl/core/memdev.c b/drivers/cxl/core/memdev.c
index b104af6761cf..836db4a462b3 100644
--- a/drivers/cxl/core/memdev.c
+++ b/drivers/cxl/core/memdev.c
@@ -783,6 +783,12 @@ int cxl_release_resource(struct cxl_dev_state *cxlds, enum cxl_resource type)
}
EXPORT_SYMBOL_NS_GPL(cxl_release_resource, "CXL");
+void cxl_set_media_ready(struct cxl_dev_state *cxlds)
+{
+ cxlds->media_ready = true;
+}
+EXPORT_SYMBOL_NS_GPL(cxl_set_media_ready, "CXL");
+
static int cxl_memdev_release_file(struct inode *inode, struct file *file)
{
struct cxl_memdev *cxlmd =
diff --git a/include/cxl/cxl.h b/include/cxl/cxl.h
index 87b192095fe3..f67ee745d942 100644
--- a/include/cxl/cxl.h
+++ b/include/cxl/cxl.h
@@ -47,4 +47,5 @@ struct pci_dev;
int cxl_pci_accel_setup_regs(struct pci_dev *pdev, struct cxl_dev_state *cxlds);
int cxl_request_resource(struct cxl_dev_state *cxlds, enum cxl_resource type);
int cxl_release_resource(struct cxl_dev_state *cxlds, enum cxl_resource type);
+void cxl_set_media_ready(struct cxl_dev_state *cxlds);
#endif
--
2.17.1
Powered by blists - more mailing lists