Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Use wm_flush_desc_rings() more.



details:   https://anonhg.NetBSD.org/src/rev/32cd7ca82da9
branches:  trunk
changeset: 989924:32cd7ca82da9
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Oct 20 08:10:26 2021 +0000

description:
Use wm_flush_desc_rings() more.

 - Use wm_flush_desc_rings() for newer than PCH_SPT, too. Same as other OSes.
   It seems that some devices has no this errata, but we don't know how to
   identify it. So just use >= PCH_SPT.
 - Use wm_flush_desc_rings() before chip reset in wm_resume(), too.

diffstat:

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

diffs (40 lines):

diff -r d12e09c77713 -r 32cd7ca82da9 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Wed Oct 20 08:06:45 2021 +0000
+++ b/sys/dev/pci/if_wm.c       Wed Oct 20 08:10:26 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.714 2021/10/20 08:06:45 msaitoh Exp $      */
+/*     $NetBSD: if_wm.c,v 1.715 2021/10/20 08:10:26 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.714 2021/10/20 08:06:45 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.715 2021/10/20 08:10:26 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -3293,6 +3293,10 @@
        if (sc->sc_type >= WM_T_PCH2)
                wm_resume_workarounds_pchlan(sc);
        if ((ifp->if_flags & IFF_UP) == 0) {
+               /* >= PCH_SPT hardware workaround before reset. */
+               if (sc->sc_type >= WM_T_PCH_SPT)
+                       wm_flush_desc_rings(sc);
+
                wm_reset(sc);
                /* Non-AMT based hardware can now take control from firmware */
                if ((sc->sc_flags & WM_F_HAS_AMT) == 0)
@@ -6093,8 +6097,8 @@
        if_statadd2(ifp, if_collisions, CSR_READ(sc, WMREG_COLC),
            if_ierrors, CSR_READ(sc, WMREG_RXERRC));
 
-       /* PCH_SPT hardware workaround */
-       if (sc->sc_type == WM_T_PCH_SPT)
+       /* >= PCH_SPT hardware workaround before reset. */
+       if (sc->sc_type >= WM_T_PCH_SPT)
                wm_flush_desc_rings(sc);
 
        /* Reset the chip to a known state. */



Home | Main Index | Thread Index | Old Index