Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci On I219, drop TARC0 bit 28 for DMA hang workarou...



details:   https://anonhg.NetBSD.org/src/rev/f85b99de30fb
branches:  trunk
changeset: 827209:f85b99de30fb
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Oct 20 09:26:13 2017 +0000

description:
On I219, drop TARC0 bit 28 for DMA hang workaround (from Linux).

diffstat:

 sys/dev/pci/if_wm.c |  16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 9b7b776a7d6b -r f85b99de30fb sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Fri Oct 20 08:04:39 2017 +0000
+++ b/sys/dev/pci/if_wm.c       Fri Oct 20 09:26:13 2017 +0000
@@ -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 @@
                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);



Home | Main Index | Thread Index | Old Index