Skip to content

Commit 0909b4e

Browse files
committed
cxl/core/port: Fix / relax decoder target enumeration
If the decoder is not presently active the target_list may not be accurate. Perform a best effort mapping and assume that it will be fixed up when the decoder is enabled. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/164317464406.3438644.6609329492458460242.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 64cda3a commit 0909b4e

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/cxl/acpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
static unsigned long cfmws_to_decoder_flags(int restrictions)
1717
{
18-
unsigned long flags = 0;
18+
unsigned long flags = CXL_DECODER_F_ENABLE;
1919

2020
if (restrictions & ACPI_CEDT_CFMWS_RESTRICT_TYPE2)
2121
flags |= CXL_DECODER_F_TYPE2;

drivers/cxl/core/port.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1307,8 +1307,11 @@ int cxl_decoder_add_locked(struct cxl_decoder *cxld, int *target_map)
13071307
port = to_cxl_port(cxld->dev.parent);
13081308
if (!is_endpoint_decoder(dev)) {
13091309
rc = decoder_populate_targets(cxld, port, target_map);
1310-
if (rc)
1310+
if (rc && (cxld->flags & CXL_DECODER_F_ENABLE)) {
1311+
dev_err(&port->dev,
1312+
"Failed to populate active decoder targets\n");
13111313
return rc;
1314+
}
13121315
}
13131316

13141317
rc = dev_set_name(dev, "decoder%d.%d", port->id, cxld->id);

0 commit comments

Comments
 (0)