]> git.karo-electronics.de Git - linux-beck.git/commitdiff
IB/ipath: Wait for PIO available interrupt
authorRalph Campbell <ralph.campbell@qlogic.com>
Mon, 18 Jun 2007 21:24:43 +0000 (14:24 -0700)
committerRoland Dreier <rolandd@cisco.com>
Tue, 10 Jul 2007 03:12:26 +0000 (20:12 -0700)
The send function is called when posting new send work requests.
There is no point in trying to send a packet if the QP is already
waiting for a HW send buffer so don't clear the busy bit until the
buffer available interrupt happens.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/ipath/ipath_ruc.c
drivers/infiniband/hw/ipath/ipath_verbs.c

index 8c5d20a4b5f3a835949ede8a338cc79a2d6df198..837118676cc779c8fde1b5f926aca37fbb561ee0 100644 (file)
@@ -503,11 +503,9 @@ void ipath_no_bufs_available(struct ipath_qp *qp, struct ipath_ibdev *dev)
         * could be called.  If we are still in the tasklet function,
         * tasklet_hi_schedule() will not call us until the next time
         * tasklet_hi_schedule() is called.
-        * We clear the tasklet flag now since we are committing to return
-        * from the tasklet function.
+        * We leave the busy flag set so that another post send doesn't
+        * try to put the same QP on the piowait list again.
         */
-       clear_bit(IPATH_S_BUSY, &qp->s_busy);
-       tasklet_unlock(&qp->s_task);
        want_buffer(dev->dd);
        dev->n_piowait++;
 }
index 04294ca0a81f9d83c756701f6672003fd64a71ef..cd79a8ca5104213426ba5b82acea6131da2411e3 100644 (file)
@@ -948,6 +948,7 @@ int ipath_ib_piobufavail(struct ipath_ibdev *dev)
                qp = list_entry(dev->piowait.next, struct ipath_qp,
                                piowait);
                list_del_init(&qp->piowait);
+               clear_bit(IPATH_S_BUSY, &qp->s_busy);
                tasklet_hi_schedule(&qp->s_task);
        }
        spin_unlock_irqrestore(&dev->pending_lock, flags);