Re: [PATCH 1/5] sgi-xp: Call netif_carrier_off() after register_netdev()
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 Acked-by: Robin Holt > --- > 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 = _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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/5] sgi-xp: Call netif_carrier_off() after register_netdev()
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 --- 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 = _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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/5] sgi-xp: Call netif_carrier_off() after register_netdev()
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 shchepet...@ispras.ru --- 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 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/5] sgi-xp: Call netif_carrier_off() after register_netdev()
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 shchepet...@ispras.ru Acked-by: Robin Holt h...@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 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/