public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 RESEND] PCI/TPH: Skip Root Port completer check for RC_END devices
@ 2026-01-09  5:29 George Abraham P
  2026-02-18  4:54 ` George Abraham P
  2026-02-18 20:58 ` Bjorn Helgaas
  0 siblings, 2 replies; 6+ messages in thread
From: George Abraham P @ 2026-01-09  5:29 UTC (permalink / raw)
  To: bhelgaas; +Cc: linux-pci, linux-kernel, giovanni.cabiddu, George Abraham P

Root Complex Integrated Endpoint devices (PCI_EXP_TYPE_RC_END) are
directly integrated into the root complex and do not have an
associated Root Port in the traditional PCIe hierarchy. The current
TPH implementation incorrectly attempts to find and check a Root Port's
TPH completer capability for these devices.

Add a check to skip Root Port completer type verification for RC_END
devices, allowing them to use their full TPH requester capability
without being limited by a non-existent Root Port's completer support.

For RC_END devices, the root complex itself acts as the TPH completer,
and this relationship is handled differently than the standard
endpoint-to-Root-Port model.

Fixes: f69767a1ada3 ("PCI: Add TLP Processing Hints (TPH) support")
Signed-off-by: George Abraham P <george.abraham.p@intel.com>
---
v1->v2:
  - Added "Fixes:" tag to link the commit hash that introduced the code
---
 drivers/pci/tph.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/tph.c b/drivers/pci/tph.c
index ca4f97be7538..e896b3958281 100644
--- a/drivers/pci/tph.c
+++ b/drivers/pci/tph.c
@@ -407,10 +407,13 @@ int pcie_enable_tph(struct pci_dev *pdev, int mode)
 	else
 		pdev->tph_req_type = PCI_TPH_REQ_TPH_ONLY;
 
-	rp_req_type = get_rp_completer_type(pdev);
+	/* Check if the device is behind a Root Port */
+	if (pci_pcie_type(pdev) != PCI_EXP_TYPE_RC_END) {
+		rp_req_type = get_rp_completer_type(pdev);
 
-	/* Final req_type is the smallest value of two */
-	pdev->tph_req_type = min(pdev->tph_req_type, rp_req_type);
+		/* Final req_type is the smallest value of two */
+		pdev->tph_req_type = min(pdev->tph_req_type, rp_req_type);
+	}
 
 	if (pdev->tph_req_type == PCI_TPH_REQ_DISABLE)
 		return -EINVAL;
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH V2 RESEND] PCI/TPH: Skip Root Port completer check for RC_END devices
  2026-01-09  5:29 [PATCH V2 RESEND] PCI/TPH: Skip Root Port completer check for RC_END devices George Abraham P
