[ofa-general] ***SPAM*** [PATCH v2] ipoib: fix hang while bringing down uninitialized interface

Yossi Etigin yossi.openib at gmail.com
Mon Sep 15 11:18:04 PDT 2008


Fix bug #1172: If a pkey for an interface is not found during
initialization, then poll_timer is left uninitialized. When the
device is brought down, ipoib tries to del_timer_sync() it. This
call hangs in an infinite loop in lock_timer_base(), because
timer_base is NULL. We should check whether the timer was really
initialized.

Changes from v1:
 - handle a case when ipoib_ib_dev_stop() is called twice on the
   same dev->priv - zero the timer after its deletion.

Signed-off-by: Yossi Etigin <yosefe at voltaire.com> 

PS
Vlad, please replace the patch ipoib_0400_fix_hang_while_bringing_down
by this one.

--

Index: b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
===================================================================
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c	2008-09-09 19:54:11.000000000 +0300
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c	2008-09-15 20:58:50.000000000 +0300
@@ -850,7 +850,12 @@ int ipoib_ib_dev_stop(struct net_device 
 	ipoib_dbg(priv, "All sends and receives done.\n");
 
 timeout:
-	del_timer_sync(&priv->poll_timer);
+	/* Make sure the timer was initialized */
+	if (priv->poll_timer.function) {
+		del_timer_sync(&priv->poll_timer);
+		memset(&priv->poll_timer, 0, sizeof priv->poll_timer);
+	}
+
 	qp_attr.qp_state = IB_QPS_RESET;
 	if (ib_modify_qp(priv->qp, &qp_attr, IB_QP_STATE))
 		ipoib_warn(priv, "Failed to modify QP to RESET state\n");



More information about the general mailing list