linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
	linux-pci@vger.kernel.org
Cc: Yu Zhao <yu.zhao@intel.com>, Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: [PATCH v2 03/12] PCI: Remove unused Optimized Buffer Flush/Fill support
Date: Fri, 10 Jan 2014 18:27:03 -0700	[thread overview]
Message-ID: <20140111012703.14505.20187.stgit@bhelgaas-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <20140111012339.14505.40203.stgit@bhelgaas-glaptop.roam.corp.google.com>

From: Stephen Hemminger <stephen@networkplumber.org>

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>
---
 drivers/pci/pci.c   |   73 ---------------------------------------------------
 include/linux/pci.h |   16 -----------
 2 files changed, 89 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 020f672deabb..84a24d16778f 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2150,79 +2150,6 @@ void pci_disable_ido(struct pci_dev *dev, unsigned long type)
 }
 EXPORT_SYMBOL(pci_disable_ido);
 
-/**
- * pci_enable_obff - enable optimized buffer flush/fill
- * @dev: PCI device
- * @type: type of signaling to use
- *
- * Try to enable @type OBFF signaling on @dev.  It will try using WAKE#
- * signaling if possible, falling back to message signaling only if
- * WAKE# isn't supported.  @type should indicate whether the PCIe link
- * be brought out of L0s or L1 to send the message.  It should be either
- * %PCI_EXP_OBFF_SIGNAL_ALWAYS or %PCI_OBFF_SIGNAL_L0.
- *
- * If your device can benefit from receiving all messages, even at the
- * power cost of bringing the link back up from a low power state, use
- * %PCI_EXP_OBFF_SIGNAL_ALWAYS.  Otherwise, use %PCI_OBFF_SIGNAL_L0 (the
- * preferred type).
- *
- * RETURNS:
- * Zero on success, appropriate error number on failure.
- */
-int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type type)
-{
-	u32 cap;
-	u16 ctrl;
-	int ret;
-
-	pcie_capability_read_dword(dev, PCI_EXP_DEVCAP2, &cap);
-	if (!(cap & PCI_EXP_DEVCAP2_OBFF_MASK))
-		return -ENOTSUPP; /* no OBFF support at all */
-
-	/* Make sure the topology supports OBFF as well */
-	if (dev->bus->self) {
-		ret = pci_enable_obff(dev->bus->self, type);
-		if (ret)
-			return ret;
-	}
-
-	pcie_capability_read_word(dev, PCI_EXP_DEVCTL2, &ctrl);
-	if (cap & PCI_EXP_DEVCAP2_OBFF_WAKE)
-		ctrl |= PCI_EXP_DEVCTL2_OBFF_WAKE_EN;
-	else {
-		switch (type) {
-		case PCI_EXP_OBFF_SIGNAL_L0:
-			if (!(ctrl & PCI_EXP_DEVCTL2_OBFF_WAKE_EN))
-				ctrl |= PCI_EXP_DEVCTL2_OBFF_MSGA_EN;
-			break;
-		case PCI_EXP_OBFF_SIGNAL_ALWAYS:
-			ctrl &= ~PCI_EXP_DEVCTL2_OBFF_WAKE_EN;
-			ctrl |= PCI_EXP_DEVCTL2_OBFF_MSGB_EN;
-			break;
-		default:
-			WARN(1, "bad OBFF signal type\n");
-			return -ENOTSUPP;
-		}
-	}
-	pcie_capability_write_word(dev, PCI_EXP_DEVCTL2, ctrl);
-
-	return 0;
-}
-EXPORT_SYMBOL(pci_enable_obff);
-
-/**
- * pci_disable_obff - disable optimized buffer flush/fill
- * @dev: PCI device
- *
- * Disable OBFF on @dev.
- */
-void pci_disable_obff(struct pci_dev *dev)
-{
-	pcie_capability_clear_word(dev, PCI_EXP_DEVCTL2,
-				   PCI_EXP_DEVCTL2_OBFF_WAKE_EN);
-}
-EXPORT_SYMBOL(pci_disable_obff);
-
 static int pci_acs_enable;
 
 /**
diff --git a/include/linux/pci.h b/include/linux/pci.h
index ee26454746ba..b8cbe52c7a48 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1002,13 +1002,6 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state,
 void pci_enable_ido(struct pci_dev *dev, unsigned long type);
 void pci_disable_ido(struct pci_dev *dev, unsigned long type);
 
-enum pci_obff_signal_type {
-	PCI_EXP_OBFF_SIGNAL_L0 = 0,
-	PCI_EXP_OBFF_SIGNAL_ALWAYS = 1,
-};
-int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type);
-void pci_disable_obff(struct pci_dev *dev);
-
 /* For use by arch with custom probe code */
 void set_pcie_port_type(struct pci_dev *pdev);
 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)
 {
 }
 
-static inline int pci_enable_obff(struct pci_dev *dev, unsigned long type)
-{
-	return 0;
-}
-
-static inline void pci_disable_obff(struct pci_dev *dev)
-{
-}
-
 static inline int pci_request_regions(struct pci_dev *dev, const char *res_name)
 {
 	return -EIO;


  parent reply	other threads:[~2014-01-11  1:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-11  1:26 [PATCH v2 00/12] Remove dead code Bjorn Helgaas
2014-01-11  1:26 ` [PATCH v2 01/12] PCI: Removed unused parts of Page Request Interface support Bjorn Helgaas
2014-01-11  1:26 ` [PATCH v2 02/12] PCI: Remove unused Latency Tolerance Reporting support Bjorn Helgaas
2014-01-11  1:27 ` Bjorn Helgaas [this message]
2014-01-11  1:27 ` [PATCH v2 04/12] PCI: Remove unused ID-Based Ordering support Bjorn Helgaas
2014-01-11  1:27 ` [PATCH v2 05/12] PCI: Remove unused exclusive region support Bjorn Helgaas
2014-01-13 18:12   ` Bjorn Helgaas
2014-01-11  1:27 ` [PATCH v2 06/12] PCI: Remove unused pci_vpd_truncate() Bjorn Helgaas
2014-01-11  1:27 ` [PATCH v2 07/12] PCI: Remove unused pcie_aspm_enabled() Bjorn Helgaas
2014-01-11  1:27 ` [PATCH v2 08/12] PCI: Remove unused pci_renumber_slot() Bjorn Helgaas
2014-01-13 18:43   ` Alex Chiang
2014-01-11  1:27 ` [PATCH v2 09/12] PCI: Remove unused alloc_pci_dev() Bjorn Helgaas
2014-01-11  1:27 ` [PATCH v2 10/12] PCI: Make local functions static Bjorn Helgaas
2014-01-11  1:28 ` [PATCH v2 11/12] PCI: Reorder pci.h so actual interfaces come before stubs Bjorn Helgaas
2014-01-11  1:28 ` [PATCH v2 12/12] PCI: Cleanup pci.h whitespace Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140111012703.14505.20187.stgit@bhelgaas-glaptop.roam.corp.google.com \
    --to=bhelgaas@google.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=yu.zhao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).