>After removing the port from port_list, ib_mad_port_close flushes port_priv->wq
>before destroying the special QPs. This means that a completion event could
>arrive, and queue a new work in this work queue after flush.
>
>Signed-off-by: Eli Cohen <[EMAIL PROTECTED]>
>Signed-off-by: Michael S. Tsirkin <[EMAIL PROTECTED]>
>
>Index: latest/drivers/infiniband/core/mad.c
>===================================================================
>--- latest.orig/drivers/infiniband/core/mad.c
>+++ latest/drivers/infiniband/core/mad.c
>@@ -2285,8 +2285,17 @@ static void timeout_sends(void *data)
> static void ib_mad_thread_completion_handler(struct ib_cq *cq, void *arg)
> {
>       struct ib_mad_port_private *port_priv = cq->cq_context;
>+      struct ib_mad_port_private *entry;
>+      unsigned long flags;
>+
>+      spin_lock_irqsave(&ib_mad_port_list_lock, flags);
>+      list_for_each_entry(entry, &ib_mad_port_list, port_list)
>+              if (entry == port_priv) {
>+                      queue_work(port_priv->wq, &port_priv->work);
>+                      break;
>+              }
>
>-      queue_work(port_priv->wq, &port_priv->work);
>+      spin_unlock_irqrestore(&ib_mad_port_list_lock, flags);
> }

There should be some way to fix this that doesn't involve walking a list on
every completion.  Can't the cleanup be changed?  Either move destroying the QP
after the workqueue flush or transition it to the error state before flushing.

- Sean


_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

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

Reply via email to