diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/mlx4/mr.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/net/mlx4/mr.c b/drivers/net/mlx4/mr.c index 5887e4764d22..f96948be0a44 100644 --- a/drivers/net/mlx4/mr.c +++ b/drivers/net/mlx4/mr.c | |||
@@ -399,11 +399,14 @@ static int mlx4_write_mtt_chunk(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | |||
399 | if (!mtts) | 399 | if (!mtts) |
400 | return -ENOMEM; | 400 | return -ENOMEM; |
401 | 401 | ||
402 | dma_sync_single_for_cpu(&dev->pdev->dev, dma_handle, | ||
403 | npages * sizeof (u64), DMA_TO_DEVICE); | ||
404 | |||
402 | for (i = 0; i < npages; ++i) | 405 | for (i = 0; i < npages; ++i) |
403 | mtts[i] = cpu_to_be64(page_list[i] | MLX4_MTT_FLAG_PRESENT); | 406 | mtts[i] = cpu_to_be64(page_list[i] | MLX4_MTT_FLAG_PRESENT); |
404 | 407 | ||
405 | dma_sync_single_for_cpu(&dev->pdev->dev, dma_handle, | 408 | dma_sync_single_for_device(&dev->pdev->dev, dma_handle, |
406 | npages * sizeof (u64), DMA_TO_DEVICE); | 409 | npages * sizeof (u64), DMA_TO_DEVICE); |
407 | 410 | ||
408 | return 0; | 411 | return 0; |
409 | } | 412 | } |
@@ -547,11 +550,14 @@ int mlx4_map_phys_fmr(struct mlx4_dev *dev, struct mlx4_fmr *fmr, u64 *page_list | |||
547 | /* Make sure MPT status is visible before writing MTT entries */ | 550 | /* Make sure MPT status is visible before writing MTT entries */ |
548 | wmb(); | 551 | wmb(); |
549 | 552 | ||
553 | dma_sync_single_for_cpu(&dev->pdev->dev, fmr->dma_handle, | ||
554 | npages * sizeof(u64), DMA_TO_DEVICE); | ||
555 | |||
550 | for (i = 0; i < npages; ++i) | 556 | for (i = 0; i < npages; ++i) |
551 | fmr->mtts[i] = cpu_to_be64(page_list[i] | MLX4_MTT_FLAG_PRESENT); | 557 | fmr->mtts[i] = cpu_to_be64(page_list[i] | MLX4_MTT_FLAG_PRESENT); |
552 | 558 | ||
553 | dma_sync_single_for_cpu(&dev->pdev->dev, fmr->dma_handle, | 559 | dma_sync_single_for_device(&dev->pdev->dev, fmr->dma_handle, |
554 | npages * sizeof(u64), DMA_TO_DEVICE); | 560 | npages * sizeof(u64), DMA_TO_DEVICE); |
555 | 561 | ||
556 | fmr->mpt->key = cpu_to_be32(key); | 562 | fmr->mpt->key = cpu_to_be32(key); |
557 | fmr->mpt->lkey = cpu_to_be32(key); | 563 | fmr->mpt->lkey = cpu_to_be32(key); |