All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IB/mthca: replace dma_sync_single with dma_sync_single_for_cpu
@ 2009-05-28  1:10 FUJITA Tomonori
  2009-05-28 22:18 ` Roland Dreier
  0 siblings, 1 reply; 3+ messages in thread
From: FUJITA Tomonori @ 2009-05-28  1:10 UTC (permalink / raw)
  To: rolandd; +Cc: linux-kernel, akpm

This replaces dma_sync_single() with dma_sync_single_for_cpu() because
dma_sync_single() is an obsolete API; include/linux/dma-mapping.h says:

/* Backwards compat, remove in 2.7.x */
#define dma_sync_single		dma_sync_single_for_cpu
#define dma_sync_sg		dma_sync_sg_for_cpu

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 drivers/infiniband/hw/mthca/mthca_mr.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_mr.c b/drivers/infiniband/hw/mthca/mthca_mr.c
index 882e6b7..44c98df 100644
--- a/drivers/infiniband/hw/mthca/mthca_mr.c
+++ b/drivers/infiniband/hw/mthca/mthca_mr.c
@@ -355,7 +355,8 @@ static void mthca_arbel_write_mtt_seg(struct mthca_dev *dev,
 	for (i = 0; i < list_len; ++i)
 		mtts[i] = cpu_to_be64(buffer_list[i] | MTHCA_MTT_FLAG_PRESENT);
 
-	dma_sync_single(&dev->pdev->dev, dma_handle, list_len * sizeof (u64), DMA_TO_DEVICE);
+	dma_sync_single_for_cpu(&dev->pdev->dev, dma_handle,
+				list_len * sizeof (u64), DMA_TO_DEVICE);
 }
 
 int mthca_write_mtt(struct mthca_dev *dev, struct mthca_mtt *mtt,
@@ -807,8 +808,8 @@ int mthca_arbel_map_phys_fmr(struct ib_fmr *ibfmr, u64 *page_list,
 		fmr->mem.arbel.mtts[i] = cpu_to_be64(page_list[i] |
 						     MTHCA_MTT_FLAG_PRESENT);
 
-	dma_sync_single(&dev->pdev->dev, fmr->mem.arbel.dma_handle,
-			list_len * sizeof(u64), DMA_TO_DEVICE);
+	dma_sync_single_for_cpu(&dev->pdev->dev, fmr->mem.arbel.dma_handle,
+				list_len * sizeof(u64), DMA_TO_DEVICE);
 
 	fmr->mem.arbel.mpt->key    = cpu_to_be32(key);
 	fmr->mem.arbel.mpt->lkey   = cpu_to_be32(key);
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] IB/mthca: replace dma_sync_single with dma_sync_single_for_cpu
  2009-05-28  1:10 [PATCH] IB/mthca: replace dma_sync_single with dma_sync_single_for_cpu FUJITA Tomonori
@ 2009-05-28 22:18 ` Roland Dreier
  2009-05-28 23:23   ` FUJITA Tomonori
  0 siblings, 1 reply; 3+ messages in thread
From: Roland Dreier @ 2009-05-28 22:18 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: rolandd, linux-kernel, akpm

 > This replaces dma_sync_single() with dma_sync_single_for_cpu() because
 > dma_sync_single() is an obsolete API; include/linux/dma-mapping.h says:
 > 
 > /* Backwards compat, remove in 2.7.x */

Thanks for pointing this out... however I think sync_single_for_cpu
looks wrong in these cases -- I think there should be a pair of
sync_single_for_cpu/sync_single_for_device around this stuff.

I'll take a closer look in the next day or too.

 - R.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] IB/mthca: replace dma_sync_single with dma_sync_single_for_cpu
  2009-05-28 22:18 ` Roland Dreier
@ 2009-05-28 23:23   ` FUJITA Tomonori
  0 siblings, 0 replies; 3+ messages in thread
From: FUJITA Tomonori @ 2009-05-28 23:23 UTC (permalink / raw)
  To: rdreier; +Cc: fujita.tomonori, rolandd, linux-kernel, akpm

On Thu, 28 May 2009 15:18:21 -0700
Roland Dreier <rdreier@cisco.com> wrote:

>  > This replaces dma_sync_single() with dma_sync_single_for_cpu() because
>  > dma_sync_single() is an obsolete API; include/linux/dma-mapping.h says:
>  > 
>  > /* Backwards compat, remove in 2.7.x */
> 
> Thanks for pointing this out... however I think sync_single_for_cpu
> looks wrong in these cases -- I think there should be a pair of
> sync_single_for_cpu/sync_single_for_device around this stuff.

Yeah, possibly. I just convert it without looking at the code. As you
know, the patch will not change anything. If dma_sync_single_for_cpu
doesn't work here, the driver is already broken.


> I'll take a closer look in the next day or too.

Cool, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-28 23:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-28  1:10 [PATCH] IB/mthca: replace dma_sync_single with dma_sync_single_for_cpu FUJITA Tomonori
2009-05-28 22:18 ` Roland Dreier
2009-05-28 23:23   ` FUJITA Tomonori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.