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

PCI/TPH: Expose pcie_tph_get_st_table_loc()

Expose pcie_tph_get_st_table_loc() to be used by drivers as will be done
in the next patch from the series.

Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Link: https://patch.msgid.link/20251027-st-direct-mode-v1-1-e0ad953866b6@nvidia.com
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>

authored by

Yishai Hadas and committed by
Leon Romanovsky
7b8a8ec2 eea31f21

+14 -3
+13 -3
drivers/pci/tph.c
··· 155 155 return reg; 156 156 } 157 157 158 - static u32 get_st_table_loc(struct pci_dev *pdev) 158 + /** 159 + * pcie_tph_get_st_table_loc - Return the device's ST table location 160 + * @pdev: PCI device to query 161 + * 162 + * Return: 163 + * PCI_TPH_LOC_NONE - Not present 164 + * PCI_TPH_LOC_CAP - Located in the TPH Requester Extended Capability 165 + * PCI_TPH_LOC_MSIX - Located in the MSI-X Table 166 + */ 167 + u32 pcie_tph_get_st_table_loc(struct pci_dev *pdev) 159 168 { 160 169 u32 reg; 161 170 ··· 172 163 173 164 return FIELD_GET(PCI_TPH_CAP_LOC_MASK, reg); 174 165 } 166 + EXPORT_SYMBOL(pcie_tph_get_st_table_loc); 175 167 176 168 /* 177 169 * Return the size of ST table. If ST table is not in TPH Requester Extended ··· 184 174 u32 loc; 185 175 186 176 /* Check ST table location first */ 187 - loc = get_st_table_loc(pdev); 177 + loc = pcie_tph_get_st_table_loc(pdev); 188 178 189 179 /* Convert loc to match with PCI_TPH_LOC_* defined in pci_regs.h */ 190 180 loc = FIELD_PREP(PCI_TPH_CAP_LOC_MASK, loc); ··· 309 299 */ 310 300 set_ctrl_reg_req_en(pdev, PCI_TPH_REQ_DISABLE); 311 301 312 - loc = get_st_table_loc(pdev); 302 + loc = pcie_tph_get_st_table_loc(pdev); 313 303 /* Convert loc to match with PCI_TPH_LOC_* */ 314 304 loc = FIELD_PREP(PCI_TPH_CAP_LOC_MASK, loc); 315 305
+1
include/linux/pci-tph.h
··· 29 29 void pcie_disable_tph(struct pci_dev *pdev); 30 30 int pcie_enable_tph(struct pci_dev *pdev, int mode); 31 31 u16 pcie_tph_get_st_table_size(struct pci_dev *pdev); 32 + u32 pcie_tph_get_st_table_loc(struct pci_dev *pdev); 32 33 #else 33 34 static inline int pcie_tph_set_st_entry(struct pci_dev *pdev, 34 35 unsigned int index, u16 tag)