From patchwork Fri Oct 17 04:26:57 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 4797 X-Patchwork-Delegate: jgarzik@pobox.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 1236ADDDFA for ; Fri, 17 Oct 2008 15:27:19 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751141AbYJQE1R (ORCPT ); Fri, 17 Oct 2008 00:27:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751136AbYJQE1R (ORCPT ); Fri, 17 Oct 2008 00:27:17 -0400 Received: from qmta03.westchester.pa.mail.comcast.net ([76.96.62.32]:37191 "EHLO QMTA03.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750801AbYJQE1Q (ORCPT ); Fri, 17 Oct 2008 00:27:16 -0400 Received: from OMTA04.westchester.pa.mail.comcast.net ([76.96.62.35]) by QMTA03.westchester.pa.mail.comcast.net with comcast id TdiB1a0030ldTLk53gTFgu; Fri, 17 Oct 2008 04:27:15 +0000 Received: from gitlost.lost ([63.64.152.142]) by OMTA04.westchester.pa.mail.comcast.net with comcast id TgSx1a00F34bfcX3QgT0Dh; Fri, 17 Oct 2008 04:27:13 +0000 X-Authority-Analysis: v=1.0 c=1 a=Jt33dP_fgwwA:10 a=q7Sy3Evb6pQA:10 a=8V5ffpAmAPNQ-gl77_UA:9 a=5aDyzTFc2_nlJnT2qaEA:7 a=x0wpP4zssC9kJbT2bt6MA2T0JK4A:4 a=dGJ0OcVc7YAA:10 a=iYlkOlhu7C0A:10 From: Jeff Kirsher Subject: [PATCH] igb: fix tx data corruption with transition to L0s on 82575 To: jeff@garzik.org Cc: netdev@vger.kernel.org, davem@davemloft.net, Alexander Duyck , Jeff Kirsher Date: Thu, 16 Oct 2008 21:26:57 -0700 Message-ID: <20081017042657.7080.17171.stgit@gitlost.lost> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Alexander Duyck The 82575 has an issue in which the DMA will go out of sync if the link partner goes into an L0s state. To prevent this we set the pci-e link partner capability bits to disable the L0s transition on the hw. Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher --- drivers/net/igb/igb_main.c | 27 +++++++++++++++++++++++++-- 1 files changed, 25 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" 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/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 93d02ef..53cbeae 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c @@ -966,10 +966,11 @@ static int __devinit igb_probe(struct pci_dev *pdev, struct net_device *netdev; struct igb_adapter *adapter; struct e1000_hw *hw; + struct pci_dev *us_dev; const struct e1000_info *ei = igb_info_tbl[ent->driver_data]; unsigned long mmio_start, mmio_len; - int i, err, pci_using_dac; - u16 eeprom_data = 0; + int i, err, pci_using_dac, pos; + u16 eeprom_data = 0, state = 0; u16 eeprom_apme_mask = IGB_EEPROM_APME; u32 part_num; int bars, need_ioport; @@ -1004,6 +1005,28 @@ static int __devinit igb_probe(struct pci_dev *pdev, } } + /* 82575 requires that the pci-e link partner disable the L0s state */ + switch (pdev->device) { + case E1000_DEV_ID_82575EB_COPPER: + case E1000_DEV_ID_82575EB_FIBER_SERDES: + case E1000_DEV_ID_82575GB_QUAD_COPPER: + us_dev = pdev->bus->self; + pos = pci_find_capability(us_dev, PCI_CAP_ID_EXP); + if (pos) { + pci_read_config_word(us_dev, pos + PCI_EXP_LNKCTL, + &state); + state &= ~PCIE_LINK_STATE_L0S; + pci_write_config_word(us_dev, pos + PCI_EXP_LNKCTL, + state); + printk(KERN_INFO "Disabling ASPM L0s upstream switch " + "port %x:%x.%x\n", us_dev->bus->number, + PCI_SLOT(us_dev->devfn), + PCI_FUNC(us_dev->devfn)); + } + default: + break; + } + err = pci_request_selected_regions(pdev, bars, igb_driver_name); if (err) goto err_pci_reg;