[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1344940135-17079-5-git-send-email-shchepetkov@ispras.ru>
Date: Tue, 14 Aug 2012 14:28:54 +0400
From: Ilya Shchepetkov <shchepetkov@...ras.ru>
To: "David S. Miller" <davem@...emloft.net>
Cc: Ilya Shchepetkov <shchepetkov@...ras.ru>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, ldv-project@...ras.ru
Subject: [PATCH 4/5] sungem: 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 called 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@...ras.ru>
---
drivers/net/ethernet/sun/sungem.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c
index 9ae12d0..c57c9f6 100644
--- a/drivers/net/ethernet/sun/sungem.c
+++ b/drivers/net/ethernet/sun/sungem.c
@@ -2909,7 +2909,6 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
gp->lstate = link_down;
gp->timer_ticks = 0;
- netif_carrier_off(dev);
gp->regs = ioremap(gemreg_base, gemreg_len);
if (!gp->regs) {
@@ -2988,6 +2987,9 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
goto err_out_free_consistent;
}
+ /* Turn off carrier */
+ netif_carrier_off(dev);
+
/* Undo the get_cell with appropriate locking (we could use
* ndo_init/uninit but that would be even more clumsy imho)
*/
--
1.7.7
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists