diff options
| -rw-r--r-- | drivers/infiniband/hw/cxgb4/ev.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/cxgb4/ev.c b/drivers/infiniband/hw/cxgb4/ev.c index c9df0549f51d..4498a89f4ced 100644 --- a/drivers/infiniband/hw/cxgb4/ev.c +++ b/drivers/infiniband/hw/cxgb4/ev.c | |||
| @@ -225,13 +225,20 @@ int c4iw_ev_handler(struct c4iw_dev *dev, u32 qid) | |||
| 225 | struct c4iw_cq *chp; | 225 | struct c4iw_cq *chp; |
| 226 | unsigned long flag; | 226 | unsigned long flag; |
| 227 | 227 | ||
| 228 | spin_lock_irqsave(&dev->lock, flag); | ||
| 228 | chp = get_chp(dev, qid); | 229 | chp = get_chp(dev, qid); |
| 229 | if (chp) { | 230 | if (chp) { |
| 231 | atomic_inc(&chp->refcnt); | ||
| 232 | spin_unlock_irqrestore(&dev->lock, flag); | ||
| 230 | t4_clear_cq_armed(&chp->cq); | 233 | t4_clear_cq_armed(&chp->cq); |
| 231 | spin_lock_irqsave(&chp->comp_handler_lock, flag); | 234 | spin_lock_irqsave(&chp->comp_handler_lock, flag); |
| 232 | (*chp->ibcq.comp_handler)(&chp->ibcq, chp->ibcq.cq_context); | 235 | (*chp->ibcq.comp_handler)(&chp->ibcq, chp->ibcq.cq_context); |
| 233 | spin_unlock_irqrestore(&chp->comp_handler_lock, flag); | 236 | spin_unlock_irqrestore(&chp->comp_handler_lock, flag); |
| 234 | } else | 237 | if (atomic_dec_and_test(&chp->refcnt)) |
| 238 | wake_up(&chp->wait); | ||
| 239 | } else { | ||
| 235 | PDBG("%s unknown cqid 0x%x\n", __func__, qid); | 240 | PDBG("%s unknown cqid 0x%x\n", __func__, qid); |
| 241 | spin_unlock_irqrestore(&dev->lock, flag); | ||
| 242 | } | ||
| 236 | return 0; | 243 | return 0; |
| 237 | } | 244 | } |
