summaryrefslogtreecommitdiff
path: root/drivers/cxl/port.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2022-05-18 16:35:11 -0700
committerDan Williams <dan.j.williams@intel.com>2022-05-19 08:50:41 -0700
commit5e5f4ad52f33c125af9b91d4c3b7cad59c13772e (patch)
tree695cfde246ccc8a50a9150cf414d6b5806ddae1b /drivers/cxl/port.c
parent92804edb11f065aadb3a4f398bed8a846a035cd3 (diff)
cxl/port: Move endpoint HDM Decoder Capability init to port driver
The responsibility for establishing HDM Decoder Capability based operation is more closely tied to port enabling than memdev enabling which is concerned with port enumeration. This later enables reusing @cxlhdm for probing / controlling "global enable" for the HDM Decoder Capability. For now, just do the nominal move. Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/165291691167.1426646.7936109077255288258.stgit@dwillia2-xfh Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/cxl/port.c')
-rw-r--r--drivers/cxl/port.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/cxl/port.c b/drivers/cxl/port.c
index d420da5fc39c..a7deaeaf0276 100644
--- a/drivers/cxl/port.c
+++ b/drivers/cxl/port.c
@@ -38,11 +38,22 @@ static int cxl_port_probe(struct device *dev)
if (is_cxl_endpoint(port)) {
struct cxl_memdev *cxlmd = to_cxl_memdev(port->uport);
+ struct cxl_dev_state *cxlds = cxlmd->cxlds;
get_device(&cxlmd->dev);
rc = devm_add_action_or_reset(dev, schedule_detach, cxlmd);
if (rc)
return rc;
+
+ rc = cxl_hdm_decode_init(cxlds);
+ if (rc)
+ return rc;
+
+ rc = cxl_await_media_ready(cxlds);
+ if (rc) {
+ dev_err(dev, "Media not active (%d)\n", rc);
+ return rc;
+ }
} else {
rc = devm_cxl_port_enumerate_dports(port);
if (rc < 0)