|
| 1 | +cxl: core/region - ignore interleave granularity when ways=1 |
| 2 | + |
| 3 | +jira LE-4395 |
| 4 | +Rebuild_History Non-Buildable kernel-6.12.0-55.39.1.el10_0 |
| 5 | +commit-author Gregory Price <gourry@gourry.net> |
| 6 | +commit ce32b0c9c522e5a69ef9c62a56d6ca08fb036d67 |
| 7 | +Empty-Commit: Cherry-Pick Conflicts during history rebuild. |
| 8 | +Will be included in final tarball splat. Ref for failed cherry-pick at: |
| 9 | +ciq/ciq_backports/kernel-6.12.0-55.39.1.el10_0/ce32b0c9.failed |
| 10 | + |
| 11 | +When validating decoder IW/IG when setting up regions, the granularity |
| 12 | +is irrelevant when iw=1 - all accesses will always route to the only |
| 13 | +target anyway - so all ig values are "correct". Loosen the requirement |
| 14 | +that `ig = (parent_iw * parent_ig)` when iw=1. |
| 15 | + |
| 16 | +On some Zen5 platforms, the platform BIOS specifies a 256-byte |
| 17 | +interleave granularity window for host bridges when there is only |
| 18 | +one target downstream. This leads to Linux rejecting the configuration |
| 19 | +of a region with a x2 root with two x1 hostbridges. |
| 20 | + |
| 21 | +Decoder Programming: |
| 22 | + root - iw:2 ig:256 |
| 23 | + hb1 - iw:1 ig:256 (Linux expects 512) |
| 24 | + hb2 - iw:1 ig:256 (Linux expects 512) |
| 25 | + ep1 - iw:2 ig:256 |
| 26 | + ep2 - iw:2 ig:256 |
| 27 | + |
| 28 | +This change allows all decoders downstream of a passthrough decoder to |
| 29 | +also be configured as passthrough (iw:1 ig:X), but still disallows |
| 30 | +downstream decoders from applying subsequent interleaves. |
| 31 | + |
| 32 | +e.g. in the above example if there was another decoder south of hb1 |
| 33 | +attempting to interleave 2 endpoints - Linux would enforce hb1.ig=512 |
| 34 | +because the southern decoder would have iw:2 and require ig=pig*piw. |
| 35 | + |
| 36 | +[DJ: Fixed up against 6.15-rc1] |
| 37 | + |
| 38 | + Signed-off-by: Gregory Price <gourry@gourry.net> |
| 39 | + Reviewed-by: Dave Jiang <dave.jiang@intel.com> |
| 40 | + Tested-by: Li Zhijian <lizhijian@fujitsu.com> |
| 41 | + Reviewed-by: Davidlohr Bueso <dave@stgolabs.net> |
| 42 | + Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> |
| 43 | + Reviewed-by: Dan Williams <dan.j.williams@intel.com> |
| 44 | +Link: https://patch.msgid.link/20250402232552.999634-1-gourry@gourry.net |
| 45 | + Signed-off-by: Dave Jiang <dave.jiang@intel.com> |
| 46 | +(cherry picked from commit ce32b0c9c522e5a69ef9c62a56d6ca08fb036d67) |
| 47 | + Signed-off-by: Jonathan Maple <jmaple@ciq.com> |
| 48 | + |
| 49 | +# Conflicts: |
| 50 | +# drivers/cxl/core/region.c |
| 51 | +diff --cc drivers/cxl/core/region.c |
| 52 | +index dff618c708dc,80caaf14d08a..000000000000 |
| 53 | +--- a/drivers/cxl/core/region.c |
| 54 | ++++ b/drivers/cxl/core/region.c |
| 55 | +@@@ -1412,9 -1446,8 +1412,14 @@@ static int cxl_port_setup_targets(struc |
| 56 | + |
| 57 | + if (test_bit(CXL_REGION_F_AUTO, &cxlr->flags)) { |
| 58 | + if (cxld->interleave_ways != iw || |
| 59 | +++<<<<<<< HEAD |
| 60 | + + cxld->interleave_granularity != ig || |
| 61 | + + cxld->hpa_range.start != p->res->start || |
| 62 | + + cxld->hpa_range.end != p->res->end || |
| 63 | +++======= |
| 64 | ++ (iw > 1 && cxld->interleave_granularity != ig) || |
| 65 | ++ !region_res_match_cxl_range(p, &cxld->hpa_range) || |
| 66 | +++>>>>>>> ce32b0c9c522 (cxl: core/region - ignore interleave granularity when ways=1) |
| 67 | + ((cxld->flags & CXL_DECODER_F_ENABLE) == 0)) { |
| 68 | + dev_err(&cxlr->dev, |
| 69 | + "%s:%s %s expected iw: %d ig: %d %pr\n", |
| 70 | +* Unmerged path drivers/cxl/core/region.c |
0 commit comments