Skip to content

Commit 09d065d

Browse files
aluceropdavejiang
authored andcommitted
cxl: Make region type based on endpoint type
Current code is expecting Type3 or CXL_DECODER_HOSTONLYMEM devices only. Support for Type2 implies region type needs to be based on the endpoint type HDM-D[B] instead. Signed-off-by: Alejandro Lucero <alucerop@amd.com> Reviewed-by: Zhi Wang <zhiw@nvidia.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Ben Cheatham <benjamin.cheatham@amd.com> Reviewed-by: Alison Schofield <alison.schofield@intel.com> Reviewed-by: Davidlohr Bueso <daves@stgolabs.net> Reviewed-by: Gregory Price <gourry@gourry.net> Tested-by: Gregory Price <gourry@gourry.net> Reviewed-by: Davidlohr Bueso <dave@stgolabs.net> Link: https://patch.msgid.link/20260228173603.1125109-2-alejandro.lucero-palau@amd.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
1 parent d537d95 commit 09d065d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

drivers/cxl/core/region.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2650,7 +2650,8 @@ static ssize_t create_ram_region_show(struct device *dev,
26502650
}
26512651

26522652
static struct cxl_region *__create_region(struct cxl_root_decoder *cxlrd,
2653-
enum cxl_partition_mode mode, int id)
2653+
enum cxl_partition_mode mode, int id,
2654+
enum cxl_decoder_type target_type)
26542655
{
26552656
int rc;
26562657

@@ -2672,7 +2673,7 @@ static struct cxl_region *__create_region(struct cxl_root_decoder *cxlrd,
26722673
return ERR_PTR(-EBUSY);
26732674
}
26742675

2675-
return devm_cxl_add_region(cxlrd, id, mode, CXL_DECODER_HOSTONLYMEM);
2676+
return devm_cxl_add_region(cxlrd, id, mode, target_type);
26762677
}
26772678

26782679
static ssize_t create_region_store(struct device *dev, const char *buf,
@@ -2686,7 +2687,7 @@ static ssize_t create_region_store(struct device *dev, const char *buf,
26862687
if (rc != 1)
26872688
return -EINVAL;
26882689

2689-
cxlr = __create_region(cxlrd, mode, id);
2690+
cxlr = __create_region(cxlrd, mode, id, CXL_DECODER_HOSTONLYMEM);
26902691
if (IS_ERR(cxlr))
26912692
return PTR_ERR(cxlr);
26922693

@@ -3902,7 +3903,8 @@ static struct cxl_region *construct_region(struct cxl_root_decoder *cxlrd,
39023903

39033904
do {
39043905
cxlr = __create_region(cxlrd, cxlds->part[part].mode,
3905-
atomic_read(&cxlrd->region_id));
3906+
atomic_read(&cxlrd->region_id),
3907+
cxled->cxld.target_type);
39063908
} while (IS_ERR(cxlr) && PTR_ERR(cxlr) == -EBUSY);
39073909

39083910
if (IS_ERR(cxlr)) {

0 commit comments

Comments
 (0)