@ 2026-02-18  4:54 ` George Abraham P
  2026-02-18  8:42   ` Leon Romanovsky
  2026-02-18 20:58 ` Bjorn Helgaas
  1 sibling, 1 reply; 6+ messages in thread
From: George Abraham P @ 2026-02-18  4:54 UTC (permalink / raw)
  To: bhelgaas
  Cc: linux-pci, linux-kernel, giovanni.cabiddu, Wei Huang, Jing Liu,
	Paul Luse, Eric Van Tassell, Yishai Hadas, Leon Romanovsky

[+cc TPH authors that were missed in the previous mail]

On 09-Jan-26 10:59 AM, George Abraham P wrote:
> Root Complex Integrated Endpoint devices (PCI_EXP_TYPE_RC_END) are
> directly integrated into the root complex and do not have an
> associated Root Port in the traditional PCIe hierarchy. The current
> TPH implementation incorrectly attempts to find and check a Root Port's
> TPH completer capability for these devices.
> 
> Add a check to skip Root Port completer type verification for RC_END
> devices, allowing them to use their full TPH requester capability
> without being limited by a non-existent Root Port's completer support.
> 
> For RC_END devices, the root complex itself acts as the TPH completer,
> and this relationship is handled differently than the standard
> endpoint-to-Root-Port model.
> 
> Fixes: f69767a1ada3 ("PCI: Add TLP Processing Hints (TPH) support")
> Signed-off-by: George Abraham P <george.abraham.p@intel.com>
> ---
> v1->v2:
>   - Added "Fixes:" tag to link the commit hash that introduced the code
> ---
>  drivers/pci/tph.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/tph.c b/drivers/pci/tph.c
> index ca4f97be7538..e896b3958281 100644
> --- a/drivers/pci/tph.c
> +++ b/drivers/pci/tph.c
> @@ -407,10 +407,13 @@ int pcie_enable_tph(struct pci_dev *pdev, int mode)
>  	else
>  		pdev->tph_req_type = PCI_TPH_REQ_TPH_ONLY;
>  
> -	rp_req_type = get_rp_completer_type(pdev);
> +	/* Check if the device is behind a Root Port */
> +	if (pci_pcie_type(pdev) != PCI_EXP_TYPE_RC_END) {
> +		rp_req_type = get_rp_completer_type(pdev);
>  
> -	/* Final req_type is the smallest value of two */
> -	pdev->tph_req_type = min(pdev->tph_req_type, rp_req_type);
> +		/* Final req_type is the smallest value of two */
> +		pdev->tph_req_type = min(pdev->tph_req_type, rp_req_type);
> +	}
>  
>  	if (pdev->tph_req_type == PCI_TPH_REQ_DISABLE)
>  		return -EINVAL;


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2 RESEND] PCI/TPH: Skip Root Port completer check for RC_END devices
  2026-02-18  4:54 ` George Abraham P
@ 2026-02-18  8:42   ` Leon Romanovsky
  2026-02-18 15:30     ` George Abraham P
  0 siblings, 1 reply; 6+ messages in thread
From: Leon Romanovsky @ 2026-02-18  8:42 UTC (permalink / raw)
  To: George Abraham P
  Cc: bhelgaas, linux-pci, linux-kernel, giovanni.cabiddu, Wei Huang,
	Jing Liu, Paul Luse, Eric Van Tassell, Yishai Hadas

On Wed, Feb 18, 2026 at 10:24:28AM +0530, George Abraham P wrote:
> [+cc TPH authors that were missed in the previous mail]
> 
> On 09-Jan-26 10:59 AM, George Abraham P wrote:
> > Root Complex Integrated Endpoint devices (PCI_EXP_TYPE_RC_END) are
> > directly integrated into the root complex and do not have an
> > associated Root Port in the traditional PCIe hierarchy. The current
> > TPH implementation incorrectly attempts to find and check a Root Port's
> > TPH completer capability for these devices.
> > 
> > Add a check to skip Root Port completer type verification for RC_END
> > devices, allowing them to use their full TPH requester capability
> > without being limited by a non-existent Root Port's completer support.
> > 
> > For RC_END devices, the root complex itself acts as the TPH completer,
> > and this relationship is handled differently than the standard
> > endpoint-to-Root-Port model.
> > 
> > Fixes: f69767a1ada3 ("PCI: Add TLP Processing Hints (TPH) support")
> > Signed-off-by: George Abraham P <george.abraham.p@intel.com>
> > ---
> > v1->v2:
> >   - Added "Fixes:" tag to link the commit hash that introduced the code

I do not have a strong preference; I am fine with adding a Fixes tag or
leaving it out. Up to commit 2961f841b025, pcie_enable_tph() is called
in two drivers: bnxt and mlx5. Which of these devices is the RC_END
device?

