diff options
-rw-r--r-- | drivers/infiniband/core/uverbs_mem.c | 4 | ||||
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_cmd.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_qp.c | 35 | ||||
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 10 |
4 files changed, 27 insertions, 24 deletions
diff --git a/drivers/infiniband/core/uverbs_mem.c b/drivers/infiniband/core/uverbs_mem.c index 36a32c315668..efe147dbeb42 100644 --- a/drivers/infiniband/core/uverbs_mem.c +++ b/drivers/infiniband/core/uverbs_mem.c | |||
@@ -211,8 +211,10 @@ void ib_umem_release_on_close(struct ib_device *dev, struct ib_umem *umem) | |||
211 | */ | 211 | */ |
212 | 212 | ||
213 | work = kmalloc(sizeof *work, GFP_KERNEL); | 213 | work = kmalloc(sizeof *work, GFP_KERNEL); |
214 | if (!work) | 214 | if (!work) { |
215 | mmput(mm); | ||
215 | return; | 216 | return; |
217 | } | ||
216 | 218 | ||
217 | INIT_WORK(&work->work, ib_umem_account, work); | 219 | INIT_WORK(&work->work, ib_umem_account, work); |
218 | work->mm = mm; | 220 | work->mm = mm; |
diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c index 1985b5dfa481..798e13e14faf 100644 --- a/drivers/infiniband/hw/mthca/mthca_cmd.c +++ b/drivers/infiniband/hw/mthca/mthca_cmd.c | |||
@@ -182,7 +182,7 @@ struct mthca_cmd_context { | |||
182 | u8 status; | 182 | u8 status; |
183 | }; | 183 | }; |
184 | 184 | ||
185 | static int fw_cmd_doorbell = 1; | 185 | static int fw_cmd_doorbell = 0; |
186 | module_param(fw_cmd_doorbell, int, 0644); | 186 | module_param(fw_cmd_doorbell, int, 0644); |
187 | MODULE_PARM_DESC(fw_cmd_doorbell, "post FW commands through doorbell page if nonzero " | 187 | MODULE_PARM_DESC(fw_cmd_doorbell, "post FW commands through doorbell page if nonzero " |
188 | "(and supported by FW)"); | 188 | "(and supported by FW)"); |
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c index 19765f6f8d58..07c13be07a4a 100644 --- a/drivers/infiniband/hw/mthca/mthca_qp.c +++ b/drivers/infiniband/hw/mthca/mthca_qp.c | |||
@@ -1727,23 +1727,7 @@ int mthca_tavor_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr, | |||
1727 | 1727 | ||
1728 | ind = qp->rq.next_ind; | 1728 | ind = qp->rq.next_ind; |
1729 | 1729 | ||
1730 | for (nreq = 0; wr; ++nreq, wr = wr->next) { | 1730 | for (nreq = 0; wr; wr = wr->next) { |
1731 | if (unlikely(nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB)) { | ||
1732 | nreq = 0; | ||
1733 | |||
1734 | doorbell[0] = cpu_to_be32((qp->rq.next_ind << qp->rq.wqe_shift) | size0); | ||
1735 | doorbell[1] = cpu_to_be32(qp->qpn << 8); | ||
1736 | |||
1737 | wmb(); | ||
1738 | |||
1739 | mthca_write64(doorbell, | ||
1740 | dev->kar + MTHCA_RECEIVE_DOORBELL, | ||
1741 | MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); | ||
1742 | |||
1743 | qp->rq.head += MTHCA_TAVOR_MAX_WQES_PER_RECV_DB; | ||
1744 | size0 = 0; | ||
1745 | } | ||
1746 | |||
1747 | if (mthca_wq_overflow(&qp->rq, nreq, qp->ibqp.recv_cq)) { | 1731 | if (mthca_wq_overflow(&qp->rq, nreq, qp->ibqp.recv_cq)) { |
1748 | mthca_err(dev, "RQ %06x full (%u head, %u tail," | 1732 | mthca_err(dev, "RQ %06x full (%u head, %u tail," |
1749 | " %d max, %d nreq)\n", qp->qpn, | 1733 | " %d max, %d nreq)\n", qp->qpn, |
@@ -1797,6 +1781,23 @@ int mthca_tavor_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr, | |||
1797 | ++ind; | 1781 | ++ind; |
1798 | if (unlikely(ind >= qp->rq.max)) | 1782 | if (unlikely(ind >= qp->rq.max)) |
1799 | ind -= qp->rq.max; | 1783 | ind -= qp->rq.max; |
1784 | |||
1785 | ++nreq; | ||
1786 | if (unlikely(nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB)) { | ||
1787 | nreq = 0; | ||
1788 | |||
1789 | doorbell[0] = cpu_to_be32((qp->rq.next_ind << qp->rq.wqe_shift) | size0); | ||
1790 | doorbell[1] = cpu_to_be32(qp->qpn << 8); | ||
1791 | |||
1792 | wmb(); | ||
1793 | |||
1794 | mthca_write64(doorbell, | ||
1795 | dev->kar + MTHCA_RECEIVE_DOORBELL, | ||
1796 | MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); | ||
1797 | |||
1798 | qp->rq.head += MTHCA_TAVOR_MAX_WQES_PER_RECV_DB; | ||
1799 | size0 = 0; | ||
1800 | } | ||
1800 | } | 1801 | } |
1801 | 1802 | ||
1802 | out: | 1803 | out: |
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index c32ce4348e1b..9cbdffa08dc2 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -340,7 +340,10 @@ static void srp_disconnect_target(struct srp_target_port *target) | |||
340 | /* XXX should send SRP_I_LOGOUT request */ | 340 | /* XXX should send SRP_I_LOGOUT request */ |
341 | 341 | ||
342 | init_completion(&target->done); | 342 | init_completion(&target->done); |
343 | ib_send_cm_dreq(target->cm_id, NULL, 0); | 343 | if (ib_send_cm_dreq(target->cm_id, NULL, 0)) { |
344 | printk(KERN_DEBUG PFX "Sending CM DREQ failed\n"); | ||
345 | return; | ||
346 | } | ||
344 | wait_for_completion(&target->done); | 347 | wait_for_completion(&target->done); |
345 | } | 348 | } |
346 | 349 | ||
@@ -351,7 +354,6 @@ static void srp_remove_work(void *target_ptr) | |||
351 | spin_lock_irq(target->scsi_host->host_lock); | 354 | spin_lock_irq(target->scsi_host->host_lock); |
352 | if (target->state != SRP_TARGET_DEAD) { | 355 | if (target->state != SRP_TARGET_DEAD) { |
353 | spin_unlock_irq(target->scsi_host->host_lock); | 356 | spin_unlock_irq(target->scsi_host->host_lock); |
354 | scsi_host_put(target->scsi_host); | ||
355 | return; | 357 | return; |
356 | } | 358 | } |
357 | target->state = SRP_TARGET_REMOVED; | 359 | target->state = SRP_TARGET_REMOVED; |
@@ -365,8 +367,6 @@ static void srp_remove_work(void *target_ptr) | |||
365 | ib_destroy_cm_id(target->cm_id); | 367 | ib_destroy_cm_id(target->cm_id); |
366 | srp_free_target_ib(target); | 368 | srp_free_target_ib(target); |
367 | scsi_host_put(target->scsi_host); | 369 | scsi_host_put(target->scsi_host); |
368 | /* And another put to really free the target port... */ | ||
369 | scsi_host_put(target->scsi_host); | ||
370 | } | 370 | } |
371 | 371 | ||
372 | static int srp_connect_target(struct srp_target_port *target) | 372 | static int srp_connect_target(struct srp_target_port *target) |
@@ -1241,7 +1241,7 @@ static int srp_reset_device(struct scsi_cmnd *scmnd) | |||
1241 | list_for_each_entry_safe(req, tmp, &target->req_queue, list) | 1241 | list_for_each_entry_safe(req, tmp, &target->req_queue, list) |
1242 | if (req->scmnd->device == scmnd->device) { | 1242 | if (req->scmnd->device == scmnd->device) { |
1243 | req->scmnd->result = DID_RESET << 16; | 1243 | req->scmnd->result = DID_RESET << 16; |
1244 | scmnd->scsi_done(scmnd); | 1244 | req->scmnd->scsi_done(req->scmnd); |
1245 | srp_remove_req(target, req); | 1245 | srp_remove_req(target, req); |
1246 | } | 1246 | } |
1247 | 1247 | ||