From patchwork Mon Jan 21 10:22:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 214067 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 73B8B2C0079 for ; Mon, 21 Jan 2013 21:23:14 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TxEWw-0005zf-Nv; Mon, 21 Jan 2013 10:23:06 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TxEWt-0005z6-39 for kernel-team@lists.ubuntu.com; Mon, 21 Jan 2013 10:23:03 +0000 Received: from 79-78-219-214.dynamic.dsl.as9105.com ([79.78.219.214] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TxEWs-0004kf-NQ; Mon, 21 Jan 2013 10:23:03 +0000 From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/2] tg3: Recode PCI MRRS adjustment as a PCI quirk Date: Mon, 21 Jan 2013 10:22:51 +0000 Message-Id: <1358763771-10123-3-git-send-email-apw@canonical.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1358763771-10123-1-git-send-email-apw@canonical.com> References: <1358763771-10123-1-git-send-email-apw@canonical.com> Cc: Andy Whitcroft X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: Matt Carlson This patch recodes the MRRS cap for 5719 A0 devices as a PCI quirk. Signed-off-by: Matt Carlson Signed-off-by: David S. Miller (cherry picked from commit 0b471506712dd734964b3270d2aa88160712c262) BugLink: http://bugs.launchpad.net/bugs/1102209 Signed-off-by: Andy Whitcroft --- drivers/net/ethernet/broadcom/tg3.c | 6 ------ drivers/pci/quirks.c | 18 ++++++++++++++++++ include/linux/pci_ids.h | 1 + 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 81b6268..dbc2d91 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -14071,12 +14071,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) tg3_flag_set(tp, PCI_EXPRESS); - if (tp->pci_chip_rev_id == CHIPREV_ID_5719_A0) { - int readrq = pcie_get_readrq(tp->pdev); - if (readrq > 2048) - pcie_set_readrq(tp->pdev, 2048); - } - pci_read_config_word(tp->pdev, pci_pcie_cap(tp->pdev) + PCI_EXP_LNKCTL, &lnkctl); diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index cab24f7..03163ec 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2161,6 +2161,24 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_5709S, quirk_brcm_570x_limit_vpd); +static void __devinit quirk_brcm_5719_limit_mrrs(struct pci_dev *dev) +{ + u32 rev; + + pci_read_config_dword(dev, 0xf4, &rev); + + /* Only CAP the MRRS if the device is a 5719 A0 */ + if (rev == 0x05719000) { + int readrq = pcie_get_readrq(dev); + if (readrq > 2048) + pcie_set_readrq(dev, 2048); + } +} + +DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_BROADCOM, + PCI_DEVICE_ID_TIGON3_5719, + quirk_brcm_5719_limit_mrrs); + /* Originally in EDAC sources for i82875P: * Intel tells BIOS developers to hide device 6 which * configures the overflow device access containing diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 3db3da1..2c93b4e 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2083,6 +2083,7 @@ #define PCI_DEVICE_ID_NX2_57711E 0x1650 #define PCI_DEVICE_ID_TIGON3_5705 0x1653 #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 +#define PCI_DEVICE_ID_TIGON3_5719 0x1657 #define PCI_DEVICE_ID_TIGON3_5721 0x1659 #define PCI_DEVICE_ID_TIGON3_5722 0x165a #define PCI_DEVICE_ID_TIGON3_5723 0x165b