]> git.itanic.dy.fi Git - linux-stable/commit
cxl/acpi: Fix load failures due to single window creation failure
authorDan Williams <dan.j.williams@intel.com>
Sat, 17 Feb 2024 03:11:34 +0000 (19:11 -0800)
committerDan Williams <dan.j.williams@intel.com>
Wed, 21 Feb 2024 06:58:05 +0000 (22:58 -0800)
commit5c6224bfabbf7f3e491c51ab50fd2c6f92ba1141
tree61ded7957a76c98a26b1757f1c862f5ea03ab6a0
parent40de53fd002c6ba087a623722915e8006ed68a02
cxl/acpi: Fix load failures due to single window creation failure

The expectation is that cxl_parse_cfwms() continues in the face the of
failure as evidenced by code like:

    cxlrd = cxl_root_decoder_alloc(root_port, ways, cxl_calc_hb);
    if (IS_ERR(cxlrd))
     return 0;

There are other error paths in that function which mistakenly follow
idiomatic expectations and return an error when they should not. Most of
those mistakes are innocuous checks that hardly ever fail in practice.
However, a recent change succeed in making the implementation more
fragile by applying an idiomatic, but still wrong "fix" [1]. In this
failure case the kernel reports:

    cxl root0: Failed to populate active decoder targets
    cxl_acpi ACPI0017:00: Failed to add decode range: [mem 0x00000000-0x7fffffff flags 0x200]

...which is a real issue with that one window (to be fixed separately),
but ends up failing the entirety of cxl_acpi_probe().

Undo that recent breakage while also removing the confusion about
ignoring errors. Update all exits paths to return an error per typical
expectations and let an outer wrapper function handle dropping the
error.

Fixes: 91019b5bc7c2 ("cxl/acpi: Return 'rc' instead of '0' in cxl_parse_cfmws()") [1]
Cc: <stable@vger.kernel.org>
Cc: Breno Leitao <leitao@debian.org>
Cc: Alison Schofield <alison.schofield@intel.com>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/acpi.c