Subject: Re: [PATCHv1 net] tg3: fix deadlock in tg3_change_mtu()

From: David Vrabel <[email-masked]>
Date: Thu, 6 Feb 2014 10:43:49 +0000

On 05/02/14 22:09, Nithin Nayak Sujir wrote:
> 
> David,
> Rather than doing it this way, I think it's sufficient to move the call
> to tg3_set_mtu() between tg3_netif_stop() and tg3_full_lock().
> 
> Before tg3 started using set_bit() for flags, tg3_set_mtu() needed to be
> under a lock, but that's not the case anymore.
> 
> Can you try this patch?

That looks better.

Tested-by: David Vrabel <[email-masked]>

Thanks.

David

> diff --git a/drivers/net/ethernet/broadcom/tg3.c
> b/drivers/net/ethernet/broadcom/tg3.c
> index e2ca03e..0bb79b8 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -14113,12 +14113,12 @@ static int tg3_change_mtu(struct net_device
> *dev, int new_mtu)
> 
>         tg3_netif_stop(tp);
> 
> +       tg3_set_mtu(dev, tp, new_mtu);
> +
>         tg3_full_lock(tp, 1);
> 
>         tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
> 
> -       tg3_set_mtu(dev, tp, new_mtu);
> -
>         /* Reset PHY, otherwise the read DMA engine will be in a mode that
>          * breaks all requests to 256 bytes.
>          */
> 
> Nithin.