Skip to content
Snippets Groups Projects
Commit 5311f19e authored by Julio Faracco's avatar Julio Faracco
Browse files

Merge: Revert "cxl/acpi: Fix load failures due to single window creation failure"

MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/619

Revert "cxl/acpi: Fix load failures due to single window creation failure"

This commit was pinpointed as the cause of CXL being unavailable on certain Samsung machines.

## Approved Development Ticket(s)
All submissions to CentOS Stream must reference a ticket in [Red Hat Jira](https://issues.redhat.com/).

JIRA: https://issues.redhat.com/browse/RHEL-82540



Resolves: RHEL-82540

Signed-off-by: default avatarJohn W. Linville <linville@redhat.com>

Approved-by: default avatarMyron Stowe <mstowe@redhat.com>
Approved-by: default avatarLenny Szubowicz <lszubowi@redhat.com>
Approved-by: default avatarCKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com>

Merged-by: default avatarJulio Faracco <jfaracco@redhat.com>
parents 73618e29 74761262
No related branches found
No related tags found
No related merge requests found
...@@ -340,20 +340,24 @@ static int add_or_reset_cxl_resource(struct resource *parent, struct resource *r ...@@ -340,20 +340,24 @@ static int add_or_reset_cxl_resource(struct resource *parent, struct resource *r
DEFINE_FREE(put_cxlrd, struct cxl_root_decoder *, DEFINE_FREE(put_cxlrd, struct cxl_root_decoder *,
if (!IS_ERR_OR_NULL(_T)) put_device(&_T->cxlsd.cxld.dev)) if (!IS_ERR_OR_NULL(_T)) put_device(&_T->cxlsd.cxld.dev))
DEFINE_FREE(del_cxl_resource, struct resource *, if (_T) del_cxl_resource(_T)) DEFINE_FREE(del_cxl_resource, struct resource *, if (_T) del_cxl_resource(_T))
static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws, static int cxl_parse_cfmws(union acpi_subtable_headers *header, void *arg,
struct cxl_cfmws_context *ctx) const unsigned long end)
{ {
int target_map[CXL_DECODER_MAX_INTERLEAVE]; int target_map[CXL_DECODER_MAX_INTERLEAVE];
struct cxl_cfmws_context *ctx = arg;
struct cxl_port *root_port = ctx->root_port; struct cxl_port *root_port = ctx->root_port;
struct cxl_cxims_context cxims_ctx; struct cxl_cxims_context cxims_ctx;
struct device *dev = ctx->dev; struct device *dev = ctx->dev;
struct acpi_cedt_cfmws *cfmws;
struct cxl_decoder *cxld; struct cxl_decoder *cxld;
unsigned int ways, i, ig; unsigned int ways, i, ig;
int rc; int rc;
cfmws = (struct acpi_cedt_cfmws *) header;
rc = cxl_acpi_cfmws_verify(dev, cfmws); rc = cxl_acpi_cfmws_verify(dev, cfmws);
if (rc) if (rc)
return rc; return 0;
rc = eiw_to_ways(cfmws->interleave_ways, &ways); rc = eiw_to_ways(cfmws->interleave_ways, &ways);
if (rc) if (rc)
...@@ -378,7 +382,7 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws, ...@@ -378,7 +382,7 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
cxl_root_decoder_alloc(root_port, ways); cxl_root_decoder_alloc(root_port, ways);
if (IS_ERR(cxlrd)) if (IS_ERR(cxlrd))
return PTR_ERR(cxlrd); return 0;
cxld = &cxlrd->cxlsd.cxld; cxld = &cxlrd->cxlsd.cxld;
cxld->flags = cfmws_to_decoder_flags(cfmws->restrictions); cxld->flags = cfmws_to_decoder_flags(cfmws->restrictions);
...@@ -421,29 +425,16 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws, ...@@ -421,29 +425,16 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
rc = cxl_decoder_add(cxld, target_map); rc = cxl_decoder_add(cxld, target_map);
if (rc) if (rc)
return rc; return rc;
return cxl_root_decoder_autoremove(dev, no_free_ptr(cxlrd)); rc = cxl_root_decoder_autoremove(dev, no_free_ptr(cxlrd));
} if (rc) {
dev_err(dev, "Failed to add decode range: %pr", res);
static int cxl_parse_cfmws(union acpi_subtable_headers *header, void *arg, return rc;
const unsigned long end) }
{ dev_dbg(dev, "add: %s node: %d range [%#llx - %#llx]\n",
struct acpi_cedt_cfmws *cfmws = (struct acpi_cedt_cfmws *)header; dev_name(&cxld->dev),
struct cxl_cfmws_context *ctx = arg; phys_to_target_node(cxld->hpa_range.start),
struct device *dev = ctx->dev; cxld->hpa_range.start, cxld->hpa_range.end);
int rc;
rc = __cxl_parse_cfmws(cfmws, ctx);
if (rc)
dev_err(dev,
"Failed to add decode range: [%#llx - %#llx] (%d)\n",
cfmws->base_hpa,
cfmws->base_hpa + cfmws->window_size - 1, rc);
else
dev_dbg(dev, "decode range: node: %d range [%#llx - %#llx]\n",
phys_to_target_node(cfmws->base_hpa), cfmws->base_hpa,
cfmws->base_hpa + cfmws->window_size - 1);
/* never fail cxl_acpi load for a single window failure */
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment