Skip to contentSkip to conversation

PCI: Remove MPS/MRRS Kconfig settings

PATCH In review Bjorn Helgaas 1 participant 3 messages Mar 26 – Apr 21 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: Remove MPS/MRRS Kconfig settings

This reverts b0e85c3c8554 ("PCI: Add Kconfig options for MPS/MRRS strategy"), which allowed build-time selection of the "off", "default", "safe", "performance", or "peer2peer" strategies for MPS and MRRS configuration. These strategies can be selected at boot-time using the "pci=pcie_bus_tune_*" kernel parameters.

Per the discussion mentioned below, these Kconfig options were added to work around a hardware defect in a WiFi device used in a cable modem. The defect occurred only when the device was configured with MPS=128, and Kconfig was a way to avoid that setting. It was easier for the modem vendor to use Kconfig and update the kernel image than to change the kernel parameters.

Neither Kconfig nor kernel parameters are a complete solution because the WiFi device may be used in other systems where it may be configured with MPS=128 and be susceptible to the defect.

Remove the Kconfig settings to simplify the MPS code. If we can identify the WiFi device in question, we may be able to make a generic quirk to avoid the problem on all system.

This is not a fix and should not be backported to previous kernels.

---
 drivers/pci/Kconfig | 62 ---------------------------------------------
 drivers/pci/pci.c   | 10 --------
 2 files changed, 72 deletions(-)
drivers/pci/Kconfig +0 -62
index e3f848ffb52a..f1330d219763 100644
@@ -252,68 +252,6 @@ config PCI_DYNAMIC_OF_NODES
 	  Once this option is selected, the device tree nodes will be generated
 	  for all PCI bridges.
 
-choice
-	prompt "PCI Express hierarchy optimization setting"
-	default PCIE_BUS_DEFAULT
-	depends on PCI && EXPERT
-	help
-	  MPS (Max Payload Size) and MRRS (Max Read Request Size) are PCIe
-	  device parameters that affect performance and the ability to
-	  support hotplug and peer-to-peer DMA.
-
-	  The following choices set the MPS and MRRS optimization strategy
-	  at compile-time.  The choices are the same as those offered for
-	  the kernel command-line parameter 'pci', i.e.,
-	  'pci=pcie_bus_tune_off', 'pci=pcie_bus_safe',
-	  'pci=pcie_bus_perf', and 'pci=pcie_bus_peer2peer'.
-
-	  This is a compile-time setting and can be overridden by the above
-	  command-line parameters.  If unsure, choose PCIE_BUS_DEFAULT.
-
-config PCIE_BUS_TUNE_OFF
-	bool "Tune Off"
-	depends on PCI
-	help
-	  Use the BIOS defaults; don't touch MPS at all.  This is the same
-	  as booting with 'pci=pcie_bus_tune_off'.
-
-config PCIE_BUS_DEFAULT
-	bool "Default"
-	depends on PCI
-	help
-	  Default choice; ensure that the MPS matches upstream bridge.
-
-config PCIE_BUS_SAFE
-	bool "Safe"
-	depends on PCI
-	help
-	  Use largest MPS that boot-time devices support.  If you have a
-	  closed system with no possibility of adding new devices, this
-	  will use the largest MPS that's supported by all devices.  This
-	  is the same as booting with 'pci=pcie_bus_safe'.
-
-config PCIE_BUS_PERFORMANCE
-	bool "Performance"
-	depends on PCI
-	help
-	  Use MPS and MRRS for best performance.  Ensure that a given
-	  device's MPS is no larger than its parent MPS, which allows us to
-	  keep all switches/bridges to the max MPS supported by their
-	  parent.  This is the same as booting with 'pci=pcie_bus_perf'.
-
-config PCIE_BUS_PEER2PEER
-	bool "Peer2peer"
-	depends on PCI
-	help
-	  Set MPS = 128 for all devices.  MPS configuration effected by the
-	  other options could cause the MPS on one root port to be
-	  different than that of the MPS on another, which may cause
-	  hot-added devices or peer-to-peer DMA to fail.  Set MPS to the
-	  smallest possible value (128B) system-wide to avoid these issues.
-	  This is the same as booting with 'pci=pcie_bus_peer2peer'.
-
-endchoice
-
 config VGA_ARB
 	bool "VGA Arbitration" if EXPERT
 	default y
