@@ -112,10 +112,19 @@ int efx_cxl_init(struct efx_probe_data *probe_data)
goto sfc_put_decoder;
}
+ cxl->efx_region = cxl_create_region(cxl->cxlrd, cxl->cxled, 1, true);
+ if (IS_ERR(cxl->efx_region)) {
+ pci_err(pci_dev, "CXL accel create region failed");
+ rc = PTR_ERR(cxl->efx_region);
+ goto err_region;
+ }
+
probe_data->cxl = cxl;
return 0;
+err_region:
+ cxl_dpa_free(cxl->cxled);
sfc_put_decoder:
cxl_put_root_decoder(cxl->cxlrd);
return rc;
@@ -124,6 +133,7 @@ int efx_cxl_init(struct efx_probe_data *probe_data)
void efx_cxl_exit(struct efx_probe_data *probe_data)
{
if (probe_data->cxl) {
+ cxl_accel_region_detach(probe_data->cxl->cxled);
cxl_dpa_free(probe_data->cxl->cxled);
cxl_put_root_decoder(probe_data->cxl->cxlrd);
}