From patchwork Sat Jan 11 01:27:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 3468721 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 64F03C02DC for ; Sat, 11 Jan 2014 01:27:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6F9062013A for ; Sat, 11 Jan 2014 01:27:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 830A520123 for ; Sat, 11 Jan 2014 01:27:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751208AbaAKB1I (ORCPT ); Fri, 10 Jan 2014 20:27:08 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:48283 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750983AbaAKB1H (ORCPT ); Fri, 10 Jan 2014 20:27:07 -0500 Received: by mail-pa0-f42.google.com with SMTP id lj1so5499974pab.1 for ; Fri, 10 Jan 2014 17:27:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=xTbuv9zK8qSdq+TtV8JlByynxn1UPuw+5ccPp5K+d8M=; b=YuYaNygSi9q5fPHVVgPawVz0cS9ML3azUnY0aDQiaUVCZSibjSPbEgeFtNjoZ53vEf lBj7XW8DbJltBdAvqPY3NQbb7c/ZImkG2XbxupxtAsgyWku4Fvav7Fg/Cr6lyH6lWn2h Yz+lCSNn3GCkH39lvFDWQ85vzU6KqnCzaG+86zZBJ5tirRRjSlCjFMXKUmlU40Os3K5R cmQOXxweOs6Kxe7FlNw2i0E4a11NoyKfluoHCdQUP9BoElmriIuF1WMnDxyEQqg3+u92 KBngnYHomz3FB4U5BPSk65u+dOlp27wAw9BDZ9txe8RWdpyDM6ciR93rOL8U+VrtSc+E w2TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=xTbuv9zK8qSdq+TtV8JlByynxn1UPuw+5ccPp5K+d8M=; b=eoJOXDmm347N1vW1eGlhs2YBaX+KUJBaTDwEJ0RteKyKyXFMQ7GajlPuVC32E2CFML gmLknSGHGzuO39qr/OHmA4mzUHjg0SrKJed4ttk5lWjVGoUYfai4WMXd0Ur4jdl2o6cN myGzYz8s3oV11N9hooUiAetP28UrM2xZRjEO2CE82CBTd4k3S6GMWFxWYqOOgdTZQaP7 tyvSO1JIoIKJp/XBvOaTiFv1gaPsMVtlKoomu08oaUHPlJVrmqp66wjnybk02bQN+/W+ r5WHjAS/VPu26NWkBj4GpzEjA57nuzQ/t/4tH/W77bTC10p5DIqgArfMKk8MsJRR4x/L jFeA== X-Gm-Message-State: ALoCoQm9mWG02iR8LQWO0f6QA9Cp4MoJdnvbEPwKP93uvxDP8bSVYeE5RgWSLn7O9/igqhAvGWwm3wM046BIaswpmMxsuvt6I5WJn5GUSIDZhWn//MAjwjyWIAM66plB+W3Fg3+TWDSosdeBNHkOdS78OYK6C5WyuSuc8Ew1A+W6Q4su5tRQX7qGbeOCeLFqzZgXE9t3d8i3olloBU/CA9oi/ZoKPJmPEw== X-Received: by 10.68.143.33 with SMTP id sb1mr14933426pbb.99.1389403626131; Fri, 10 Jan 2014 17:27:06 -0800 (PST) Received: from localhost ([172.26.52.174]) by mx.google.com with ESMTPSA id by1sm20426565pbd.25.2014.01.10.17.27.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 10 Jan 2014 17:27:05 -0800 (PST) Subject: [PATCH v2 03/12] PCI: Remove unused Optimized Buffer Flush/Fill support To: Stephen Hemminger , linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: Yu Zhao , Jesse Barnes Date: Fri, 10 Jan 2014 18:27:03 -0700 Message-ID: <20140111012703.14505.20187.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20140111012339.14505.40203.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <20140111012339.14505.40203.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Stephen Hemminger 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 Signed-off-by: Bjorn Helgaas CC: Jesse Barnes --- drivers/pci/pci.c | 73 --------------------------------------------------- include/linux/pci.h | 16 ----------- 2 files changed, 89 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;