Commit 2f880b65 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband

* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband:
  IB/mthca: Fix posting lists of 256 receive requests for Tavor
  IB/uverbs: Don't leak ref to mm on error path
  IB/srp: Complete correct SCSI commands on device reset
  IB/srp: Get rid of extra scsi_host_put()s if reconnection fails
  IB/srp: Don't wait for disconnection if sending DREQ fails
  IB/mthca: Make fw_cmd_doorbell default to 0
parents fee91672 23f3bc0f
...@@ -211,8 +211,10 @@ void ib_umem_release_on_close(struct ib_device *dev, struct ib_umem *umem) ...@@ -211,8 +211,10 @@ void ib_umem_release_on_close(struct ib_device *dev, struct ib_umem *umem)
*/ */
work = kmalloc(sizeof *work, GFP_KERNEL); work = kmalloc(sizeof *work, GFP_KERNEL);
if (!work) if (!work) {
mmput(mm);
return; return;
}
INIT_WORK(&work->work, ib_umem_account, work); INIT_WORK(&work->work, ib_umem_account, work);
work->mm = mm; work->mm = mm;
......
...@@ -182,7 +182,7 @@ struct mthca_cmd_context { ...@@ -182,7 +182,7 @@ struct mthca_cmd_context {
u8 status; u8 status;
}; };
static int fw_cmd_doorbell = 1; static int fw_cmd_doorbell = 0;
module_param(fw_cmd_doorbell, int, 0644); module_param(fw_cmd_doorbell, int, 0644);
MODULE_PARM_DESC(fw_cmd_doorbell, "post FW commands through doorbell page if nonzero " MODULE_PARM_DESC(fw_cmd_doorbell, "post FW commands through doorbell page if nonzero "
"(and supported by FW)"); "(and supported by FW)");
......
...@@ -1727,23 +1727,7 @@ int mthca_tavor_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr, ...@@ -1727,23 +1727,7 @@ int mthca_tavor_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr,
ind = qp->rq.next_ind; ind = qp->rq.next_ind;
for (nreq = 0; wr; ++nreq, wr = wr->next) { for (nreq = 0; wr; wr = wr->next) {
if (unlikely(nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB)) {
nreq = 0;
doorbell[0] = cpu_to_be32((qp->rq.next_ind << qp->rq.wqe_shift) | size0);
doorbell[1] = cpu_to_be32(qp->qpn << 8);
wmb();
mthca_write64(doorbell,
dev->kar + MTHCA_RECEIVE_DOORBELL,
MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock));
qp->rq.head += MTHCA_TAVOR_MAX_WQES_PER_RECV_DB;
size0 = 0;
}
if (mthca_wq_overflow(&qp->rq, nreq, qp->ibqp.recv_cq)) { if (mthca_wq_overflow(&qp->rq, nreq, qp->ibqp.recv_cq)) {
mthca_err(dev, "RQ %06x full (%u head, %u tail," mthca_err(dev, "RQ %06x full (%u head, %u tail,"
" %d max, %d nreq)\n", qp->qpn, " %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,6 +1781,23 @@ int mthca_tavor_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr,
++ind; ++ind;
if (unlikely(ind >= qp->rq.max)) if (unlikely(ind >= qp->rq.max))
ind -= qp->rq.max; ind -= qp->rq.max;
++nreq;
if (unlikely(nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB)) {
nreq = 0;
doorbell[0] = cpu_to_be32((qp->rq.next_ind << qp->rq.wqe_shift) | size0);
doorbell[1] = cpu_to_be32(qp->qpn << 8);
wmb();
mthca_write64(doorbell,
dev->kar + MTHCA_RECEIVE_DOORBELL,
MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock));
qp->rq.head += MTHCA_TAVOR_MAX_WQES_PER_RECV_DB;
size0 = 0;
}
} }
out: out:
......
...@@ -340,7 +340,10 @@ static void srp_disconnect_target(struct srp_target_port *target) ...@@ -340,7 +340,10 @@ static void srp_disconnect_target(struct srp_target_port *target)
/* XXX should send SRP_I_LOGOUT request */ /* XXX should send SRP_I_LOGOUT request */
init_completion(&target->done); init_completion(&target->done);
ib_send_cm_dreq(target->cm_id, NULL, 0); if (ib_send_cm_dreq(target->cm_id, NULL, 0)) {
printk(KERN_DEBUG PFX "Sending CM DREQ failed\n");
return;
}
wait_for_completion(&target->done); wait_for_completion(&target->done);
} }
...@@ -351,7 +354,6 @@ static void srp_remove_work(void *target_ptr) ...@@ -351,7 +354,6 @@ static void srp_remove_work(void *target_ptr)
spin_lock_irq(target->scsi_host->host_lock); spin_lock_irq(target->scsi_host->host_lock);
if (target->state != SRP_TARGET_DEAD) { if (target->state != SRP_TARGET_DEAD) {
spin_unlock_irq(target->scsi_host->host_lock); spin_unlock_irq(target->scsi_host->host_lock);
scsi_host_put(target->scsi_host);
return; return;
} }
target->state = SRP_TARGET_REMOVED; target->state = SRP_TARGET_REMOVED;
...@@ -365,8 +367,6 @@ static void srp_remove_work(void *target_ptr) ...@@ -365,8 +367,6 @@ static void srp_remove_work(void *target_ptr)
ib_destroy_cm_id(target->cm_id); ib_destroy_cm_id(target->cm_id);
srp_free_target_ib(target); srp_free_target_ib(target);
scsi_host_put(target->scsi_host); scsi_host_put(target->scsi_host);
/* And another put to really free the target port... */
scsi_host_put(target->scsi_host);
} }
static int srp_connect_target(struct srp_target_port *target) static int srp_connect_target(struct srp_target_port *target)
...@@ -1241,7 +1241,7 @@ static int srp_reset_device(struct scsi_cmnd *scmnd) ...@@ -1241,7 +1241,7 @@ static int srp_reset_device(struct scsi_cmnd *scmnd)
list_for_each_entry_safe(req, tmp, &target->req_queue, list) list_for_each_entry_safe(req, tmp, &target->req_queue, list)
if (req->scmnd->device == scmnd->device) { if (req->scmnd->device == scmnd->device) {
req->scmnd->result = DID_RESET << 16; req->scmnd->result = DID_RESET << 16;
scmnd->scsi_done(scmnd); req->scmnd->scsi_done(req->scmnd);
srp_remove_req(target, req); srp_remove_req(target, req);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment