mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Jeff Johnson" <jjohnson@kernel.org>,
	"Bartosz Golaszewski" <brgl@bgdev.pl>,
	"Manivannan Sadhasivam" <mani@kernel.org>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, mhi@lists.linux.dev,
	linux-wireless@vger.kernel.org, ath11k@lists.infradead.org,
	qiang.yu@oss.qualcomm.com
Subject: Re: [PATCH v6 3/7] PCI: Add pci_lnkctl2_bus_speed() to convert lnkctl2speed to pci_bus_speed
Date: Fri, 20 Nov 2026 11:10:50 -0600	[thread overview]
Message-ID: <20261120171050.GA891038@bhelgaas> (raw)
In-Reply-To: <20261119-bwscale-v6-3-9a9a715fcb46@oss.qualcomm.com>

On Thu, Nov 19, 2026 at 06:26:35PM +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@oss.qualcomm.com>

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

Nit below.

> ---
>  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 7c6f2aba8144..a89955617bec 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -6056,6 +6056,21 @@ int pcie_link_bandwidth_mbps(struct pci_dev *pdev)
>  }
>  EXPORT_SYMBOL(pcie_link_bandwidth_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 2.5 GT/s - 32 GT/s)
> + *
> + * Convert the Target Link Speed (TLS) field value from the Link Control 2 register
> + * to the corresponding enum pci_bus_speed.

Wrap these to fit in 80 columns like the rest of the file.

> + * Return: pci_bus_speed corresponding to the TLS value
> + */
> +enum pci_bus_speed pci_lnkctl2_bus_speed(u32 speed)
> +{
> +	return pcie_link_speed[speed];
> +}
> +EXPORT_SYMBOL(pci_lnkctl2_bus_speed);
> +
>  /**
>   * pcie_bandwidth_available - determine minimum link settings of a PCIe
>   *			      device and its bandwidth limitation
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 352079393edb..d12875c95491 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1739,6 +1739,7 @@ int pci_cfg_space_size(struct pci_dev *dev);
>  unsigned char pci_bus_max_busnr(struct pci_bus *bus);
>  resource_size_t pcibios_window_alignment(struct pci_bus *bus,
>  					 unsigned long type);
> +enum pci_bus_speed pci_lnkctl2_bus_speed(u32 speed);
>  
>  #define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0)
>  #define PCI_VGA_STATE_CHANGE_DECODES (1 << 1)
> 
> -- 
> 2.34.1
> 

  reply	other threads:[~2026-11-20 17:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 12:56 [PATCH v6 0/7] bus: mhi: host: Add support for mhi bus bw Krishna Chaitanya Chundru
2026-11-19 12:56 ` [PATCH v6 1/7] PCI/bwctrl: Set host bridge OPP and optionally disable ASPM around link retraining Krishna Chaitanya Chundru
2026-11-20 17:07   ` Bjorn Helgaas
2026-11-19 12:56 ` [PATCH v6 2/7] PCI: Export pci_set_target_speed() Krishna Chaitanya Chundru
2026-11-20 17:08   ` Bjorn Helgaas
2026-11-19 12:56 ` [PATCH v6 3/7] PCI: Add pci_lnkctl2_bus_speed() to convert lnkctl2speed to pci_bus_speed Krishna Chaitanya Chundru
2026-11-20 17:10   ` Bjorn Helgaas [this message]
2026-11-19 12:56 ` [PATCH v6 4/7] bus: mhi: host: Add support for Bandwidth scale Krishna Chaitanya Chundru
2026-11-19 12:56 ` [PATCH v6 5/7] wifi: ath11k: Add support for MHI bandwidth scaling Krishna Chaitanya Chundru
2026-11-19 12:56 ` [PATCH v6 6/7] wifi: ath12k: " Krishna Chaitanya Chundru
2026-11-19 12:56 ` [PATCH v6 7/7] PCI: qcom: Enable ASPM disabling during link retraining Krishna Chaitanya Chundru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261120171050.GA891038@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=ath11k@lists.infradead.org \
    --cc=bhelgaas@google.com \
    --cc=brgl@bgdev.pl \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jingoohan1@gmail.com \
    --cc=jjohnson@kernel.org \
    --cc=krishna.chundru@oss.qualcomm.com \
    --cc=kwilczynski@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=mhi@lists.linux.dev \
    --cc=qiang.yu@oss.qualcomm.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®