Skip to content

Commit

Permalink
cxl/port: Move endpoint HDM Decoder Capability init to port driver
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
djbw committed May 19, 2022
1 parent 92804ed commit 5e5f4ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
11 changes: 0 additions & 11 deletions drivers/cxl/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ static void enable_suspend(void *data)
static int cxl_mem_probe(struct device *dev)
{
struct cxl_memdev *cxlmd = to_cxl_memdev(dev);
struct cxl_dev_state *cxlds = cxlmd->cxlds;
struct cxl_port *parent_port;
int rc;

Expand Down Expand Up @@ -94,16 +93,6 @@ static int cxl_mem_probe(struct device *dev)
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;
}

/*
* The kernel may be operating out of CXL memory on this device,
* there is no spec defined way to determine whether this device
Expand Down
11 changes: 11 additions & 0 deletions drivers/cxl/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5e5f4ad

Please sign in to comment.