mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
cxl: Kill enum cxl_decoder_mode
Now that the operational mode of DPA capacity (ram vs pmem... etc) is tracked in the partition, and no code paths have dependencies on the mode implying the partition index, the ambiguous 'enum cxl_decoder_mode' can be cleaned up, specifically this ambiguity on whether the operation mode implied anything about the partition order. Endpoint decoders simply reference their assigned partition where the operational mode can be retrieved as partition mode. With this in place PMEM can now be partition0 which happens today when the RAM capacity size is zero. Dynamic RAM can appear above PMEM when DCD arrives, etc. Code sequences that hard coded the "PMEM after RAM" assumption can now just iterate partitions and consult the partition mode after the fact. Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Alejandro Lucero <alucerop@amd.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Tested-by: Alejandro Lucero <alucerop@amd.com> Link: https://patch.msgid.link/173864306972.668823.3327008645125276726.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
This commit is contained in:
@@ -97,11 +97,6 @@ int devm_cxl_dpa_reserve(struct cxl_endpoint_decoder *cxled,
|
||||
resource_size_t base, resource_size_t len,
|
||||
resource_size_t skipped);
|
||||
|
||||
enum cxl_partition_mode {
|
||||
CXL_PARTMODE_RAM,
|
||||
CXL_PARTMODE_PMEM,
|
||||
};
|
||||
|
||||
#define CXL_NR_PARTITIONS_MAX 2
|
||||
|
||||
struct cxl_dpa_info {
|
||||
@@ -529,20 +524,6 @@ static inline resource_size_t cxl_pmem_size(struct cxl_dev_state *cxlds)
|
||||
return resource_size(res);
|
||||
}
|
||||
|
||||
/*
|
||||
* Translate the operational mode of memory capacity with the
|
||||
* operational mode of a decoder
|
||||
* TODO: kill 'enum cxl_decoder_mode' to obviate this helper
|
||||
*/
|
||||
static inline enum cxl_decoder_mode cxl_part_mode(enum cxl_partition_mode mode)
|
||||
{
|
||||
if (mode == CXL_PARTMODE_RAM)
|
||||
return CXL_DECODER_RAM;
|
||||
if (mode == CXL_PARTMODE_PMEM)
|
||||
return CXL_DECODER_PMEM;
|
||||
return CXL_DECODER_NONE;
|
||||
}
|
||||
|
||||
static inline struct cxl_dev_state *mbox_to_cxlds(struct cxl_mailbox *cxl_mbox)
|
||||
{
|
||||
return dev_get_drvdata(cxl_mbox->host);
|
||||
|
||||
Reference in New Issue
Block a user