Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Fix locking against myself at ixl_link_state_upd...



details:   https://anonhg.NetBSD.org/src/rev/d75357db2c9e
branches:  trunk
changeset: 1008154:d75357db2c9e
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Fri Mar 13 05:40:20 2020 +0000

description:
Fix locking against myself at ixl_link_state_update()
called by ixl_get_link_status()

Though the timing to call the function is change,
there is no order to get link status at initialization.

diffstat:

 sys/dev/pci/if_ixl.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 1ca0a3023ec6 -r d75357db2c9e sys/dev/pci/if_ixl.c
--- a/sys/dev/pci/if_ixl.c      Fri Mar 13 05:10:39 2020 +0000
+++ b/sys/dev/pci/if_ixl.c      Fri Mar 13 05:40:20 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ixl.c,v 1.62 2020/03/12 09:38:10 yamaguchi Exp $    */
+/*     $NetBSD: if_ixl.c,v 1.63 2020/03/13 05:40:20 yamaguchi Exp $    */
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.62 2020/03/12 09:38:10 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.63 2020/03/13 05:40:20 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -2116,8 +2116,6 @@
        SET(ifp->if_flags, IFF_RUNNING);
        CLR(ifp->if_flags, IFF_OACTIVE);
 
-       (void)ixl_get_link_status(sc);
-
        ixl_config_rss(sc);
        ixl_config_queue_intr(sc);
 
@@ -2146,6 +2144,9 @@
        error = ixl_init_locked(sc);
        mutex_exit(&sc->sc_cfg_lock);
 
+       if (error == 0)
+               (void)ixl_get_link_status(sc);
+
        return error;
 }
 
@@ -3683,7 +3684,6 @@
                ixl_get_link_status_done(sc, iaq);
        }
 
-
        mutex_exit(&sc->sc_atq_lock);
 }
 



Home | Main Index | Thread Index | Old Index