Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci After writing MDIC register, don't read quickly ...



details:   https://anonhg.NetBSD.org/src/rev/d3601d73127a
branches:  trunk
changeset: 994343:d3601d73127a
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Nov 02 08:09:21 2018 +0000

description:
After writing MDIC register, don't read quickly the same register but
do delay(50). Same as otehr OSes.

diffstat:

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

diffs (42 lines):

diff -r ebba8b9bc552 -r d3601d73127a sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Fri Nov 02 08:04:42 2018 +0000
+++ b/sys/dev/pci/if_wm.c       Fri Nov 02 08:09:21 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.592 2018/11/02 08:04:42 msaitoh Exp $      */
+/*     $NetBSD: if_wm.c,v 1.593 2018/11/02 08:09:21 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.592 2018/11/02 08:04:42 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.593 2018/11/02 08:09:21 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -10087,10 +10087,10 @@
            MDIC_REGADD(reg));
 
        for (i = 0; i < WM_GEN_POLL_TIMEOUT * 3; i++) {
+               delay(50);
                mdic = CSR_READ(sc, WMREG_MDIC);
                if (mdic & MDIC_READY)
                        break;
-               delay(50);
        }
 
        if ((mdic & MDIC_READY) == 0) {
@@ -10141,10 +10141,10 @@
            MDIC_REGADD(reg) | MDIC_DATA(val));
 
        for (i = 0; i < WM_GEN_POLL_TIMEOUT * 3; i++) {
+               delay(50);
                mdic = CSR_READ(sc, WMREG_MDIC);
                if (mdic & MDIC_READY)
                        break;
-               delay(50);
        }
 
        if ((mdic & MDIC_READY) == 0) {



Home | Main Index | Thread Index | Old Index