@@ -4617,6 +4617,9 @@
nomio [S390] Do not use MIO instructions.
norid [S390] ignore the RID field and force use of
one PCI domain per PCI function
+ nostmode [PCIE] If PCIe TPH Processing Hints (TPH) is
+ enabled, this kernel option forces all Steering
+ Tags to be treated as zero (aka "No ST Mode").
pcie_aspm= [PCIE] Forcibly enable or ignore PCIe Active State Power
Management.
@@ -6870,6 +6870,8 @@ static int __init pci_setup(char *str)
pci_no_domains();
} else if (!strncmp(str, "noari", 5)) {
pcie_ari_disabled = true;
+ } else if (!strncmp(str, "nostmode", 8)) {
+ pci_tph_set_nostmode();
} else if (!strncmp(str, "cbiosize=", 9)) {
pci_cardbus_io_size = memparse(str + 9, &str);
} else if (!strncmp(str, "cbmemsize=", 10)) {
@@ -574,10 +574,12 @@ static inline int pci_iov_bus_range(struct pci_bus *bus)
#ifdef CONFIG_PCIE_TPH
void pci_restore_tph_state(struct pci_dev *dev);
void pci_save_tph_state(struct pci_dev *dev);
+void pci_tph_set_nostmode(void);
void pci_tph_init(struct pci_dev *dev);
#else
static inline void pci_restore_tph_state(struct pci_dev *dev) { }
static inline void pci_save_tph_state(struct pci_dev *dev) { }
+static inline void pci_tph_set_nostmode(void) { }
static inline void pci_tph_init(struct pci_dev *dev) { }
#endif
@@ -48,6 +48,8 @@ union st_info {
u64 value;
};
+static bool pci_tph_nostmode;
+
static u16 tph_extract_tag(enum tph_mem_type mem_type, u8 req_type,
union st_info *info)
{
@@ -433,6 +435,10 @@ int pcie_enable_tph(struct pci_dev *pdev, int mode)
return -EINVAL;
}
+ /* Honor "nostmode" kernel parameter */
+ if (pci_tph_nostmode)
+ pdev->tph_mode = PCI_TPH_NO_ST_MODE;
+
/* Get req_type supported by device and its Root Port */
reg = pci_read_config_dword(pdev, pdev->tph_cap + PCI_TPH_CAP, ®);
if (FIELD_GET(PCI_TPH_CAP_EXT_TPH, reg))
@@ -545,6 +551,12 @@ void pci_save_tph_state(struct pci_dev *pdev)
}
}
+void pci_tph_set_nostmode(void)
+{
+ pci_tph_nostmode = true;
+ pr_info("PCIe TPH No ST Mode is enabled\n");
+}
+
void pci_tph_init(struct pci_dev *pdev)
{
pdev->tph_cap = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_TPH);