linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [ofa-general] linux-next: origin tree build warning
@ 2009-06-22  1:01 Stephen Rothwell
  2009-06-22  3:11 ` FUJITA Tomonori
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2009-06-22  1:01 UTC (permalink / raw)
  To: Roland Dreier, general; +Cc: Tomonori, linux-next, linux-kernel, FUJITA


[-- Attachment #1.1: Type: text/plain, Size: 795 bytes --]

Hi all,

Today's linux-next build (powerpc ppc64_defconfig) produced this warning:

drivers/infiniband/hw/mthca/mthca_mr.c: In function 'mthca_arbel_write_mtt_seg':
drivers/infiniband/hw/mthca/mthca_mr.c:358: warning: 'dma_sync_single' is deprecated (declared at /scratch/sfr/next/include/linux/dma-mapping.h:113)
drivers/infiniband/hw/mthca/mthca_mr.c: In function 'mthca_arbel_map_phys_fmr':
drivers/infiniband/hw/mthca/mthca_mr.c:810: warning: 'dma_sync_single' is deprecated (declared at /scratch/sfr/next/include/linux/dma-mapping.h:113)

Introduced by commit dbe6f1869188b6e04e38aa861dd198befb08bcd7
("dma-mapping: mark dma_sync_single and dma_sync_sg as deprecated").

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: linux-next: origin tree build warning
  2009-06-22  1:01 [ofa-general] linux-next: origin tree build warning Stephen Rothwell
@ 2009-06-22  3:11 ` FUJITA Tomonori
  2009-06-23  6:10   ` [ofa-general] " Roland Dreier
  0 siblings, 1 reply; 3+ messages in thread
From: FUJITA Tomonori @ 2009-06-22  3:11 UTC (permalink / raw)
  To: sfr; +Cc: rdreier, general, linux-next, linux-kernel, fujita.tomonori

On Mon, 22 Jun 2009 11:01:13 +1000
Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> Hi all,
> 
> Today's linux-next build (powerpc ppc64_defconfig) produced this warning:
> 
> drivers/infiniband/hw/mthca/mthca_mr.c: In function 'mthca_arbel_write_mtt_seg':
> drivers/infiniband/hw/mthca/mthca_mr.c:358: warning: 'dma_sync_single' is deprecated (declared at /scratch/sfr/next/include/linux/dma-mapping.h:113)
> drivers/infiniband/hw/mthca/mthca_mr.c: In function 'mthca_arbel_map_phys_fmr':
> drivers/infiniband/hw/mthca/mthca_mr.c:810: warning: 'dma_sync_single' is deprecated (declared at /scratch/sfr/next/include/linux/dma-mapping.h:113)
> 
> Introduced by commit dbe6f1869188b6e04e38aa861dd198befb08bcd7
> ("dma-mapping: mark dma_sync_single and dma_sync_sg as deprecated").

Thanks, here's a fix for this:

http://marc.info/?l=linux-kernel&m=124347325819016&w=2


The patch doesn't change the driver functionally but the driver looks
broken wrt DMA synchronization. I guess that this issue is on Roland's
todo list:

http://marc.info/?l=linux-kernel&m=124354923710600&w=2

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

* Re: [ofa-general] Re: linux-next: origin tree build warning
  2009-06-22  3:11 ` FUJITA Tomonori
@ 2009-06-23  6:10   ` Roland Dreier
  0 siblings, 0 replies; 3+ messages in thread
From: Roland Dreier @ 2009-06-23  6:10 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: sfr, linux-next, linux-kernel, general

Thanks, I queued up:

commit 99987bea474ceca8ec6fb05f81d7d188634cdffd
Author: Roland Dreier <rolandd@cisco.com>
Date:   Mon Jun 22 23:04:13 2009 -0700

    IB/mthca: Replace dma_sync_single() use with proper functions
    
    dma_sync_single() is deprecated now, and the use in mthca is wrong:
    there should be a dma_sync_single_for_cpu() before touching the memory
    from the CPU, and a dma_sync_single_for_device() afterwards.  Fix
    this, prompted by a kick in the pants from a patch from FUJITA
    Tomonori <fujita.tomonori@lab.ntt.co.jp>.
    
    Signed-off-by: Roland Dreier <rolandd@cisco.com>

diff --git a/drivers/infiniband/hw/mthca/mthca_mr.c b/drivers/infiniband/hw/mthca/mthca_mr.c
index d606edf..065b208 100644
--- a/drivers/infiniband/hw/mthca/mthca_mr.c
+++ b/drivers/infiniband/hw/mthca/mthca_mr.c
@@ -352,10 +352,14 @@ static void mthca_arbel_write_mtt_seg(struct mthca_dev *dev,
 
 	BUG_ON(!mtts);
 
+	dma_sync_single_for_cpu(&dev->pdev->dev, dma_handle,
+				list_len * sizeof (u64), DMA_TO_DEVICE);
+
 	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_device(&dev->pdev->dev, dma_handle,
+				   list_len * sizeof (u64), DMA_TO_DEVICE);
 }
 
 int mthca_write_mtt(struct mthca_dev *dev, struct mthca_mtt *mtt,
@@ -803,12 +807,15 @@ int mthca_arbel_map_phys_fmr(struct ib_fmr *ibfmr, u64 *page_list,
 
 	wmb();
 
+	dma_sync_single_for_cpu(&dev->pdev->dev, fmr->mem.arbel.dma_handle,
+				list_len * sizeof(u64), DMA_TO_DEVICE);
+
 	for (i = 0; i < list_len; ++i)
 		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_device(&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);

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

end of thread, other threads:[~2009-06-23  6:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-22  1:01 [ofa-general] linux-next: origin tree build warning Stephen Rothwell
2009-06-22  3:11 ` FUJITA Tomonori
2009-06-23  6:10   ` [ofa-general] " Roland Dreier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).