Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 48a92a8179b3 ("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>

authored by

Stephen Hemminger and committed by
Bjorn Helgaas
ecc86356 3ea8197e

-89
-73
drivers/pci/pci.c
··· 2150 2150 } 2151 2151 EXPORT_SYMBOL(pci_disable_ido); 2152 2152 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 - 2226 2153 static int pci_acs_enable; 2227 2154 2228 2155 /**
-16
include/linux/pci.h
··· 1002 1002 void pci_enable_ido(struct pci_dev *dev, unsigned long type); 1003 1003 void pci_disable_ido(struct pci_dev *dev, unsigned long type); 1004 1004 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 - 1012 1005 /* For use by arch with custom probe code */ 1013 1006 void set_pcie_port_type(struct pci_dev *pdev); 1014 1007 void set_pcie_hotplug_bridge(struct pci_dev *pdev); ··· 1417 1424 } 1418 1425 1419 1426 static inline void pci_disable_ido(struct pci_dev *dev, unsigned long type) 1420 - { 1421 - } 1422 - 1423 - static inline int pci_enable_obff(struct pci_dev *dev, unsigned long type) 1424 - { 1425 - return 0; 1426 - } 1427 - 1428 - static inline void pci_disable_obff(struct pci_dev *dev) 1429 1427 { 1430 1428 } 1431 1429