Message ID | 20241216161042.42108-15-alejandro.lucero-palau@amd.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | cxl: add type2 device basic support | expand |
On Mon, 16 Dec 2024 16:10:29 +0000 <alejandro.lucero-palau@amd.com> wrote: > From: Alejandro Lucero <alucerop@amd.com> > > Use cxl API for creating a cxl memory device using the type2 > cxl_dev_state struct. > > Signed-off-by: Alejandro Lucero <alucerop@amd.com> > Reviewed-by: Martin Habets <habetsm.xilinx@gmail.com> > Reviewed-by: Fan Ni <fan.ni@samsung.com> > Acked-by: Edward Cree <ecree.xilinx@gmail.com> LGTM Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
diff --git a/drivers/net/ethernet/sfc/efx_cxl.c b/drivers/net/ethernet/sfc/efx_cxl.c index c982a4cc1119..70b47b7f4d5a 100644 --- a/drivers/net/ethernet/sfc/efx_cxl.c +++ b/drivers/net/ethernet/sfc/efx_cxl.c @@ -96,10 +96,19 @@ int efx_cxl_init(struct efx_probe_data *probe_data) */ 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 err_memdev; + } + probe_data->cxl = cxl; return 0; +err_memdev: + cxl_release_resource(cxl->cxlds, CXL_RES_RAM); err_resource_set: kfree(cxl->cxlds); err_state: