netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Claudiu Manoil <claudiu.manoil@freescale.com>
To: Kevin Hao <haokexin@gmail.com>, <netdev@vger.kernel.org>,
	David Miller <davem@davemloft.net>
Subject: Re: [PATCH] net: gianfar: fix dma check map error when DMA_API_DEBUG is enabled
Date: Thu, 30 Oct 2014 18:28:01 +0200	[thread overview]
Message-ID: <54526711.1080505@freescale.com> (raw)
In-Reply-To: <1414664727-21988-1-git-send-email-haokexin@gmail.com>

On 10/30/2014 12:25 PM, Kevin Hao wrote:

[...]

> @@ -2406,6 +2416,25 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
>   	spin_unlock_irqrestore(&tx_queue->txlock, flags);
>
>   	return NETDEV_TX_OK;
> +
> +dma_map_err:
> +	txbdp = next_txbd(txbdp_start, base, tx_queue->tx_ring_size);
> +	if (do_tstamp)
> +		txbdp = next_txbd(txbdp, base, tx_queue->tx_ring_size);
> +	for (i = 0; i < nr_frags; i++) {
> +		lstatus = txbdp->lstatus;
> +		if (!(lstatus & BD_LFLAG(TXBD_READY)))
> +			break;
> +
> +		txbdp->lstatus = lstatus & ~BD_LFLAG(TXBD_READY);
> +		bufaddr = txbdp->bufPtr;
> +		dma_unmap_page(priv->dev, bufaddr, txbdp->length,
> +			       DMA_TO_DEVICE);
> +		txbdp = next_txbd(txbdp, base, tx_queue->tx_ring_size);
> +	}
> +	gfar_wmb();

Why use the wmb() memory barrier here?

> +	dev_kfree_skb_any(skb);
> +	return NETDEV_TX_OK;
>   }
>

[...]

Hi Dave,

The patch seems ok at first glance (except a minor comment) but I'd like 
to have it tested first because it modifies sensitive code.
I can re-send it to netdev later, after we're done testing it.
Maybe it would be better to stack up a few more gianfar fixes in the 
meantime and send them all to netdev as a pull request, later on.

Thanks,
Claudiu

  reply	other threads:[~2014-10-30 16:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 10:25 [PATCH] net: gianfar: fix dma check map error when DMA_API_DEBUG is enabled Kevin Hao
2014-10-30 16:28 ` Claudiu Manoil [this message]
2014-10-31  3:09   ` Kevin Hao
  -- strict thread matches above, loose matches on Subject: below --
2014-12-05 10:37 [PATCH 0/2] DMA API usage fixes in gianfar Arseny Solokha
2014-12-09 14:24 ` [PATCH net] gianfar: Fix dma check map error when DMA_API_DEBUG is enabled Claudiu Manoil
2014-12-10 18:13   ` David Miller
2014-12-11  2:06     ` Kevin Hao

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=54526711.1080505@freescale.com \
    --to=claudiu.manoil@freescale.com \
    --cc=davem@davemloft.net \
    --cc=haokexin@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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 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).