Module Name: src
Committed By: yamaguchi
Date: Fri Mar 13 05:40:20 UTC 2020
Modified Files:
src/sys/dev/pci: if_ixl.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/pci/if_ixl.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/if_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.62 src/sys/dev/pci/if_ixl.c:1.63
--- src/sys/dev/pci/if_ixl.c:1.62 Thu Mar 12 09:38:10 2020
+++ src/sys/dev/pci/if_ixl.c Fri Mar 13 05:40:20 2020
@@ -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 @@ ixl_init_locked(struct ixl_softc *sc)
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 @@ ixl_init(struct ifnet *ifp)
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(void *xsc)
ixl_get_link_status_done(sc, iaq);
}
-
mutex_exit(&sc->sc_atq_lock);
}