cxl/region: Allow out of order assembly of autodiscovered regions
authorAlison Schofield <alison.schofield@intel.com>
Wed, 31 Jan 2024 21:59:31 +0000 (13:59 -0800)
committerDan Williams <dan.j.williams@intel.com>
Sat, 17 Feb 2024 07:20:34 +0000 (23:20 -0800)
commitcb66b1d60c283bb340a2fc19deff7de8acea74b1
tree227881f6830bf5a6a5cd6da0c4a68b5e13906086
parent453a7fde8031a5192ed2f9646ad048c1a5e930dc
cxl/region: Allow out of order assembly of autodiscovered regions

Autodiscovered regions can fail to assemble if they are not discovered
in HPA decode order. The user will see failure messages like:

[] cxl region0: endpoint5: HPA order violation region1
[] cxl region0: endpoint5: failed to allocate region reference

The check that is causing the failure helps the CXL driver enforce
a CXL spec mandate that decoders be committed in HPA order. The
check is needless for autodiscovered regions since their decoders
are already programmed. Trying to enforce order in the assembly of
these regions is useless because they are assembled once all their
member endpoints arrive, and there is no guarantee on the order in
which endpoints are discovered during probe.

Keep the existing check, but for autodiscovered regions, allow the
out of order assembly after a sanity check that the lesser numbered
decoder has the lesser HPA starting address.

Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Tested-by: Wonjae Lee <wj28.lee@samsung.com>
Link: https://lore.kernel.org/r/3dec69ee97524ab229a20c6739272c3000b18408.1706736863.git.alison.schofield@intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/region.c