]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
PCI/ASPM: Remove PCIEASPM_DEBUG Kconfig option and related code
authorHeiner Kallweit <hkallweit1@gmail.com>
Sat, 5 Oct 2019 12:08:52 +0000 (14:08 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 21 Nov 2019 23:31:46 +0000 (17:31 -0600)
Previously, CONFIG_PCIEASPM_DEBUG enabled "link_state" and "clk_ctl" sysfs
files that controlled ASPM.  We believe these files were rarely if ever
used.

We recently added sysfs ASPM controls that are always present, so the debug
code is no longer needed.  Removing this debug code has been discussed for
quite some time, see e.g. [0].

Remove PCIEASPM_DEBUG and the related code.

[0] https://lore.kernel.org/lkml/20180727202619.GD173328@bhelgaas-glaptop.roam.corp.google.com/
Link: https://lore.kernel.org/r/ec935d8e-c084-3938-f1d1-748617596b25@gmail.com
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci-sysfs.c
drivers/pci/pci.h
drivers/pci/pcie/Kconfig
drivers/pci/pcie/aspm.c

index 0e76c02e0b7d46f8ec95fef45b54533c8c3df159..92bf1b1ce28051bef6c64c15058ac05a422c402a 100644 (file)
@@ -1330,7 +1330,6 @@ static int pci_create_capabilities_sysfs(struct pci_dev *dev)
        int retval;
 
        pcie_vpd_create_sysfs_dev_files(dev);
-       pcie_aspm_create_sysfs_dev_files(dev);
 
        if (dev->reset_fn) {
                retval = device_create_file(&dev->dev, &dev_attr_reset);
@@ -1340,7 +1339,6 @@ static int pci_create_capabilities_sysfs(struct pci_dev *dev)
        return 0;
 
 error:
-       pcie_aspm_remove_sysfs_dev_files(dev);
        pcie_vpd_remove_sysfs_dev_files(dev);
        return retval;
 }
@@ -1416,7 +1414,6 @@ int __must_check pci_create_sysfs_dev_files(struct pci_dev *pdev)
 static void pci_remove_capabilities_sysfs(struct pci_dev *dev)
 {
        pcie_vpd_remove_sysfs_dev_files(dev);
-       pcie_aspm_remove_sysfs_dev_files(dev);
        if (dev->reset_fn) {
                device_remove_file(&dev->dev, &dev_attr_reset);
                dev->reset_fn = 0;
index b2cd21e8cb51115353be4620bec90a8bae48e5f7..ae231e3cdd6940bb034c4b5f3050e563ebfbed8a 100644 (file)
@@ -541,14 +541,6 @@ static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev) { }
 static inline void pcie_aspm_powersave_config_link(struct pci_dev *pdev) { }
 #endif
 
-#ifdef CONFIG_PCIEASPM_DEBUG
-void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev);
-void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev);
-#else
-static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev) { }
-static inline void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev) { }
-#endif
-
 #ifdef CONFIG_PCIE_ECRC
 void pcie_set_ecrc_checking(struct pci_dev *dev);
 void pcie_ecrc_get_policy(char *str);
index 362eb8cfa53ba040c5ab955a03dd9773bb751ad3..a2e862d4ec214f8da72d33b7e9df0de542c6b20d 100644 (file)
@@ -79,13 +79,6 @@ config PCIEASPM
 
          When in doubt, say Y.
 
-config PCIEASPM_DEBUG
-       bool "Debug PCI Express ASPM"
-       depends on PCIEASPM
-       help
-         This enables PCI Express ASPM debug support. It will add per-device
-         interface to control ASPM.
-
 choice
        prompt "Default ASPM policy"
        default PCIEASPM_DEFAULT
index 9cd251827a67ffb58ae8f5e6d8059e727daa1b78..0dcd443082284c4bddf9c6a4c22ddb5de8ffbf54 100644 (file)
@@ -1218,111 +1218,6 @@ bool pcie_aspm_enabled(struct pci_dev *pdev)
 }
 EXPORT_SYMBOL_GPL(pcie_aspm_enabled);
 
-#ifdef CONFIG_PCIEASPM_DEBUG
-static ssize_t link_state_show(struct device *dev,
-               struct device_attribute *attr,
-               char *buf)
-{
-       struct pci_dev *pci_device = to_pci_dev(dev);
-       struct pcie_link_state *link_state = pci_device->link_state;
-
-       return sprintf(buf, "%d\n", link_state->aspm_enabled);
-}
-
-static ssize_t link_state_store(struct device *dev,
-               struct device_attribute *attr,
-               const char *buf,
-               size_t n)
-{
-       struct pci_dev *pdev = to_pci_dev(dev);
-       struct pcie_link_state *link, *root = pdev->link_state->root;
-       u32 state;
-
-       if (aspm_disabled)
-               return -EPERM;
-
-       if (kstrtouint(buf, 10, &state))
-               return -EINVAL;
-       if ((state & ~ASPM_STATE_ALL) != 0)
-               return -EINVAL;
-
-       down_read(&pci_bus_sem);
-       mutex_lock(&aspm_lock);
-       list_for_each_entry(link, &link_list, sibling) {
-               if (link->root != root)
-                       continue;
-               pcie_config_aspm_link(link, state);
-       }
-       mutex_unlock(&aspm_lock);
-       up_read(&pci_bus_sem);
-       return n;
-}
-
-static ssize_t clk_ctl_show(struct device *dev,
-               struct device_attribute *attr,
-               char *buf)
-{
-       struct pci_dev *pci_device = to_pci_dev(dev);
-       struct pcie_link_state *link_state = pci_device->link_state;
-
-       return sprintf(buf, "%d\n", link_state->clkpm_enabled);
-}
-
-static ssize_t clk_ctl_store(struct device *dev,
-               struct device_attribute *attr,
-               const char *buf,
-               size_t n)
-{
-       struct pci_dev *pdev = to_pci_dev(dev);
-       bool state;
-
-       if (strtobool(buf, &state))
-               return -EINVAL;
-
-       down_read(&pci_bus_sem);
-       mutex_lock(&aspm_lock);
-       pcie_set_clkpm_nocheck(pdev->link_state, state);
-       mutex_unlock(&aspm_lock);
-       up_read(&pci_bus_sem);
-
-       return n;
-}
-
-static DEVICE_ATTR_RW(link_state);
-static DEVICE_ATTR_RW(clk_ctl);
-
-static char power_group[] = "power";
-void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev)
-{
-       struct pcie_link_state *link_state = pdev->link_state;
-
-       if (!link_state)
-               return;
-
-       if (link_state->aspm_support)
-               sysfs_add_file_to_group(&pdev->dev.kobj,
-                       &dev_attr_link_state.attr, power_group);
-       if (link_state->clkpm_capable)
-               sysfs_add_file_to_group(&pdev->dev.kobj,
-                       &dev_attr_clk_ctl.attr, power_group);
-}
-
-void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev)
-{
-       struct pcie_link_state *link_state = pdev->link_state;
-
-       if (!link_state)
-               return;
-
-       if (link_state->aspm_support)
-               sysfs_remove_file_from_group(&pdev->dev.kobj,
-                       &dev_attr_link_state.attr, power_group);
-       if (link_state->clkpm_capable)
-               sysfs_remove_file_from_group(&pdev->dev.kobj,
-                       &dev_attr_clk_ctl.attr, power_group);
-}
-#endif
-
 static ssize_t aspm_attr_show_common(struct device *dev,
                                     struct device_attribute *attr,
                                     char *buf, u8 state)