Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Not stop kpreempt if unnecessary, ixl(4)



details:   https://anonhg.NetBSD.org/src/rev/a8542e42ecd0
branches:  trunk
changeset: 466971:a8542e42ecd0
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Wed Jan 08 09:12:11 2020 +0000

description:
Not stop kpreempt if unnecessary, ixl(4)

diffstat:

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

diffs (38 lines):

diff -r 7f55e829b7d9 -r a8542e42ecd0 sys/dev/pci/if_ixl.c
--- a/sys/dev/pci/if_ixl.c      Wed Jan 08 08:10:15 2020 +0000
+++ b/sys/dev/pci/if_ixl.c      Wed Jan 08 09:12:11 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ixl.c,v 1.15 2019/12/26 03:55:00 yamaguchi Exp $    */
+/*     $NetBSD: if_ixl.c,v 1.16 2020/01/08 09:12:11 yamaguchi Exp $    */
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -3337,6 +3337,8 @@
        struct ifnet *ifp = &sc->sc_ec.ec_if;
        int link_state;
 
+       KASSERT(kpreempt_disabled());
+
        link_state = ixl_set_link_status(sc, iaq);
 
        if (ifp->if_link_state != link_state)
@@ -3405,7 +3407,9 @@
 
                switch (iaq->iaq_opcode) {
                case htole16(IXL_AQ_OP_PHY_LINK_STATUS):
+                       kpreempt_disable();
                        ixl_link_state_update(sc, iaq);
+                       kpreempt_enable();
                        break;
                }
 
@@ -5665,9 +5669,7 @@
        work = container_of(wk, struct ixl_work, ixw_cookie);
 
        atomic_swap_uint(&work->ixw_added, 0);
-       kpreempt_disable();
        work->ixw_func(work->ixw_arg);
-       kpreempt_enable();
 }
 
 static int



Home | Main Index | Thread Index | Old Index