Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Count timeout correctly. This change reduce time...



details:   https://anonhg.NetBSD.org/src/rev/f8d2938970ef
branches:  trunk
changeset: 831955:f8d2938970ef
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Apr 23 01:29:23 2018 +0000

description:
Count timeout correctly. This change reduce timeout value for 80003 as
expected. Reported by mouse@.

diffstat:

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

diffs (35 lines):

diff -r 019011bdc523 -r f8d2938970ef sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Sun Apr 22 20:32:27 2018 +0000
+++ b/sys/dev/pci/if_wm.c       Mon Apr 23 01:29:23 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.574 2018/04/20 03:03:13 msaitoh Exp $      */
+/*     $NetBSD: if_wm.c,v 1.575 2018/04/23 01:29:23 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.574 2018/04/20 03:03:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.575 2018/04/23 01:29:23 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -13069,7 +13069,7 @@
        else
                timeout = 200;
 
-       for (timeout = 0; timeout < 200; timeout++) {
+       while (timeout) {
                if (wm_get_swsm_semaphore(sc)) {
                        aprint_error_dev(sc->sc_dev,
                            "%s: failed to get semaphore\n",
@@ -13085,6 +13085,7 @@
                }
                wm_put_swsm_semaphore(sc);
                delay(5000);
+               timeout--;
        }
        printf("%s: failed to get swfw semaphore mask 0x%x swfw 0x%x\n",
            device_xname(sc->sc_dev), mask, swfw_sync);



Home | Main Index | Thread Index | Old Index