All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Grundler <grundler@parisc-linux.org>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: David Miller <davem@davemloft.net>,
	Jarek Poplawski <jarkao2@gmail.com>,
	Grant Grundler <grundler@parisc-linux.org>,
	netdev@vger.kernel.org
Subject: Re: [PATCH 06/11] de2104x: fix DMA sync_single length error
Date: Thu, 21 Jan 2010 18:02:44 -0700	[thread overview]
Message-ID: <20100122010244.GA27529@lackof.org> (raw)
In-Reply-To: <20100120204559.177544514@vyatta.com>

On Wed, Jan 20, 2010 at 12:45:05PM -0800, Stephen Hemminger wrote:
> The DMA api requires that the full mapping be sync'd when
> copying frame. First found by Jarek on sky2.

Are you referring to the example code in Documentation/PCI/PCI-DMA-mapping.txt?

I don't see any "Use the full mapping" statement otherwise.

Is there a DMA HW implementation that requires the syncing full buffer?

I think it would be interesting to point that out in the commit comments
since other NIC drivers are likely to also have this issue as well.

I have no objection to this patch. Just want to be clear why
it's being pushed.

Please added Acked-by: Grant Grundler <grundler@parisc-linux.org>

thanks,
grant


> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> --- a/drivers/net/tulip/de2104x.c	2010-01-20 11:41:20.878138314 -0800
> +++ b/drivers/net/tulip/de2104x.c	2010-01-20 11:41:59.858847380 -0800
> @@ -456,11 +456,13 @@ static void de_rx (struct de_private *de
>  					       buflen, PCI_DMA_FROMDEVICE);
>  			de->rx_skb[rx_tail].skb = copy_skb;
>  		} else {
> -			pci_dma_sync_single_for_cpu(de->pdev, mapping, len, PCI_DMA_FROMDEVICE);
> +			pci_dma_sync_single_for_cpu(de->pdev, mapping,
> +						    buflen, PCI_DMA_FROMDEVICE);
>  			skb_reserve(copy_skb, RX_OFFSET);
>  			skb_copy_from_linear_data(skb, skb_put(copy_skb, len),
>  						  len);
> -			pci_dma_sync_single_for_device(de->pdev, mapping, len, PCI_DMA_FROMDEVICE);
> +			pci_dma_sync_single_for_device(de->pdev, mapping,
> +						       buflen, PCI_DMA_FROMDEVICE);
>  
>  			/* We'll reuse the original ring buffer. */
>  			skb = copy_skb;
> 
> -- 

  reply	other threads:[~2010-01-22  1:02 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-20 20:44 [PATCH 00/11] DMA sync errors Stephen Hemminger
2010-01-20 20:45 ` [PATCH 01/11] tg3: fix DMA sync_single length error Stephen Hemminger
2010-01-20 20:45 ` [PATCH 02/11] sky2: " Stephen Hemminger
2010-01-20 21:32   ` Jarek Poplawski
2010-01-20 22:52     ` David Miller
2010-01-20 23:21       ` Jarek Poplawski
2010-01-20 23:34         ` David Miller
2010-01-20 23:41           ` David Miller
2010-01-20 23:59             ` Jarek Poplawski
2010-01-21  0:04               ` Stephen Hemminger
2010-01-21  0:15                 ` David Miller
2010-01-20 23:52           ` Jarek Poplawski
2010-01-20 23:56             ` David Miller
2010-01-20 20:45 ` [PATCH 03/11] skge: " Stephen Hemminger
2010-01-20 20:45 ` [PATCH 04/11] r8169: " Stephen Hemminger
2010-01-20 20:45 ` [PATCH 05/11] rrunner: " Stephen Hemminger
2010-01-20 20:45 ` [PATCH 06/11] de2104x: " Stephen Hemminger
2010-01-22  1:02   ` Grant Grundler [this message]
2010-01-22  1:12     ` Stephen Hemminger
2010-01-20 20:45 ` [PATCH 07/11] sungem: " Stephen Hemminger
2010-01-20 20:45 ` [PATCH 08/11] sunhme: " Stephen Hemminger
2010-01-20 20:45 ` [PATCH 09/11] cassini: " Stephen Hemminger
2010-01-20 20:45 ` [PATCH 10/11] cxgb3: " Stephen Hemminger
2010-01-20 20:45 ` [PATCH 11/11] ipoib: " Stephen Hemminger
2010-01-20 22:46 ` [PATCH 00/11] DMA sync errors David Miller
2010-01-20 23:28   ` Stephen Hemminger
2010-01-21  0:18     ` David Miller
2010-01-21  0:34       ` Stephen Hemminger
2010-01-21  0:36         ` David Miller
2010-01-21 12:44         ` Jarek Poplawski
2010-01-21 13:12           ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100122010244.GA27529@lackof.org \
    --to=grundler@parisc-linux.org \
    --cc=davem@davemloft.net \
    --cc=jarkao2@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.