cxl: Calculate and store PCI link latency for the downstream ports
authorDave Jiang <dave.jiang@intel.com>
Thu, 21 Dec 2023 22:03:39 +0000 (15:03 -0700)
committerDan Williams <dan.j.williams@intel.com>
Fri, 22 Dec 2023 22:53:49 +0000 (14:53 -0800)
commit4d07a05397c8c15c37c8c3abb7afaea1dcd2f0e7
tree593e045747cbd9c3a4bc6babe33bb1b3a32f40f8
parent790815902ec61ba1715fd67d3cb9036e13c942bc
cxl: Calculate and store PCI link latency for the downstream ports

The latency is calculated by dividing the flit size over the bandwidth. Add
support to retrieve the flit size for the CXL switch device and calculate
the latency of the PCIe link. Cache the latency number with cxl_dport.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/170319621931.2212653.6800240203604822886.stgit@djiang5-mobl3
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/core.h
drivers/cxl/core/pci.c
drivers/cxl/core/port.c
drivers/cxl/cxl.h
drivers/cxl/cxlpci.h
drivers/pci/pci.c
include/linux/pci.h