Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+5 -2
+1 -1
drivers/cxl/acpi.c
··· 15 15 16 16 static unsigned long cfmws_to_decoder_flags(int restrictions) 17 17 { 18 - unsigned long flags = 0; 18 + unsigned long flags = CXL_DECODER_F_ENABLE; 19 19 20 20 if (restrictions & ACPI_CEDT_CFMWS_RESTRICT_TYPE2) 21 21 flags |= CXL_DECODER_F_TYPE2;
+4 -1
drivers/cxl/core/port.c
··· 1307 1307 port = to_cxl_port(cxld->dev.parent); 1308 1308 if (!is_endpoint_decoder(dev)) { 1309 1309 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"); 1311 1313 return rc; 1314 + } 1312 1315 } 1313 1316 1314 1317 rc = dev_set_name(dev, "decoder%d.%d", port->id, cxld->id);