drivers/pci/pci.c +0 -10
index 8479c2e1f74f..274c6685344e 100644
@@ -120,17 +120,7 @@ unsigned long pci_hotplug_bus_size = DEFAULT_HOTPLUG_BUS_SIZE;
 
 
 /* PCIe MPS/MRRS strategy; can be overridden by kernel command-line param */
-#ifdef CONFIG_PCIE_BUS_TUNE_OFF
-enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_TUNE_OFF;
-#elif defined CONFIG_PCIE_BUS_SAFE
-enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_SAFE;
-#elif defined CONFIG_PCIE_BUS_PERFORMANCE
-enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_PERFORMANCE;
-#elif defined CONFIG_PCIE_BUS_PEER2PEER
-enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_PEER2PEER;
-#else
 enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_DEFAULT;
-#endif
 
 /*
  * The default CLS is used if arch didn't set CLS explicitly and not
Signature · 1 line
2.51.0
#1 lore raw
Quoted 17 lines · Bjorn Helgaas

This reverts b0e85c3c8554 ("PCI: Add Kconfig options for MPS/MRRS strategy"), which allowed build-time selection of the "off", "default", "safe", "performance", or "peer2peer" strategies for MPS and MRRS configuration. These strategies can be selected at boot-time using the "pci=pcie_bus_tune_*" kernel parameters.

Per the discussion mentioned below, these Kconfig options were added to work around a hardware defect in a WiFi device used in a cable modem. The defect occurred only when the device was configured with MPS=128, and Kconfig was a way to avoid that setting. It was easier for the modem vendor to use Kconfig and update the kernel image than to change the kernel parameters.

Neither Kconfig nor kernel parameters are a complete solution because the WiFi device may be used in other systems where it may be configured with MPS=128 and be susceptible to the defect.

Quoted 8 lines

Remove the Kconfig settings to simplify the MPS code. If we can identify the WiFi device in question, we may be able to make a generic quirk to avoid the problem on all system.

This is not a fix and should not be backported to previous kernels.

I applied this on pci/misc for v7.1.

Quoted 103 lines
---
 drivers/pci/Kconfig | 62 ---------------------------------------------
 drivers/pci/pci.c   | 10 --------
 2 files changed, 72 deletions(-)
drivers/pci/Kconfig +0 -62
index e3f848ffb52a..f1330d219763 100644
@@ -252,68 +252,6 @@ config PCI_DYNAMIC_OF_NODES
 	  Once this option is selected, the device tree nodes will be generated
 	  for all PCI bridges.
 
-choice
-	prompt "PCI Express hierarchy optimization setting"
-	default PCIE_BUS_DEFAULT
-	depends on PCI && EXPERT
-	help
-	  MPS (Max Payload Size) and MRRS (Max Read Request Size) are PCIe
-	  device parameters that affect performance and the ability to
-	  support hotplug and peer-to-peer DMA.
-
-	  The following choices set the MPS and MRRS optimization strategy
-	  at compile-time.  The choices are the same as those offered for
-	  the kernel command-line parameter 'pci', i.e.,
-	  'pci=pcie_bus_tune_off', 'pci=pcie_bus_safe',
-	  'pci=pcie_bus_perf', and 'pci=pcie_bus_peer2peer'.
-
-	  This is a compile-time setting and can be overridden by the above
-	  command-line parameters.  If unsure, choose PCIE_BUS_DEFAULT.
-
-config PCIE_BUS_TUNE_OFF
-	bool "Tune Off"
-	depends on PCI
-	help
-	  Use the BIOS defaults; don't touch MPS at all.  This is the same
-	  as booting with 'pci=pcie_bus_tune_off'.
-
-config PCIE_BUS_DEFAULT
-	bool "Default"
-	depends on PCI
-	help
-	  Default choice; ensure that the MPS matches upstream bridge.
-
-config PCIE_BUS_SAFE
-	bool "Safe"
-	depends on PCI
-	help
-	  Use largest MPS that boot-time devices support.  If you have a
-	  closed system with no possibility of adding new devices, this
-	  will use the largest MPS that's supported by all devices.  This
-	  is the same as booting with 'pci=pcie_bus_safe'.
-
-config PCIE_BUS_PERFORMANCE
-	bool "Performance"
-	depends on PCI
-	help
-	  Use MPS and MRRS for best performance.  Ensure that a given
-	  device's MPS is no larger than its parent MPS, which allows us to
-	  keep all switches/bridges to the max MPS supported by their
-	  parent.  This is the same as booting with 'pci=pcie_bus_perf'.
-
-config PCIE_BUS_PEER2PEER
-	bool "Peer2peer"
-	depends on PCI
-	help
-	  Set MPS = 128 for all devices.  MPS configuration effected by the
-	  other options could cause the MPS on one root port to be
-	  different than that of the MPS on another, which may cause
-	  hot-added devices or peer-to-peer DMA to fail.  Set MPS to the
-	  smallest possible value (128B) system-wide to avoid these issues.
-	  This is the same as booting with 'pci=pcie_bus_peer2peer'.
-
-endchoice
-
 config VGA_ARB
 	bool "VGA Arbitration" if EXPERT
 	default y
drivers/pci/pci.c +0 -10
index 8479c2e1f74f..274c6685344e 100644
@@ -120,17 +120,7 @@ unsigned long pci_hotplug_bus_size = DEFAULT_HOTPLUG_BUS_SIZE;
 
 
 /* PCIe MPS/MRRS strategy; can be overridden by kernel command-line param */
