From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
Dean Nelson <dnelson@redhat.com>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
"David S. Miller" <davem@davemloft.net>
Subject: [11/36] e1000e: dont inadvertently re-set INTX_DISABLE
Date: Fri, 06 Aug 2010 12:19:52 -0700 [thread overview]
Message-ID: <20100806192115.403787611@clark.site> (raw)
In-Reply-To: <20100806192649.GA1614@kroah.com>
2.6.34-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dean Nelson <dnelson@redhat.com>
commit 36f2407fe52c55566221f8c68c8fb808abffd2f5 upstream.
Should e1000_test_msi() fail to see an msi interrupt, it attempts to
fallback to legacy INTx interrupts. But an error in the code may prevent
this from happening correctly.
Before calling e1000_test_msi_interrupt(), e1000_test_msi() disables SERR
by clearing the SERR bit from the just read PCI_COMMAND bits as it writes
them back out.
Upon return from calling e1000_test_msi_interrupt(), it re-enables SERR
by writing out the version of PCI_COMMAND it had previously read.
The problem with this is that e1000_test_msi_interrupt() calls
pci_disable_msi(), which eventually ends up in pci_intx(). And because
pci_intx() was called with enable set to 1, the INTX_DISABLE bit gets
cleared from PCI_COMMAND, which is what we want. But when we get back to
e1000_test_msi(), the INTX_DISABLE bit gets inadvertently re-set because
of the attempt by e1000_test_msi() to re-enable SERR.
The solution is to have e1000_test_msi() re-read the PCI_COMMAND bits as
part of its attempt to re-enable SERR.
During debugging/testing of this issue I found that not all the systems
I ran on had the SERR bit set to begin with. And on some of the systems
the same could be said for the INTX_DISABLE bit. Needless to say these
latter systems didn't have a problem falling back to legacy INTx
interrupts with the code as is.
Signed-off-by: Dean Nelson <dnelson@redhat.com>
Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/e1000e/netdev.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -3041,13 +3041,18 @@ static int e1000_test_msi(struct e1000_a
/* disable SERR in case the MSI write causes a master abort */
pci_read_config_word(adapter->pdev, PCI_COMMAND, &pci_cmd);
- pci_write_config_word(adapter->pdev, PCI_COMMAND,
- pci_cmd & ~PCI_COMMAND_SERR);
+ if (pci_cmd & PCI_COMMAND_SERR)
+ pci_write_config_word(adapter->pdev, PCI_COMMAND,
+ pci_cmd & ~PCI_COMMAND_SERR);
err = e1000_test_msi_interrupt(adapter);
- /* restore previous setting of command word */
- pci_write_config_word(adapter->pdev, PCI_COMMAND, pci_cmd);
+ /* re-enable SERR */
+ if (pci_cmd & PCI_COMMAND_SERR) {
+ pci_read_config_word(adapter->pdev, PCI_COMMAND, &pci_cmd);
+ pci_cmd |= PCI_COMMAND_SERR;
+ pci_write_config_word(adapter->pdev, PCI_COMMAND, pci_cmd);
+ }
/* success ! */
if (!err)
next prev parent reply other threads:[~2010-08-06 19:35 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-06 19:26 [00/36] 2.6.34.3-stable review Greg KH
2010-08-06 19:19 ` [01/36] mm: fix ia64 crash when gcore reads gate area Greg KH
2010-08-06 19:19 ` [02/36] NFS: kswapd must not block in nfs_release_page Greg KH
2010-08-06 19:19 ` [03/36] NFS: Fix a typo in include/linux/nfs_fs.h Greg KH
2010-08-06 19:19 ` [04/36] comedi: Uncripple 8255-based DIO subdevices Greg KH
2010-08-06 19:19 ` [05/36] PARISC: led.c - fix potential stack overflow in led_proc_write() Greg KH
2010-08-06 19:19 ` [06/36] arm/imx/gpio: add spinlock protection Greg KH
2010-08-06 19:19 ` [07/36] parisc: pass through \t to early (iodc) console Greg KH
2010-08-06 19:19 ` [08/36] amd64_edac: Fix DCT base address selector Greg KH
2010-08-06 19:19 ` [09/36] amd64_edac: Correct scrub rate setting Greg KH
2010-08-06 19:19 ` [10/36] amd64_edac: Fix operator precendence error Greg KH
2010-08-06 19:19 ` Greg KH [this message]
2010-08-06 19:19 ` [12/36] e1000e: 82577/82578 PHY register access issues Greg KH
2010-08-06 19:19 ` [13/36] 9p: strlen() doesnt count the terminator Greg KH
2010-08-06 19:19 ` [14/36] igb: Use only a single Tx queue in SR-IOV mode Greg KH
2010-08-06 19:19 ` [15/36] ath9k: enable serialize_regmode for non-PCIE AR9160 Greg KH
2010-08-06 19:19 ` [16/36] ath9k: fix a potential buffer leak in the STA teardown path Greg KH
2010-08-06 19:19 ` [17/36] ath9k_hw: fix an off-by-one error in the PDADC boundaries calculation Greg KH
2010-08-06 19:19 ` [18/36] ath9k: fix TSF after reset on AR913x Greg KH
2010-08-06 19:20 ` [19/36] ath9k: fix yet another buffer leak in the tx aggregation code Greg KH
2010-08-06 19:20 ` [20/36] iwlwifi: fix scan abort Greg KH
2010-08-06 19:20 ` [21/36] cfg80211: ignore spurious deauth Greg KH
2010-08-06 19:20 ` [22/36] cfg80211: dont get expired BSSes Greg KH
2010-08-06 19:20 ` [23/36] mac80211: avoid scheduling while atomic in mesh_rx_plink_frame Greg KH
2010-08-06 19:20 ` [24/36] SCSI: enclosure: fix error path - actually return ERR_PTR() on error Greg KH
2010-08-06 19:20 ` [25/36] GFS2: rename causes kernel Oops Greg KH
2010-08-06 19:20 ` [26/36] KVM: MMU: flush remote tlbs when overwriting spte with different pfn Greg KH
2010-08-06 19:20 ` [27/36] xen: drop xen_sched_clock in favour of using plain wallclock time Greg KH
2010-08-06 19:20 ` [28/36] drm/radeon/kms/igp: sideport is AMD only Greg KH
2010-08-06 19:20 ` [29/36] drm/radeon: add new pci ids Greg KH
2010-08-06 19:20 ` [30/36] drm/radeon/kms/r7xx: add workaround for hw issue with HDP flush Greg KH
2010-08-06 19:20 ` [31/36] drm/i915: Check overlay stride errata for i830 and i845 Greg KH
2010-08-06 19:20 ` [32/36] Revert "ssb: Handle Netbook devices where the SPROM address is changed" Greg KH
2010-08-06 19:20 ` [33/36] ssb: do not read SPROM if it does not exist Greg KH
2010-08-06 19:20 ` [34/36] ssb: Look for SPROM at different offset on higher rev CC Greg KH
2010-08-06 19:20 ` [35/36] ssb: fix NULL ptr deref when pcihost_wrapper is used Greg KH
2010-08-06 19:20 ` [36/36] ssb: Handle alternate SSPROM location Greg KH
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=20100806192115.403787611@clark.site \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=davem@davemloft.net \
--cc=dnelson@redhat.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable-review@kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
/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