All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Holt <holt@sgi.com>
To: Ilya Shchepetkov <shchepetkov@ispras.ru>
Cc: Robin Holt <holt@sgi.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-kernel@vger.kernel.org, ldv-project@ispras.ru
Subject: Re: [PATCH 1/5] sgi-xp: Call netif_carrier_off() after register_netdev()
Date: Tue, 14 Aug 2012 09:22:52 -0500	[thread overview]
Message-ID: <20120814142252.GA3093@sgi.com> (raw)
In-Reply-To: <1344940135-17079-2-git-send-email-shchepetkov@ispras.ru>

On Tue, Aug 14, 2012 at 02:28:51PM +0400, Ilya Shchepetkov wrote:
> For carrier detection to work properly when binding the driver with a
> cable unplugged, netif_carrier_off() should be calle after
> register_netdev(), not before.
> 
> Calling netif_carrier_off() before register_netdev() was causing the
> network interface to miss a linkwatch pending event leading to an
> inconsistent state if the link is not up when interface is initialized.
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Ilya Shchepetkov <shchepetkov@ispras.ru>

Acked-by: Robin Holt <holt@sgi.com>

> ---
>  drivers/misc/sgi-xp/xpnet.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/misc/sgi-xp/xpnet.c b/drivers/misc/sgi-xp/xpnet.c
> index 3fac67a..9296c8d 100644
> --- a/drivers/misc/sgi-xp/xpnet.c
> +++ b/drivers/misc/sgi-xp/xpnet.c
> @@ -550,8 +550,6 @@ xpnet_init(void)
>  		return -ENOMEM;
>  	}
>  
> -	netif_carrier_off(xpnet_device);
> -
>  	xpnet_device->netdev_ops = &xpnet_netdev_ops;
>  	xpnet_device->mtu = XPNET_DEF_MTU;
>  
> @@ -584,6 +582,8 @@ xpnet_init(void)
>  		kfree(xpnet_broadcast_partitions);
>  	}
>  
> +	netif_carrier_off(xpnet_device);
> +
>  	return result;
>  }
>  
> -- 
> 1.7.7

  reply	other threads:[~2012-08-14 14:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-14 10:28 [PATCH 0/5] Call netif_carrier_off() after register_netdev() Ilya Shchepetkov
2012-08-14 10:28 ` [PATCH 1/5] sgi-xp: " Ilya Shchepetkov
2012-08-14 14:22   ` Robin Holt [this message]
2012-08-14 10:28 ` [PATCH 2/5] de2104x: " Ilya Shchepetkov
2012-08-14 10:28 ` [PATCH 3/5] net/mlx4_en: " Ilya Shchepetkov
2012-08-14 12:36   ` Sathya.Perla
2012-08-14 14:56     ` Ben Hutchings
2012-08-14 10:28 ` [PATCH 4/5] sungem: " Ilya Shchepetkov
2012-08-14 10:28 ` [PATCH 5/5] net/hyperv: " Ilya Shchepetkov
2012-08-14 15:32   ` Haiyang Zhang
2012-08-14 21:00 ` [PATCH 0/5] " David Miller
2012-08-14 22:47   ` Ben Hutchings
2012-08-15 11:40     ` Bjørn Mork
2012-08-17  7:55       ` Ilya Shchepetkov
2012-08-17 16:20         ` Stephen Hemminger

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=20120814142252.GA3093@sgi.com \
    --to=holt@sgi.com \
    --cc=davem@davemloft.net \
    --cc=ldv-project@ispras.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shchepetkov@ispras.ru \
    /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.