cxl/mem: Convert partition-info to resources
authorDan Williams <dan.j.williams@intel.com>
Sat, 21 May 2022 22:35:29 +0000 (15:35 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sun, 10 Jul 2022 02:43:30 +0000 (19:43 -0700)
commitd3b75029f353c64e1e0e45ba5083cf8679d17f0a
tree8b16fcc122a7bbf74bf8587fc0c0cd9929393642
parent419af595b11891d632a31440b9ca5a3cdf93996d
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>
drivers/cxl/core/mbox.c
drivers/cxl/core/memdev.c
drivers/cxl/cxlmem.h
drivers/cxl/pci.c
tools/testing/cxl/test/mem.c