@@ -237,18 +237,23 @@ struct ib_fast_reg_page_list *mlx4_ib_alloc_fast_reg_page_list(struct ib_device
if (!mfrpl->ibfrpl.page_list)
goto err_free;
- mfrpl->mapped_page_list = dma_alloc_coherent(&dev->dev->pdev->dev,
- size, &mfrpl->map,
- GFP_KERNEL);
+ mfrpl->mapped_page_list = (__be64 *)__get_free_page(GFP_KERNEL);
if (!mfrpl->mapped_page_list)
goto err_free;
- WARN_ON(mfrpl->map & 0x3f);
+ mfrpl->map = dma_map_single(ibdev->dma_device, mfrpl->mapped_page_list,
+ PAGE_SIZE, DMA_TO_DEVICE);
+ if (dma_mapping_error(ibdev->dma_device, mfrpl->map))
+ goto err_page;
+
+
return &mfrpl->ibfrpl;
+err_page:
+ free_page((unsigned long) mfrpl->mapped_page_list);
+
err_free:
- kfree(mfrpl->ibfrpl.page_list);
kfree(mfrpl);
return ERR_PTR(-ENOMEM);
}