> Changed from v3
>       * added a flush_scheduled_work call before we restart the QP in order
>         to ensure that the pkey table we read from the cache is updated


+void ipoib_ib_dev_restart_qp(struct work_struct *work)
+{
+       struct ipoib_dev_priv *priv =
+               container_of(work, struct ipoib_dev_priv, restart_qp_task);
+       /* We only restart the QP in case of pkey change event */
+       ipoib_dbg(priv, "Flushing %s and restarting it's QP\n", 
priv->dev->name);
+       /* Ensures the pkey table we read  from the cache is updated properly */
+       flush_scheduled_work();
+       __ipoib_ib_dev_flush(priv, 1);
+}
+

I think doing flush_scheduled_work from inside the ipoib workqueue
can trigger deadlocks - which deadlocks the workqueue was
created to avoid, in the first place. Look at the comment
in ipoib_main.c where the WQ is created.

And, I don't think that depending on the fact that the cache
uses a default schedule queue internally is such a good idea.

How about simply requeueing the work again if the cache query failed?

-- 
MST
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to