[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7d01f9f00701230902x5876bba3y4d70b083151e16ad@mail.gmail.com>
Date: Tue, 23 Jan 2007 18:02:59 +0100
From: "Thibaut VARENE" <T-Bone@...isc-linux.org>
To: "Dale Farnsworth" <dale@...nsworth.org>
Cc: "Jeff Garzik" <jgarzik@...ox.com>,
"Jarek Poplawski" <jarkao2@...pl>, mlachwani@...sta.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mv643xx_eth: Fix race condition in mv643xx_eth_free_tx_descs
On 1/23/07, Dale Farnsworth <dale@...nsworth.org> wrote:
> From Dale Farnsworth <dale@...nsworth.org>
>
> mv643xx_eth: Fix race condition in mv643xx_eth_free_tx_descs
>
> This bug was found and isolated by Thibaut VARENE <T-Bone@...isc-linux.org>
> and Jarek Poplawski <jarkao2@...pl>. This patch is a modification of their
> fixes. We acquire and release the lock for each descriptor that is freed
> to minimize the time the lock is held.
>
> ---
>
> drivers/net/mv643xx_eth.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
> index c41ae42..b3bf864 100644
> --- a/drivers/net/mv643xx_eth.c
> +++ b/drivers/net/mv643xx_eth.c
> @@ -332,13 +339,13 @@ int mv643xx_eth_free_tx_descs(struct net
> if (skb)
> mp->tx_skb[tx_index] = NULL;
>
> - spin_unlock_irqrestore(&mp->lock, flags);
> -
> if (cmd_sts & ETH_ERROR_SUMMARY) {
> printk("%s: Error in TX\n", dev->name);
> mp->stats.tx_errors++;
> }
Note that this printk probably won't show immediately because IRQs are
disabled. But that's maybe not a big deal.
HTH
--
Thibaut VARENE
http://www.parisc-linux.org/~varenet/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists