Re: [PATCH v5 3/6] PCI: Add pci_lnkctl2_bus_speed() to convert lnkctl2speed to pci_bus_speed

From: Manivannan Sadhasivam

Date: Tue Sep 01 2026 - 04:01:04 EST


On Wed, Aug 19, 2026 at 06:55:54PM +0530, Krishna Chaitanya Chundru wrote:
> Add a exported function to convert lnkctl2speed to enum pci_bus_speed,
> so that other kernel drivers can use it.
>
> Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@xxxxxxxxxxxxxxxx>
> ---
> drivers/pci/pci.c | 15 +++++++++++++++
> include/linux/pci.h | 1 +
> 2 files changed, 16 insertions(+)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 77b17b13ee61..cda7d210ddbf 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -5939,6 +5939,21 @@ int pcie_link_speed_mbps(struct pci_dev *pdev)
> }
> EXPORT_SYMBOL(pcie_link_speed_mbps);
>
> +/**
> + * pci_lnkctl2_bus_speed - convert Link Control 2 Target Link Speed to pci_bus_speed
> + * @speed: Target Link Speed (TLS) value from Link Control 2 register (0-4 for Gen1-Gen5)

Use GT/S instead of Gen.

- Mani

--
மணிவண்ணன் சதாசிவம்