Skip to content

Commit ecc8635

Browse files
shemmingerbjorn-helgaas
authored andcommitted
PCI: Remove unused Optimized Buffer Flush/Fill support
My philosophy is unused code is dead code. And dead code is subject to bit rot and is a likely source of bugs. Use it or lose it. This reverts 48a92a8 ("PCI: add OBFF enable/disable support"), removing these interfaces: pci_enable_obff() pci_disable_obff() [bhelgaas: split to separate patch, also remove prototypes from pci.h] Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> CC: Jesse Barnes <jbarnes@virtuousgeek.org>
1 parent 3ea8197 commit ecc8635

2 files changed

Lines changed: 0 additions & 89 deletions

File tree

‎drivers/pci/pci.c‎

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -2150,79 +2150,6 @@ void pci_disable_ido(struct pci_dev *dev, unsigned long type)
21502150
}
21512151
EXPORT_SYMBOL(pci_disable_ido);
21522152

2153-
/**
2154-
* pci_enable_obff - enable optimized buffer flush/fill
2155-
* @dev: PCI device
2156-
* @type: type of signaling to use
2157-
*
2158-
* Try to enable @type OBFF signaling on @dev. It will try using WAKE#
2159-
* signaling if possible, falling back to message signaling only if
2160-
* WAKE# isn't supported. @type should indicate whether the PCIe link
2161-
* be brought out of L0s or L1 to send the message. It should be either
2162-
* %PCI_EXP_OBFF_SIGNAL_ALWAYS or %PCI_OBFF_SIGNAL_L0.
2163-
*
2164-
* If your device can benefit from receiving all messages, even at the
2165-
* power cost of bringing the link back up from a low power state, use
2166-
* %PCI_EXP_OBFF_SIGNAL_ALWAYS. Otherwise, use %PCI_OBFF_SIGNAL_L0 (the
2167-
* preferred type).
2168-
*
2169-
* RETURNS:
2170-
* Zero on success, appropriate error number on failure.
2171-
*/
2172-
int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type type)
2173-
{
2174-
u32 cap;
2175-
u16 ctrl;
2176-
int ret;
2177-
2178-
pcie_capability_read_dword(dev, PCI_EXP_DEVCAP2, &cap);
2179-
if (!(cap & PCI_EXP_DEVCAP2_OBFF_MASK))
2180-
return -ENOTSUPP; /* no OBFF support at all */
2181-
2182-
/* Make sure the topology supports OBFF as well */
2183-
if (dev->bus->self) {
2184-
ret = pci_enable_obff(dev->bus->self, type);
2185-
if (ret)
2186-
return ret;
2187-
}
2188-
2189-
pcie_capability_read_word(dev, PCI_EXP_DEVCTL2, &ctrl);
2190-
if (cap & PCI_EXP_DEVCAP2_OBFF_WAKE)
2191-
ctrl |= PCI_EXP_DEVCTL2_OBFF_WAKE_EN;
2192-
else {
2193-
switch (type) {
2194-
case PCI_EXP_OBFF_SIGNAL_L0:
2195-
if (!(ctrl & PCI_EXP_DEVCTL2_OBFF_WAKE_EN))
2196-
ctrl |= PCI_EXP_DEVCTL2_OBFF_MSGA_EN;
2197-
break;
2198-
case PCI_EXP_OBFF_SIGNAL_ALWAYS:
2199-
ctrl &= ~PCI_EXP_DEVCTL2_OBFF_WAKE_EN;
2200-
ctrl |= PCI_EXP_DEVCTL2_OBFF_MSGB_EN;
2201-
break;
2202-
default:
2203-
WARN(1, "bad OBFF signal type\n");
2204-
return -ENOTSUPP;
2205-
}
2206-
}
2207-
pcie_capability_write_word(dev, PCI_EXP_DEVCTL2, ctrl);
2208-
2209-
return 0;
2210-
}
2211-
EXPORT_SYMBOL(pci_enable_obff);
2212-
2213-
/**
2214-
* pci_disable_obff - disable optimized buffer flush/fill
2215-
* @dev: PCI device
2216-
*
2217-
* Disable OBFF on @dev.
2218-
*/
2219-
void pci_disable_obff(struct pci_dev *dev)
2220-
{
2221-
pcie_capability_clear_word(dev, PCI_EXP_DEVCTL2,
2222-
PCI_EXP_DEVCTL2_OBFF_WAKE_EN);
2223-
}
2224-
EXPORT_SYMBOL(pci_disable_obff);
2225-
22262153
static int pci_acs_enable;
22272154

22282155
/**

‎include/linux/pci.h‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,13 +1002,6 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state,
10021002
void pci_enable_ido(struct pci_dev *dev, unsigned long type);
10031003
void pci_disable_ido(struct pci_dev *dev, unsigned long type);
10041004

1005-
enum pci_obff_signal_type {
1006-
PCI_EXP_OBFF_SIGNAL_L0 = 0,
1007-
PCI_EXP_OBFF_SIGNAL_ALWAYS = 1,
1008-
};
1009-
int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type);
1010-
void pci_disable_obff(struct pci_dev *dev);
1011-
10121005
/* For use by arch with custom probe code */
10131006
void set_pcie_port_type(struct pci_dev *pdev);
10141007
void set_pcie_hotplug_bridge(struct pci_dev *pdev);
@@ -1427,15 +1420,6 @@ static inline void pci_disable_ido(struct pci_dev *dev, unsigned long type)
14271420
{
14281421
}
14291422

1430-
static inline int pci_enable_obff(struct pci_dev *dev, unsigned long type)
1431-
{
1432-
return 0;
1433-
}
1434-
1435-
static inline void pci_disable_obff(struct pci_dev *dev)
1436-
{
1437-
}
1438-
14391423
static inline int pci_request_regions(struct pci_dev *dev, const char *res_name)
14401424
{
14411425
return -EIO;

0 commit comments

Comments
 (0)