aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/cxgb4/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/cxgb4/device.c')
-rw-r--r--drivers/infiniband/hw/cxgb4/device.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
index 2851bf831fb..986cfd76502 100644
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@ -364,7 +364,14 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev)
364 printk(KERN_ERR MOD "error %d initializing rqt pool\n", err); 364 printk(KERN_ERR MOD "error %d initializing rqt pool\n", err);
365 goto err3; 365 goto err3;
366 } 366 }
367 err = c4iw_ocqp_pool_create(rdev);
368 if (err) {
369 printk(KERN_ERR MOD "error %d initializing ocqp pool\n", err);
370 goto err4;
371 }
367 return 0; 372 return 0;
373err4:
374 c4iw_rqtpool_destroy(rdev);
368err3: 375err3:
369 c4iw_pblpool_destroy(rdev); 376 c4iw_pblpool_destroy(rdev);
370err2: 377err2:
@@ -391,6 +398,7 @@ static void c4iw_remove(struct c4iw_dev *dev)
391 idr_destroy(&dev->cqidr); 398 idr_destroy(&dev->cqidr);
392 idr_destroy(&dev->qpidr); 399 idr_destroy(&dev->qpidr);
393 idr_destroy(&dev->mmidr); 400 idr_destroy(&dev->mmidr);
401 iounmap(dev->rdev.oc_mw_kva);
394 ib_dealloc_device(&dev->ibdev); 402 ib_dealloc_device(&dev->ibdev);
395} 403}
396 404
@@ -406,6 +414,17 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop)
406 } 414 }
407 devp->rdev.lldi = *infop; 415 devp->rdev.lldi = *infop;
408 416
417 devp->rdev.oc_mw_pa = pci_resource_start(devp->rdev.lldi.pdev, 2) +
418 (pci_resource_len(devp->rdev.lldi.pdev, 2) -
419 roundup_pow_of_two(devp->rdev.lldi.vr->ocq.size));
420 devp->rdev.oc_mw_kva = ioremap_wc(devp->rdev.oc_mw_pa,
421 devp->rdev.lldi.vr->ocq.size);
422
423 printk(KERN_INFO MOD "ocq memory: "
424 "hw_start 0x%x size %u mw_pa 0x%lx mw_kva %p\n",
425 devp->rdev.lldi.vr->ocq.start, devp->rdev.lldi.vr->ocq.size,
426 devp->rdev.oc_mw_pa, devp->rdev.oc_mw_kva);
427
409 mutex_lock(&dev_mutex); 428 mutex_lock(&dev_mutex);
410 429
411 ret = c4iw_rdev_open(&devp->rdev); 430 ret = c4iw_rdev_open(&devp->rdev);