diff options
author | Roland Dreier <roland@topspin.com> | 2005-06-27 17:36:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-27 18:11:44 -0400 |
commit | 64dc81fca7f6d5c51e50ffa850640ad8358acd1f (patch) | |
tree | 919ca8d2ea8567a1de4bba989a123b77340b989a /drivers/infiniband/hw/mthca/mthca_eq.c | |
parent | bb2af78bcdbb8801791de33f1775c98b9178daab (diff) |
[PATCH] IB/mthca: Use dma_alloc_coherent instead of pci_alloc_consistent
Switch all allocations of coherent memory from pci_alloc_consistent() to
dma_alloc_coherent(), so that we can pass GFP_KERNEL. This should help when
the system is low on memory.
Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_eq.c')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_eq.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_eq.c b/drivers/infiniband/hw/mthca/mthca_eq.c index 7500ebc23f36..970cba24e79f 100644 --- a/drivers/infiniband/hw/mthca/mthca_eq.c +++ b/drivers/infiniband/hw/mthca/mthca_eq.c | |||
@@ -501,8 +501,8 @@ static int __devinit mthca_create_eq(struct mthca_dev *dev, | |||
501 | eq_context = MAILBOX_ALIGN(mailbox); | 501 | eq_context = MAILBOX_ALIGN(mailbox); |
502 | 502 | ||
503 | for (i = 0; i < npages; ++i) { | 503 | for (i = 0; i < npages; ++i) { |
504 | eq->page_list[i].buf = pci_alloc_consistent(dev->pdev, | 504 | eq->page_list[i].buf = dma_alloc_coherent(&dev->pdev->dev, |
505 | PAGE_SIZE, &t); | 505 | PAGE_SIZE, &t, GFP_KERNEL); |
506 | if (!eq->page_list[i].buf) | 506 | if (!eq->page_list[i].buf) |
507 | goto err_out_free; | 507 | goto err_out_free; |
508 | 508 | ||
@@ -582,10 +582,10 @@ static int __devinit mthca_create_eq(struct mthca_dev *dev, | |||
582 | err_out_free: | 582 | err_out_free: |
583 | for (i = 0; i < npages; ++i) | 583 | for (i = 0; i < npages; ++i) |
584 | if (eq->page_list[i].buf) | 584 | if (eq->page_list[i].buf) |
585 | pci_free_consistent(dev->pdev, PAGE_SIZE, | 585 | dma_free_coherent(&dev->pdev->dev, PAGE_SIZE, |
586 | eq->page_list[i].buf, | 586 | eq->page_list[i].buf, |
587 | pci_unmap_addr(&eq->page_list[i], | 587 | pci_unmap_addr(&eq->page_list[i], |
588 | mapping)); | 588 | mapping)); |
589 | 589 | ||
590 | kfree(eq->page_list); | 590 | kfree(eq->page_list); |
591 | kfree(dma_list); | 591 | kfree(dma_list); |