[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241017165225.21206-15-alejandro.lucero-palau@amd.com>
Date: Thu, 17 Oct 2024 17:52:13 +0100
From: <alejandro.lucero-palau@....com>
To: <linux-cxl@...r.kernel.org>, <netdev@...r.kernel.org>,
<dan.j.williams@...el.com>, <martin.habets@...inx.com>,
<edward.cree@....com>, <davem@...emloft.net>, <kuba@...nel.org>,
<pabeni@...hat.com>, <edumazet@...gle.com>
CC: Alejandro Lucero <alucerop@....com>
Subject: [PATCH v4 14/26] sfc: create type2 cxl memdev
From: Alejandro Lucero <alucerop@....com>
Use cxl API for creating a cxl memory device using the type2
cxl_dev_state struct.
Signed-off-by: Alejandro Lucero <alucerop@....com>
---
drivers/net/ethernet/sfc/efx_cxl.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/ethernet/sfc/efx_cxl.c b/drivers/net/ethernet/sfc/efx_cxl.c
index 419cf9fb6bd0..452421d71fbf 100644
--- a/drivers/net/ethernet/sfc/efx_cxl.c
+++ b/drivers/net/ethernet/sfc/efx_cxl.c
@@ -94,12 +94,21 @@ int efx_cxl_init(struct efx_nic *efx)
*/
cxl_set_media_ready(cxl->cxlds);
+ cxl->cxlmd = devm_cxl_add_memdev(&pci_dev->dev, cxl->cxlds);
+ if (IS_ERR(cxl->cxlmd)) {
+ pci_err(pci_dev, "CXL accel memdev creation failed");
+ rc = PTR_ERR(cxl->cxlmd);
+ goto err3;
+ }
+
efx->cxl = cxl;
#endif
return 0;
#if IS_ENABLED(CONFIG_CXL_BUS)
+err3:
+ cxl_release_resource(cxl->cxlds, CXL_RES_RAM);
err2:
kfree(cxl->cxlds);
err1:
--
2.17.1
Powered by blists - more mailing lists