Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Sep 2023 19:11:30 GMT
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 3287f64a7314 - stable/14 - cxgbe(4): Avoid hang on kldunload on netlink enabled kernels.
Message-ID:  <202309181911.38IJBUF6072868@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by np:

URL: https://cgit.FreeBSD.org/src/commit/?id=3287f64a731406a305b76b86d0b1a7ed47786359

commit 3287f64a731406a305b76b86d0b1a7ed47786359
Author:     Navdeep Parhar <np@FreeBSD.org>
AuthorDate: 2023-09-05 18:21:03 +0000
Commit:     Navdeep Parhar <np@FreeBSD.org>
CommitDate: 2023-09-18 18:57:43 +0000

    cxgbe(4): Avoid hang on kldunload on netlink enabled kernels.
    
    netlink(4) calls back into the driver during detach and it attempts to
    start an internal synchronized op recursively, causing an interruptible
    hang.  Fix it by failing the ioctl if the VI has been marked as DOOMED
    by cxgbe_detach.
    
    Here's the stack for the hang for reference.
     #6  begin_synchronized_op
     #7  cxgbe_media_status
     #8  ifmedia_ioctl
     #9  cxgbe_ioctl
     #10 if_ioctl
     #11 get_operstate_ether
     #12 get_operstate
     #13 dump_iface
     #14 rtnl_handle_ifevent
     #15 rtnl_handle_ifnet_event
     #16 rt_ifmsg
     #17 if_unroute
     #18 if_down
     #19 if_detach_internal
     #20 if_detach
     #21 ether_ifdetach
     #22 cxgbe_vi_detach
     #23 cxgbe_detach
     #24 DEVICE_DETACH
    
    MFC after:      3 days
    Sponsored by:   Chelsio Communications
    
    (cherry picked from commit 3814249f1e8dacfcd326dd7c416c528a1d88b6a1)
---
 sys/dev/cxgbe/t4_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index 759887a2a488..a32cd9a3f2df 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -3459,7 +3459,7 @@ cxgbe_media_status(if_t ifp, struct ifmediareq *ifmr)
 	struct adapter *sc = pi->adapter;
 	struct link_config *lc = &pi->link_cfg;
 
-	if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4med") != 0)
+	if (begin_synchronized_op(sc, vi , SLEEP_OK | INTR_OK, "t4med") != 0)
 		return;
 	PORT_LOCK(pi);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202309181911.38IJBUF6072868>