Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39202
b: refs/heads/master
c: e52e608
h: refs/heads/master
v: v3
  • Loading branch information
Tom Tucker authored and Roland Dreier committed Oct 10, 2006
1 parent d1b0a90 commit e1276d9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ebf7a227dd1d810203a19642655d2fa293f395dd
refs/heads/master: e52e6080ca10e0a8ce2a35c86965945cdfa8ed7e
16 changes: 12 additions & 4 deletions trunk/drivers/infiniband/hw/amso1100/c2_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
*
*/

#include <linux/delay.h>

#include "c2.h"
#include "c2_vq.h"
#include "c2_status.h"
Expand Down Expand Up @@ -705,10 +707,8 @@ static inline void c2_activity(struct c2_dev *c2dev, u32 mq_index, u16 shared)
* cannot get on the bus and the card and system hang in a
* deadlock -- thus the need for this code. [TOT]
*/
while (readl(c2dev->regs + PCI_BAR0_ADAPTER_HINT) & 0x80000000) {
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(0);
}
while (readl(c2dev->regs + PCI_BAR0_ADAPTER_HINT) & 0x80000000)
udelay(10);

__raw_writel(C2_HINT_MAKE(mq_index, shared),
c2dev->regs + PCI_BAR0_ADAPTER_HINT);
Expand Down Expand Up @@ -766,6 +766,7 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
struct c2_dev *c2dev = to_c2dev(ibqp->device);
struct c2_qp *qp = to_c2qp(ibqp);
union c2wr wr;
unsigned long lock_flags;
int err = 0;

u32 flags;
Expand Down Expand Up @@ -881,15 +882,18 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
/*
* Post the puppy!
*/
spin_lock_irqsave(&qp->lock, lock_flags);
err = qp_wr_post(&qp->sq_mq, &wr, qp, msg_size);
if (err) {
spin_unlock_irqrestore(&qp->lock, lock_flags);
break;
}

/*
* Enqueue mq index to activity FIFO.
*/
c2_activity(c2dev, qp->sq_mq.index, qp->sq_mq.hint_count);
spin_unlock_irqrestore(&qp->lock, lock_flags);

ib_wr = ib_wr->next;
}
Expand All @@ -905,6 +909,7 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr,
struct c2_dev *c2dev = to_c2dev(ibqp->device);
struct c2_qp *qp = to_c2qp(ibqp);
union c2wr wr;
unsigned long lock_flags;
int err = 0;

if (qp->state > IB_QPS_RTS)
Expand Down Expand Up @@ -945,15 +950,18 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr,
break;
}

spin_lock_irqsave(&qp->lock, lock_flags);
err = qp_wr_post(&qp->rq_mq, &wr, qp, qp->rq_mq.msg_size);
if (err) {
spin_unlock_irqrestore(&qp->lock, lock_flags);
break;
}

/*
* Enqueue mq index to activity FIFO
*/
c2_activity(c2dev, qp->rq_mq.index, qp->rq_mq.hint_count);
spin_unlock_irqrestore(&qp->lock, lock_flags);

ib_wr = ib_wr->next;
}
Expand Down

0 comments on commit e1276d9

Please sign in to comment.