diff options
author | Dan Williams <dan.j.williams@intel.com> | 2022-05-21 15:35:29 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2022-07-09 19:43:30 -0700 |
commit | d3b75029f353c64e1e0e45ba5083cf8679d17f0a (patch) | |
tree | 8b16fcc122a7bbf74bf8587fc0c0cd9929393642 /tools/testing/cxl | |
parent | 419af595b11891d632a31440b9ca5a3cdf93996d (diff) | |
download | linux-d3b75029f353c64e1e0e45ba5083cf8679d17f0a.tar.gz linux-d3b75029f353c64e1e0e45ba5083cf8679d17f0a.tar.bz2 linux-d3b75029f353c64e1e0e45ba5083cf8679d17f0a.zip |
cxl/mem: Convert partition-info to resources
To date the per-device-partition DPA range information has only been
used for enumeration purposes. In preparation for allocating regions
from available DPA capacity, convert those ranges into DPA-type resource
trees.
With resources and the new add_dpa_res() helper some open coded end
address calculations and debug prints can be cleaned.
The 'cxlds->pmem_res' and 'cxlds->ram_res' resources are child resources
of the total-device DPA space and they in turn will host DPA allocations
from cxl_endpoint_decoder instances (tracked by cxled->dpa_res).
Cc: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/165603878921.551046.8127845916514734142.stgit@dwillia2-xfh
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'tools/testing/cxl')
-rw-r--r-- | tools/testing/cxl/test/mem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/cxl/test/mem.c b/tools/testing/cxl/test/mem.c index 6b9239b2afd4..b81c90715fe8 100644 --- a/tools/testing/cxl/test/mem.c +++ b/tools/testing/cxl/test/mem.c @@ -282,7 +282,7 @@ static int cxl_mock_mem_probe(struct platform_device *pdev) if (IS_ERR(cxlmd)) return PTR_ERR(cxlmd); - if (range_len(&cxlds->pmem_range) && IS_ENABLED(CONFIG_CXL_PMEM)) + if (resource_size(&cxlds->pmem_res) && IS_ENABLED(CONFIG_CXL_PMEM)) rc = devm_cxl_add_nvdimm(dev, cxlmd); return 0; |