Module Name: src Committed By: msaitoh Date: Fri Oct 20 09:26:13 UTC 2017
Modified Files: src/sys/dev/pci: if_wm.c Log Message: On I219, drop TARC0 bit 28 for DMA hang workaround (from Linux). To generate a diff of this commit: cvs rdiff -u -r1.539 -r1.540 src/sys/dev/pci/if_wm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/if_wm.c diff -u src/sys/dev/pci/if_wm.c:1.539 src/sys/dev/pci/if_wm.c:1.540 --- src/sys/dev/pci/if_wm.c:1.539 Tue Sep 26 08:25:56 2017 +++ src/sys/dev/pci/if_wm.c Fri Oct 20 09:26:13 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.539 2017/09/26 08:25:56 msaitoh Exp $ */ +/* $NetBSD: if_wm.c,v 1.540 2017/10/20 09:26:13 msaitoh Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -83,7 +83,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.539 2017/09/26 08:25:56 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.540 2017/10/20 09:26:13 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -4022,10 +4022,18 @@ wm_initialize_hardware_bits(struct wm_so case WM_T_PCH_LPT: case WM_T_PCH_SPT: /* TARC0 */ - if ((sc->sc_type == WM_T_ICH8) - || (sc->sc_type == WM_T_PCH_SPT)) { + if (sc->sc_type == WM_T_ICH8) { /* Set TARC0 bits 29 and 28 */ tarc0 |= __BITS(29, 28); + } else if (sc->sc_type == WM_T_PCH_SPT) { + tarc0 |= __BIT(29); + /* + * Drop bit 28. From Linux. + * See I218/I219 spec update + * "5. Buffer Overrun While the I219 is + * Processing DMA Transactions" + */ + tarc0 &= ~__BIT(28); } /* Set TARC0 bits 23,24,26,27 */ tarc0 |= __BITS(27, 26) | __BITS(24, 23);