Thanks

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2 RESEND] PCI/TPH: Skip Root Port completer check for RC_END devices
  2026-02-18  8:42   ` Leon Romanovsky
@ 2026-02-18 15:30     ` George Abraham P
  2026-02-27  7:08       ` Wei Huang
  0 siblings, 1 reply; 6+ messages in thread
From: George Abraham P @ 2026-02-18 15:30 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: bhelgaas, linux-pci, linux-kernel, giovanni.cabiddu, Wei Huang,
	Jing Liu, Paul Luse, Eric Van Tassell, Yishai Hadas

Hi Leon,

On 18-Feb-26 2:12 PM, Leon Romanovsky wrote:
> On Wed, Feb 18, 2026 at 10:24:28AM +0530, George Abraham P wrote:
>> [+cc TPH authors that were missed in the previous mail]
>>
>> On 09-Jan-26 10:59 AM, George Abraham P wrote:
>>> Root Complex Integrated Endpoint devices (PCI_EXP_TYPE_RC_END) are
>>> directly integrated into the root complex and do not have an
>>> associated Root Port in the traditional PCIe hierarchy. The current
>>> TPH implementation incorrectly attempts to find and check a Root Port's
>>> TPH completer capability for these devices.
>>>
>>> Add a check to skip Root Port completer type verification for RC_END
>>> devices, allowing them to use their full TPH requester capability
>>> without being limited by a non-existent Root Port's completer support.
>>>
>>> For RC_END devices, the root complex itself acts as the TPH completer,
>>> and this relationship is handled differently than the standard
>>> endpoint-to-Root-Port model.
>>>
>>> Fixes: f69767a1ada3 ("PCI: Add TLP Processing Hints (TPH) support")
>>> Signed-off-by: George Abraham P <george.abraham.p@intel.com>
>>> ---
>>> v1->v2:
>>>   - Added "Fixes:" tag to link the commit hash that introduced the code
> 
> I do not have a strong preference; I am fine with adding a Fixes tag or
> leaving it out. Up to commit 2961f841b025, pcie_enable_tph() is called
> in two drivers: bnxt and mlx5. Which of these devices is the RC_END
> device?
> 
> Thanks

qat_6xxx supports TPH and is a RC_END device. The patches to enable TPH on qat_6xxx is yet to be reviewed. However, it requires this fix for the same to work.

Thanks,
George

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2 RESEND] PCI/TPH: Skip Root Port completer check for RC_END devices
  2026-01-09  5:29 [PATCH V2 RESEND] PCI/TPH: Skip Root Port completer check for RC_END devices George Abraham P
  2026-02-18  4:54 ` George Abraham P
@ 2026-02-18 20:58 ` Bjorn Helgaas
  1 sibling, 0 replies; 6+ messages in thread
From: Bjorn Helgaas @ 2026-02-18 20:58 UTC (permalink / raw)
  To: George Abraham P; +Cc: bhelgaas, linux-pci, linux-kernel, giovanni.cabiddu

On Fri, Jan 09, 2026 at 10:59:23AM +0530, George Abraham P wrote:
> Root Complex Integrated Endpoint devices (PCI_EXP_TYPE_RC_END) are
> directly integrated into the root complex and do not have an
> associated Root Port in the traditional PCIe hierarchy. The current
> TPH implementation incorrectly attempts to find and check a Root Port's
> TPH completer capability for these devices.
> 
> Add a check to skip Root Port completer type verification for RC_END
> devices, allowing them to use their full TPH requester capability
> without being limited by a non-existent Root Port's completer support.
> 
> For RC_END devices, the root complex itself acts as the TPH completer,
> and this relationship is handled differently than the standard
> endpoint-to-Root-Port model.
> 
> Fixes: f69767a1ada3 ("PCI: Add TLP Processing Hints (TPH) support")
> Signed-off-by: George Abraham P <george.abraham.p@intel.com>

Applied to pci/enumeration with the following commit log for v7.1,
thanks!  This will be rebased after v7.0-rc1.

    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.
    
> ---
> v1->v2:
>   - Added "Fixes:" tag to link the commit hash that introduced the code
> ---
>  drivers/pci/tph.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/tph.c b/drivers/pci/tph.c
> index ca4f97be7538..e896b3958281 100644
> --- a/drivers/pci/tph.c
> +++ b/drivers/pci/tph.c
> @@ -407,10 +407,13 @@ int pcie_enable_tph(struct pci_dev *pdev, int mode)
>  	else
>  		pdev->tph_req_type = PCI_TPH_REQ_TPH_ONLY;
>  
> -	rp_req_type = get_rp_completer_type(pdev);
> +	/* Check if the device is behind a Root Port */
> +	if (pci_pcie_type(pdev) != PCI_EXP_TYPE_RC_END) {
> +		rp_req_type = get_rp_completer_type(pdev);
>  
> -	/* Final req_type is the smallest value of two */
> -	pdev->tph_req_type = min(pdev->tph_req_type, rp_req_type);
> +		/* Final req_type is the smallest value of two */
> +		pdev->tph_req_type = min(pdev->tph_req_type, rp_req_type);
> +	}
>  
>  	if (pdev->tph_req_type == PCI_TPH_REQ_DISABLE)
>  		return -EINVAL;
> -- 
> 2.40.1
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2 RESEND] PCI/TPH: Skip Root Port completer check for RC_END devices
  2026-02-18 15:30     ` George Abraham P
@ 2026-02-27  7:08       ` Wei Huang
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Huang @ 2026-02-27  7:08 UTC (permalink / raw)
  To: George Abraham P
  Cc: Leon Romanovsky, bhelgaas, linux-pci, linux-kernel,
	giovanni.cabiddu, Jing Liu, Paul Luse, Eric Van Tassell,
	Yishai Hadas

On Wed, Feb 18, 2026 at 09:00:59PM +0530, George Abraham P wrote:
> Hi Leon,
> 
> On 18-Feb-26 2:12 PM, Leon Romanovsky wrote:
> > On Wed, Feb 18, 2026 at 10:24:28AM +0530, George Abraham P wrote:
> >> [+cc TPH authors that were missed in the previous mail]
> >>
> >> On 09-Jan-26 10:59 AM, George Abraham P wrote:
> >>> Root Complex Integrated Endpoint devices (PCI_EXP_TYPE_RC_END) are
> >>> directly integrated into the root complex and do not have an
> >>> associated Root Port in the traditional PCIe hierarchy. The current
> >>> TPH implementation incorrectly attempts to find and check a Root Port's
> >>> TPH completer capability for these devices.
> >>>
> >>> Add a check to skip Root Port completer type verification for RC_END
> >>> devices, allowing them to use their full TPH requester capability
> >>> without being limited by a non-existent Root Port's completer support.
> >>>
> >>> For RC_END devices, the root complex itself acts as the TPH completer,
> >>> and this relationship is handled differently than the standard
> >>> endpoint-to-Root-Port model.
> >>>
> >>> Fixes: f69767a1ada3 ("PCI: Add TLP Processing Hints (TPH) support")
> >>> Signed-off-by: George Abraham P <george.abraham.p@intel.com>
> >>> ---
> >>> v1->v2:
> >>>   - Added "Fixes:" tag to link the commit hash that introduced the code
> > 
> > I do not have a strong preference; I am fine with adding a Fixes tag or
> > leaving it out. Up to commit 2961f841b025, pcie_enable_tph() is called
> > in two drivers: bnxt and mlx5. Which of these devices is the RC_END
> > device?
> > 
> > Thanks
> 
> qat_6xxx supports TPH and is a RC_END device. The patches to enable TPH on qat_6xxx is yet to be reviewed. However, it requires this fix for the same to work.
> 

The patche looks fine to me - it shouldn't affect regular PCI Express Endpoint (type 0000b) devices.

> Thanks,
> George

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-02-27  7:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-09  5:29 [PATCH V2 RESEND] PCI/TPH: Skip Root Port completer check for RC_END devices George Abraham P
2026-02-18  4:54 ` George Abraham P
2026-02-18  8:42   ` Leon Romanovsky
2026-02-18 15:30     ` George Abraham P
2026-02-27  7:08       ` Wei Huang
2026-02-18 20:58 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox