Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PCI/TPH: Allow TPH enable for RCiEPs

Previously, pcie_enable_tph() only enabled TLP Processing Hints (TPH) if
both the Endpoint and its Root Port advertised TPH support.

Root Complex Integrated Endpoints (RCiEPs) are directly integrated into a
Root Complex and do not have an associated Root Port, so pcie_enable_tph()
never enabled TPH for RCiEPs.

PCIe r7.0 doesn't seem to include a way to learn whether a Root Complex
supports TPH, but sec 2.2.7.1.1 says Functions that lack TPH support should
ignore TPH, and maybe the same is true for Root Complexes:

A Function that does not support the TPH Completer or Routing capability
and receives a transaction with the TH bit [which indicates the presence
of TPH in the TLP header] Set is required to ignore the TH bit and handle
the Request in the same way as Requests of the same transaction type
without the TH bit Set.

Allow drivers to enable TPH for any RCiEP with a TPH Requester Capability.

Fixes: f69767a1ada3 ("PCI: Add TLP Processing Hints (TPH) support")
Signed-off-by: George Abraham P <george.abraham.p@intel.com>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260109052923.1170070-1-george.abraham.p@intel.com

authored by

George Abraham P and committed by
Bjorn Helgaas
d3e996a5 6de23f81

+6 -3
+6 -3
drivers/pci/tph.c
··· 407 407 else 408 408 pdev->tph_req_type = PCI_TPH_REQ_TPH_ONLY; 409 409 410 - rp_req_type = get_rp_completer_type(pdev); 410 + /* Check if the device is behind a Root Port */ 411 + if (pci_pcie_type(pdev) != PCI_EXP_TYPE_RC_END) { 412 + rp_req_type = get_rp_completer_type(pdev); 411 413 412 - /* Final req_type is the smallest value of two */ 413 - pdev->tph_req_type = min(pdev->tph_req_type, rp_req_type); 414 + /* Final req_type is the smallest value of two */ 415 + pdev->tph_req_type = min(pdev->tph_req_type, rp_req_type); 416 + } 414 417 415 418 if (pdev->tph_req_type == PCI_TPH_REQ_DISABLE) 416 419 return -EINVAL;