summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2015-02-11 23:21:48 +0000
committerBrad Smith <brad@cvs.openbsd.org>2015-02-11 23:21:48 +0000
commit2d34bd4a668fcf2e31b2cf126e20e282c437033e (patch)
tree56be393e0897020ba5762fa223585bed03f1a2fe /sys/dev/pci
parent74e19fb222f0da41bf9c3e7aaed9fb36e43e9dba (diff)
Disable the L1 ASPM link state to workaround errata with the
82571 / 82572 controllers. As noticed in the Linux driver and there is related errata for that too. ok jsg@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_em.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 09037cd043b..8717fa45228 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.294 2015/02/11 21:27:08 brad Exp $ */
+/* $OpenBSD: if_em.c,v 1.295 2015/02/11 23:21:47 brad Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -3199,6 +3199,8 @@ em_disable_aspm(struct em_softc *sc)
pcireg_t val;
switch (sc->hw.mac_type) {
+ case em_82571:
+ case em_82572:
case em_82573:
case em_82574:
break;
@@ -3213,7 +3215,21 @@ em_disable_aspm(struct em_softc *sc)
/* Disable PCIe Active State Power Management (ASPM). */
val = pci_conf_read(sc->osdep.em_pa.pa_pc, sc->osdep.em_pa.pa_tag,
offset + PCI_PCIE_LCSR);
- val &= ~(PCI_PCIE_LCSR_ASPM_L0S | PCI_PCIE_LCSR_ASPM_L1);
+
+ switch (sc->hw.mac_type) {
+ case em_82571:
+ case em_82572:
+ val &= ~PCI_PCIE_LCSR_ASPM_L1;
+ break;
+ case em_82573:
+ case em_82574:
+ val &= ~(PCI_PCIE_LCSR_ASPM_L0S |
+ PCI_PCIE_LCSR_ASPM_L1);
+ break;
+ default:
+ break;
+ }
+
pci_conf_write(sc->osdep.em_pa.pa_pc, sc->osdep.em_pa.pa_tag,
offset + PCI_PCIE_LCSR, val);
}