Skip to contentSkip to conversation

Clean up PCI-related Kconfig files with "if" and fix "help"

PATCH In review Robert P. J. Day 2 participants 2 messages May 18, 2014 – May 28, 2014 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Clean up PCI-related Kconfig files with "if" and fix "help"

Simplify some of the PCI-related Kconfig files by replacing numerous explicit dependencies with "if" wrappers"

* PCI
* PCIEPORTBUS
* PCIEASPM

and fix some "help" typoes and formatting. None of this should cause any functional change.

---

Not compile-tested, but "make menuconfig" tested.

drivers/pci/Kconfig +18 -20
index 893503f..cc48eb4 100644
@@ -1,24 +1,26 @@
 #
 # PCI configuration
 #
+
+if PCI
+
 config PCI_MSI
 	bool "Message Signaled Interrupts (MSI and MSI-X)"
-	depends on PCI
 	help
-	   This allows device drivers to enable MSI (Message Signaled
-	   Interrupts).  Message Signaled Interrupts enable a device to
-	   generate an interrupt using an inbound Memory Write on its
-	   PCI bus instead of asserting a device IRQ pin.
+	  This allows device drivers to enable MSI (Message Signaled
+	  Interrupts).  Message Signaled Interrupts enable a device to
+	  generate an interrupt using an inbound Memory Write on its
+	  PCI bus instead of asserting a device IRQ pin.
 
-	   Use of PCI MSI interrupts can be disabled at kernel boot time
-	   by using the 'pci=nomsi' option.  This disables MSI for the
-	   entire system.
+	  Use of PCI MSI interrupts can be disabled at kernel boot time
+	  by using the 'pci=nomsi' option.  This disables MSI for the
+	  entire system.
 
-	   If you don't know what to do here, say Y.
+	  If you don't know what to do here, say Y.
 
 config PCI_DEBUG
 	bool "PCI Debugging"
-	depends on PCI && DEBUG_KERNEL
+	depends on DEBUG_KERNEL
 	help
 	  Say Y here if you want the PCI core to produce a bunch of debug
 	  messages to the system log.  Select this if you are having a
@@ -28,7 +30,6 @@ config PCI_DEBUG
 
 config PCI_REALLOC_ENABLE_AUTO
 	bool "Enable PCI resource re-allocation detection"
-	depends on PCI
 	help
 	  Say Y here if you want the PCI core to detect if PCI resource
 	  re-allocation needs to be enabled. You can always use pci=realloc=on
@@ -41,7 +42,6 @@ config PCI_REALLOC_ENABLE_AUTO
 
 config PCI_STUB
 	tristate "PCI Stub driver"
-	depends on PCI
 	help
 	  Say Y or M here if you want be able to reserve a PCI device
 	  when it is going to be assigned to a guest operating system.
@@ -50,7 +50,7 @@ config PCI_STUB
 
 config XEN_PCIDEV_FRONTEND
         tristate "Xen PCI Frontend"
-        depends on PCI && X86 && XEN
+        depends on X86 && XEN
         select PCI_XEN
 	select XEN_XENBUS_FRONTEND
         default y
@@ -61,18 +61,17 @@ config XEN_PCIDEV_FRONTEND
 config HT_IRQ
 	bool "Interrupts on hypertransport devices"
 	default y
-	depends on PCI && X86_LOCAL_APIC && X86_IO_APIC
+	depends on X86_LOCAL_APIC && X86_IO_APIC
 	help
-	   This allows native hypertransport devices to use interrupts.
+	  This allows native hypertransport devices to use interrupts.
 
-	   If unsure say Y.
+	  If unsure say Y.
 
 config PCI_ATS
 	bool
 
 config PCI_IOV
 	bool "PCI IOV support"
-	depends on PCI
 	select PCI_ATS
 	help
 	  I/O Virtualization is a PCI feature supported by some devices
@@ -83,7 +82,6 @@ config PCI_IOV
 
 config PCI_PRI
 	bool "PCI PRI support"
-	depends on PCI
 	select PCI_ATS
 	help
 	  PRI is the PCI Page Request Interface. It allows PCI devices that are
@@ -93,7 +91,6 @@ config PCI_PRI
 
 config PCI_PASID
 	bool "PCI PASID support"
-	depends on PCI
 	select PCI_ATS
 	help
 	  Process Address Space Identifiers (PASIDs) can be used by PCI devices
@@ -106,7 +103,6 @@ config PCI_PASID
 
 config PCI_IOAPIC
 	bool "PCI IO-APIC hotplug support" if X86
-	depends on PCI
 	depends on ACPI
 	depends on X86_IO_APIC
 	default !X86
@@ -116,3 +112,5 @@ config PCI_LABEL
 	select NLS
 
 source "drivers/pci/host/Kconfig"
+
+endif # PCI
drivers/pci/hotplug/Kconfig +1 -1
index df8caec..334d50d 100644
@@ -81,7 +81,7 @@ config HOTPLUG_PCI_CPCI_ZT5550
 	tristate "Ziatech ZT5550 CompactPCI Hotplug driver"
 	depends on HOTPLUG_PCI_CPCI && X86
 	help
-	  Say Y here if you have an Performance Technologies (formerly Intel,
+	  Say Y here if you have a Performance Technologies (formerly Intel,
           formerly just Ziatech) Ziatech ZT5550 CompactPCI system card.
 
 	  To compile this driver as a module, choose M here: the
drivers/pci/pcie/Kconfig +11 -8
index 7958e59..4a404f3 100644
@@ -10,12 +10,14 @@ config PCIEPORTBUS
 	  Power Management Event support and Virtual Channel support to run
 	  on PCI Express Ports (Root or Switch).
 
+if PCIEPORTBUS
+
 #
 # Include service Kconfig here
 #
 config HOTPLUG_PCI_PCIE
 	bool "PCI Express Hotplug driver"
-	depends on HOTPLUG_PCI && PCIEPORTBUS
+	depends on HOTPLUG_PCI
 	help
 	  Say Y here if you have a motherboard that supports PCI Express Native
 	  Hotplug
@@ -29,7 +31,6 @@ source "drivers/pci/pcie/aer/Kconfig"
 #
 config PCIEASPM
 	bool "PCI Express ASPM control" if EXPERT
-	depends on PCI && PCIEPORTBUS
 	default y
 	help
 	  This enables OS control over PCI Express ASPM (Active State
@@ -44,9 +45,11 @@ config PCIEASPM
 	  /sys/module/pcie_aspm/parameters/policy
 
 	  When in doubt, say Y.
+
+if PCIEASPM
+
 config PCIEASPM_DEBUG
 	bool "Debug PCI Express ASPM"
-	depends on PCIEASPM
 	default n
 	help
 	  This enables PCI Express ASPM debug support. It will add per-device
@@ -55,28 +58,28 @@ config PCIEASPM_DEBUG
 choice
 	prompt "Default ASPM policy"
 	default PCIEASPM_DEFAULT
-	depends on PCIEASPM
 
 config PCIEASPM_DEFAULT
         bool "BIOS default"
-	depends on PCIEASPM
 	help
 	  Use the BIOS defaults for PCI Express ASPM.
 
 config PCIEASPM_POWERSAVE
         bool "Powersave"
-	depends on PCIEASPM
 	help
 	  Enable PCI Express ASPM L0s and L1 where possible, even if the
 	  BIOS did not.
 
 config PCIEASPM_PERFORMANCE
         bool "Performance"
-	depends on PCIEASPM
 	help
 	  Disable PCI Express ASPM L0s and L1, even if the BIOS enabled them.
 endchoice
 
+endif # PCIEASPM
+
 config PCIE_PME
 	def_bool y
-	depends on PCIEPORTBUS && PM_RUNTIME
+	depends on PM_RUNTIME
+
+endif # PCIEPORTBUS
Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
maintainer
#1 lore raw
Quoted 22 lines · Robert P. J. Day

Simplify some of the PCI-related Kconfig files by replacing numerous explicit dependencies with "if" wrappers"

* PCI
* PCIEPORTBUS
* PCIEASPM

and fix some "help" typoes and formatting. None of this should cause any functional change.

---

Not compile-tested, but "make menuconfig" tested.

drivers/pci/Kconfig +0 -0
index 893503f..cc48eb4 100644

drivers/pci/Kconfig line 6

Quoted 6 lines
drivers/pci/Kconfig +3 -0
@@ -1,24 +1,26 @@
 #
 # PCI configuration
 #
+
+if PCI
+

This looks like good stuff. Would you mind splitting the help text cleanups into a separate patch so we have a "no-brainer" typo patch and a smaller one with the more interesting bits?

I think you have some more changes in mind; I hope they're still coming. You mentioned some of these earlier and I added a couple more:

- Fold aer/Kconfig.debug into aer/Kconfig
- Move 'source "drivers/pci/hotplug/Kconfig"' from arch Kconfigs to pci/Kconfig
- Maybe move CONFIG_HOTPLUG_PCI_PCIE to the HOTPLUG_PCI menu?
- Move 'source "drivers/pci/pcie/Kconfig"" from arch Kconfig to pci/Kconfig. This might require some thought -- my guess is that doing this naively will result in adding PCIe code bulk to some arches that don't care about PCI at all. Maybe a new PCIe config symbol selected by the arch would be required.
- arch/x86/kconfig has two "config PCI_MMCONFIG" stanzas; I assume one would be sufficient
- On x86, at least, IOV, PRI, PASID, IO-APIC hotplug, PCI host controller drivers, and Support for PCI Hotplug don't appear nested under "PCI support", which seems wrong

Quoted 209 lines
drivers/pci/Kconfig +15 -20
 config PCI_MSI
 	bool "Message Signaled Interrupts (MSI and MSI-X)"
-	depends on PCI
 	help
-	   This allows device drivers to enable MSI (Message Signaled
-	   Interrupts).  Message Signaled Interrupts enable a device to
-	   generate an interrupt using an inbound Memory Write on its
-	   PCI bus instead of asserting a device IRQ pin.
+	  This allows device drivers to enable MSI (Message Signaled
+	  Interrupts).  Message Signaled Interrupts enable a device to
+	  generate an interrupt using an inbound Memory Write on its
+	  PCI bus instead of asserting a device IRQ pin.
 
-	   Use of PCI MSI interrupts can be disabled at kernel boot time
-	   by using the 'pci=nomsi' option.  This disables MSI for the
-	   entire system.
+	  Use of PCI MSI interrupts can be disabled at kernel boot time
+	  by using the 'pci=nomsi' option.  This disables MSI for the
+	  entire system.
 
-	   If you don't know what to do here, say Y.
+	  If you don't know what to do here, say Y.
 
 config PCI_DEBUG
 	bool "PCI Debugging"
-	depends on PCI && DEBUG_KERNEL
+	depends on DEBUG_KERNEL
 	help
 	  Say Y here if you want the PCI core to produce a bunch of debug
 	  messages to the system log.  Select this if you are having a
@@ -28,7 +30,6 @@ config PCI_DEBUG
 
 config PCI_REALLOC_ENABLE_AUTO
 	bool "Enable PCI resource re-allocation detection"
-	depends on PCI
 	help
 	  Say Y here if you want the PCI core to detect if PCI resource
 	  re-allocation needs to be enabled. You can always use pci=realloc=on
@@ -41,7 +42,6 @@ config PCI_REALLOC_ENABLE_AUTO
 
 config PCI_STUB
 	tristate "PCI Stub driver"
-	depends on PCI
 	help
 	  Say Y or M here if you want be able to reserve a PCI device
 	  when it is going to be assigned to a guest operating system.
@@ -50,7 +50,7 @@ config PCI_STUB
 
 config XEN_PCIDEV_FRONTEND
         tristate "Xen PCI Frontend"
-        depends on PCI && X86 && XEN
+        depends on X86 && XEN
         select PCI_XEN
 	select XEN_XENBUS_FRONTEND
         default y
@@ -61,18 +61,17 @@ config XEN_PCIDEV_FRONTEND
 config HT_IRQ
 	bool "Interrupts on hypertransport devices"
 	default y
-	depends on PCI && X86_LOCAL_APIC && X86_IO_APIC
+	depends on X86_LOCAL_APIC && X86_IO_APIC
 	help
-	   This allows native hypertransport devices to use interrupts.
+	  This allows native hypertransport devices to use interrupts.
 
-	   If unsure say Y.
+	  If unsure say Y.
 
 config PCI_ATS
 	bool
 
 config PCI_IOV
 	bool "PCI IOV support"
-	depends on PCI
 	select PCI_ATS
 	help
 	  I/O Virtualization is a PCI feature supported by some devices
@@ -83,7 +82,6 @@ config PCI_IOV
 
 config PCI_PRI
 	bool "PCI PRI support"
-	depends on PCI
 	select PCI_ATS
 	help
 	  PRI is the PCI Page Request Interface. It allows PCI devices that are
@@ -93,7 +91,6 @@ config PCI_PRI
 
 config PCI_PASID
 	bool "PCI PASID support"
-	depends on PCI
 	select PCI_ATS
 	help
 	  Process Address Space Identifiers (PASIDs) can be used by PCI devices
@@ -106,7 +103,6 @@ config PCI_PASID
 
 config PCI_IOAPIC
 	bool "PCI IO-APIC hotplug support" if X86
-	depends on PCI
 	depends on ACPI
 	depends on X86_IO_APIC
 	default !X86
@@ -116,3 +112,5 @@ config PCI_LABEL
 	select NLS
 
 source "drivers/pci/host/Kconfig"
+
+endif # PCI
drivers/pci/hotplug/Kconfig +1 -1
index df8caec..334d50d 100644
@@ -81,7 +81,7 @@ config HOTPLUG_PCI_CPCI_ZT5550
 	tristate "Ziatech ZT5550 CompactPCI Hotplug driver"
 	depends on HOTPLUG_PCI_CPCI && X86
 	help
-	  Say Y here if you have an Performance Technologies (formerly Intel,
+	  Say Y here if you have a Performance Technologies (formerly Intel,
           formerly just Ziatech) Ziatech ZT5550 CompactPCI system card.
 
 	  To compile this driver as a module, choose M here: the
drivers/pci/pcie/Kconfig +11 -8
index 7958e59..4a404f3 100644
@@ -10,12 +10,14 @@ config PCIEPORTBUS
 	  Power Management Event support and Virtual Channel support to run
 	  on PCI Express Ports (Root or Switch).
 
+if PCIEPORTBUS
+
 #
 # Include service Kconfig here
 #
 config HOTPLUG_PCI_PCIE
 	bool "PCI Express Hotplug driver"
-	depends on HOTPLUG_PCI && PCIEPORTBUS
+	depends on HOTPLUG_PCI
 	help
 	  Say Y here if you have a motherboard that supports PCI Express Native
 	  Hotplug
@@ -29,7 +31,6 @@ source "drivers/pci/pcie/aer/Kconfig"
 #
 config PCIEASPM
 	bool "PCI Express ASPM control" if EXPERT
-	depends on PCI && PCIEPORTBUS
 	default y
 	help
 	  This enables OS control over PCI Express ASPM (Active State
@@ -44,9 +45,11 @@ config PCIEASPM
 	  /sys/module/pcie_aspm/parameters/policy
 
 	  When in doubt, say Y.
+
+if PCIEASPM
+
 config PCIEASPM_DEBUG
 	bool "Debug PCI Express ASPM"
-	depends on PCIEASPM
 	default n
 	help
 	  This enables PCI Express ASPM debug support. It will add per-device
@@ -55,28 +58,28 @@ config PCIEASPM_DEBUG
 choice
 	prompt "Default ASPM policy"
 	default PCIEASPM_DEFAULT
-	depends on PCIEASPM
 
 config PCIEASPM_DEFAULT
         bool "BIOS default"
-	depends on PCIEASPM
 	help
 	  Use the BIOS defaults for PCI Express ASPM.
 
 config PCIEASPM_POWERSAVE
         bool "Powersave"
-	depends on PCIEASPM
 	help
 	  Enable PCI Express ASPM L0s and L1 where possible, even if the
 	  BIOS did not.
 
 config PCIEASPM_PERFORMANCE
         bool "Performance"
-	depends on PCIEASPM
 	help
 	  Disable PCI Express ASPM L0s and L1, even if the BIOS enabled them.
 endchoice
 
+endif # PCIEASPM
+
 config PCIE_PME
 	def_bool y
-	depends on PCIEPORTBUS && PM_RUNTIME
+	depends on PM_RUNTIME
+
+endif # PCIEPORTBUS
Signature · 13 lines
-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html