Message ID | 20250217-mhi_bw_up-v1-7-9bad1e42bdb1@oss.qualcomm.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | bus: mhi: host: Add support for mhi bus bw | expand |
On 2/16/2025 10:34 PM, Krishna Chaitanya Chundru wrote: > diff --git a/include/linux/pci.h b/include/linux/pci.h > index 58f1de626c37..8a3b3195122d 100644 > --- a/include/linux/pci.h > +++ b/include/linux/pci.h > @@ -305,6 +305,7 @@ enum pci_bus_speed { > > enum pci_bus_speed pcie_get_speed_cap(struct pci_dev *dev); > enum pcie_link_width pcie_get_width_cap(struct pci_dev *dev); > +extern const unsigned char pcie_link_speed[]; This, and the Patch 8/8 change that uses it, make me cringe. Should we instead have a functional interface so that the client calls a function to perform the lookup? /jeff
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 01e51db8d285..ada9a0433a99 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -82,7 +82,6 @@ struct pcie_tlp_log; #define PCIE_MSG_CODE_DEASSERT_INTC 0x26 #define PCIE_MSG_CODE_DEASSERT_INTD 0x27 -extern const unsigned char pcie_link_speed[]; extern bool pci_early_dump; bool pcie_cap_has_lnkctl(const struct pci_dev *dev); diff --git a/drivers/pci/pcie/bwctrl.c b/drivers/pci/pcie/bwctrl.c index e3faa4d1f935..dc01c93bcc37 100644 --- a/drivers/pci/pcie/bwctrl.c +++ b/drivers/pci/pcie/bwctrl.c @@ -214,6 +214,7 @@ int pcie_set_target_speed(struct pci_dev *port, enum pci_bus_speed speed_req, return ret; } +EXPORT_SYMBOL_GPL(pcie_set_target_speed); static void pcie_bwnotif_enable(struct pcie_device *srv) { diff --git a/include/linux/pci.h b/include/linux/pci.h index 58f1de626c37..8a3b3195122d 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -305,6 +305,7 @@ enum pci_bus_speed { enum pci_bus_speed pcie_get_speed_cap(struct pci_dev *dev); enum pcie_link_width pcie_get_width_cap(struct pci_dev *dev); +extern const unsigned char pcie_link_speed[]; struct pci_vpd { struct mutex lock;
It can be used by the PCIe client drivers and reduce the code duplication. And export pci_set_target_speed() so that other kernel drivers can use it. Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com> --- drivers/pci/pci.h | 1 - drivers/pci/pcie/bwctrl.c | 1 + include/linux/pci.h | 1 + 3 files changed, 2 insertions(+), 1 deletion(-)