-#ifdef CONFIG_PCIE_BUS_TUNE_OFF
-enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_TUNE_OFF;
-#elif defined CONFIG_PCIE_BUS_SAFE
-enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_SAFE;
-#elif defined CONFIG_PCIE_BUS_PERFORMANCE
-enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_PERFORMANCE;
-#elif defined CONFIG_PCIE_BUS_PEER2PEER
-enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_PEER2PEER;
-#else
 enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_DEFAULT;
-#endif
 
 /*
  * The default CLS is used if arch didn't set CLS explicitly and not
Signature · 1 line
2.51.0
#2 lore raw
Quoted 22 lines · Bjorn Helgaas
Quoted 21 lines · Bjorn Helgaas

This reverts b0e85c3c8554 ("PCI: Add Kconfig options for MPS/MRRS strategy"), which allowed build-time selection of the "off", "default", "safe", "performance", or "peer2peer" strategies for MPS and MRRS configuration. These strategies can be selected at boot-time using the "pci=pcie_bus_tune_*" kernel parameters.

Per the discussion mentioned below, these Kconfig options were added to work around a hardware defect in a WiFi device used in a cable modem. The defect occurred only when the device was configured with MPS=128, and Kconfig was a way to avoid that setting. It was easier for the modem vendor to use Kconfig and update the kernel image than to change the kernel parameters.

Neither Kconfig nor kernel parameters are a complete solution because the WiFi device may be used in other systems where it may be configured with MPS=128 and be susceptible to the defect.

Remove the Kconfig settings to simplify the MPS code. If we can identify the WiFi device in question, we may be able to make a generic quirk to avoid the problem on all system.

Quoted 6 lines
Quoted 4 lines

This is not a fix and should not be backported to previous kernels.

I applied this on pci/misc for v7.1.

I decided not to apply this for v7.1 because there wasn't much time left in the cycle, but I applied it again on pci/enumeration for v7.2.

Quoted 103 lines
Quoted 103 lines
---
 drivers/pci/Kconfig | 62 ---------------------------------------------
 drivers/pci/pci.c   | 10 --------
 2 files changed, 72 deletions(-)
drivers/pci/Kconfig +0 -62
index e3f848ffb52a..f1330d219763 100644
@@ -252,68 +252,6 @@ config PCI_DYNAMIC_OF_NODES
 	  Once this option is selected, the device tree nodes will be generated
 	  for all PCI bridges.
 
-choice
-	prompt "PCI Express hierarchy optimization setting"
-	default PCIE_BUS_DEFAULT
-	depends on PCI && EXPERT
-	help
-	  MPS (Max Payload Size) and MRRS (Max Read Request Size) are PCIe
-	  device parameters that affect performance and the ability to
-	  support hotplug and peer-to-peer DMA.
-
-	  The following choices set the MPS and MRRS optimization strategy
-	  at compile-time.  The choices are the same as those offered for
-	  the kernel command-line parameter 'pci', i.e.,
-	  'pci=pcie_bus_tune_off', 'pci=pcie_bus_safe',
-	  'pci=pcie_bus_perf', and 'pci=pcie_bus_peer2peer'.
-
-	  This is a compile-time setting and can be overridden by the above
-	  command-line parameters.  If unsure, choose PCIE_BUS_DEFAULT.
-
-config PCIE_BUS_TUNE_OFF
-	bool "Tune Off"
-	depends on PCI
-	help
-	  Use the BIOS defaults; don't touch MPS at all.  This is the same
-	  as booting with 'pci=pcie_bus_tune_off'.
-
-config PCIE_BUS_DEFAULT
-	bool "Default"
-	depends on PCI
-	help
-	  Default choice; ensure that the MPS matches upstream bridge.
-
-config PCIE_BUS_SAFE
-	bool "Safe"
-	depends on PCI
-	help
-	  Use largest MPS that boot-time devices support.  If you have a
-	  closed system with no possibility of adding new devices, this
-	  will use the largest MPS that's supported by all devices.  This
-	  is the same as booting with 'pci=pcie_bus_safe'.
-
-config PCIE_BUS_PERFORMANCE
-	bool "Performance"
-	depends on PCI
-	help
-	  Use MPS and MRRS for best performance.  Ensure that a given
-	  device's MPS is no larger than its parent MPS, which allows us to
-	  keep all switches/bridges to the max MPS supported by their
-	  parent.  This is the same as booting with 'pci=pcie_bus_perf'.
-
-config PCIE_BUS_PEER2PEER
-	bool "Peer2peer"
-	depends on PCI
-	help
-	  Set MPS = 128 for all devices.  MPS configuration effected by the
-	  other options could cause the MPS on one root port to be
-	  different than that of the MPS on another, which may cause
-	  hot-added devices or peer-to-peer DMA to fail.  Set MPS to the
-	  smallest possible value (128B) system-wide to avoid these issues.
-	  This is the same as booting with 'pci=pcie_bus_peer2peer'.
-
-endchoice
-
 config VGA_ARB
 	bool "VGA Arbitration" if EXPERT
 	default y
drivers/pci/pci.c +0 -10
index 8479c2e1f74f..274c6685344e 100644
@@ -120,17 +120,7 @@ unsigned long pci_hotplug_bus_size = DEFAULT_HOTPLUG_BUS_SIZE;
 
 
 /* PCIe MPS/MRRS strategy; can be overridden by kernel command-line param */
-#ifdef CONFIG_PCIE_BUS_TUNE_OFF
-enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_TUNE_OFF;
-#elif defined CONFIG_PCIE_BUS_SAFE
-enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_SAFE;
-#elif defined CONFIG_PCIE_BUS_PERFORMANCE
-enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_PERFORMANCE;
-#elif defined CONFIG_PCIE_BUS_PEER2PEER
-enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_PEER2PEER;
-#else
 enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_DEFAULT;
-#endif
 
 /*
  * The default CLS is used if arch didn't set CLS explicitly and not
Signature · 1 line
2.51.0