aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-05-19 21:52:59 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-05-19 21:52:59 -0400
commit2f880b65fdbc2d4915bddc59d75a176329570fdd (patch)
treef2374a6d31121c5969d251b1aa19e43f1a6815c3 /drivers
parentfee9167214e8e515b2a1f68afc34187f2b59c182 (diff)
parent23f3bc0f2c1e26215b671499c07047c325d54d9c (diff)
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
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/core/uverbs_mem.c4
-rw-r--r--drivers/infiniband/hw/mthca/mthca_cmd.c2
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c35
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c10
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
185static int fw_cmd_doorbell = 1; 185static int fw_cmd_doorbell = 0;
186module_param(fw_cmd_doorbell, int, 0644); 186module_param(fw_cmd_doorbell, int, 0644);
187MODULE_PARM_DESC(fw_cmd_doorbell, "post FW commands through doorbell page if nonzero " 187MODULE_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
1802out: 1803out:
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
372static int srp_connect_target(struct srp_target_port *target) 372static 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