cxl: Fix retrieving of access_coordinates in PCIe path
authorDave Jiang <dave.jiang@intel.com>
Wed, 3 Apr 2024 15:47:13 +0000 (08:47 -0700)
committerDave Jiang <dave.jiang@intel.com>
Mon, 8 Apr 2024 15:24:45 +0000 (08:24 -0700)
commit592780b8391fe31f129ef4823c1513528f4dcb76
tree6bb2e157cc8e45cdc1d5f6f0bee7f7b82e06be65
parent648dae58a830ecceea3b1bebf68432435980f137
cxl: Fix retrieving of access_coordinates in PCIe path

Current loop in cxl_endpoint_get_perf_coordinates() incorrectly assumes
the Root Port (RP) dport is the one with generic port access_coordinate.
However those coordinates are one level up in the Host Bridge (HB).
Current code causes the computation code to pick up 0s as the coordinates
and cause minimal bandwidth to result in 0.

Add check to skip RP when combining coordinates.

Fixes: 14a6960b3e92 ("cxl: Add helper function that calculate performance data for downstream ports")
Reported-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Link: https://lore.kernel.org/r/20240403154844.3403859-3-dave.jiang@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/core/port.c