summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/amso1100/c2_alloc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-11-02 14:36:05 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-11-02 14:36:05 -0800
commit40eb006685387b2861bd7196be0ab7144c5d5b71 (patch)
treec43ba94aa8632127ce9433dce0832e4e2734a2b4 /drivers/infiniband/hw/amso1100/c2_alloc.c
parente957b00a8caece90cbc2afd0a4cb4c4d61b9efa8 (diff)
parent7a118df3ea23820b9922a1b51cd2f24e464f4c17 (diff)
downloadtalos-obmc-linux-40eb006685387b2861bd7196be0ab7144c5d5b71.tar.gz
talos-obmc-linux-40eb006685387b2861bd7196be0ab7144c5d5b71.zip
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: RDMA/addr: Use client registration to fix module unload race IB/mthca: Fix MAD extended header format for MAD_IFC firmware command IB/uverbs: Return sq_draining value in query_qp response IB/amso1100: Fix incorrect pr_debug() IB/amso1100: Use dma_alloc_coherent() instead of kmalloc/dma_map_single IB/ehca: Fix eHCA driver compilation for uniprocessor RDMA/cma: rdma_bind_addr() leaks a cma_dev reference count IB/iser: Start connection after enabling iSER
Diffstat (limited to 'drivers/infiniband/hw/amso1100/c2_alloc.c')
-rw-r--r--drivers/infiniband/hw/amso1100/c2_alloc.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/infiniband/hw/amso1100/c2_alloc.c b/drivers/infiniband/hw/amso1100/c2_alloc.c
index 028a60bbfca9..0315f99e4191 100644
--- a/drivers/infiniband/hw/amso1100/c2_alloc.c
+++ b/drivers/infiniband/hw/amso1100/c2_alloc.c
@@ -42,13 +42,14 @@ static int c2_alloc_mqsp_chunk(struct c2_dev *c2dev, gfp_t gfp_mask,
{
int i;
struct sp_chunk *new_head;
+ dma_addr_t dma_addr;
- new_head = (struct sp_chunk *) __get_free_page(gfp_mask);
+ new_head = dma_alloc_coherent(&c2dev->pcidev->dev, PAGE_SIZE,
+ &dma_addr, gfp_mask);
if (new_head == NULL)
return -ENOMEM;
- new_head->dma_addr = dma_map_single(c2dev->ibdev.dma_device, new_head,
- PAGE_SIZE, DMA_FROM_DEVICE);
+ new_head->dma_addr = dma_addr;
pci_unmap_addr_set(new_head, mapping, new_head->dma_addr);
new_head->next = NULL;
@@ -80,10 +81,8 @@ void c2_free_mqsp_pool(struct c2_dev *c2dev, struct sp_chunk *root)
while (root) {
next = root->next;
- dma_unmap_single(c2dev->ibdev.dma_device,
- pci_unmap_addr(root, mapping), PAGE_SIZE,
- DMA_FROM_DEVICE);
- __free_page((struct page *) root);
+ dma_free_coherent(&c2dev->pcidev->dev, PAGE_SIZE, root,
+ pci_unmap_addr(root, mapping));
root = next;
}
}
OpenPOWER on IntegriCloud