From: Ivan Vecera Date: Tue, 15 Feb 2011 02:08:39 +0000 (+0000) Subject: drivers/net: Call netif_carrier_off at the end of the probe X-Git-Tag: v2.6.37.4~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fea891e387dbd48bbe13d5a588059e879eaa8dfe;p=thirdparty%2Fkernel%2Fstable.git drivers/net: Call netif_carrier_off at the end of the probe commit 0d672e9f8ac320c6d1ea9103db6df7f99ea20361 upstream. Without calling of netif_carrier_off at the end of the probe the operstate is unknown when the device is initially opened. By default the carrier is on so when the device is opened and netif_carrier_on is called the link watch event is not fired and operstate remains zero (unknown). This patch fixes this behavior in forcedeth and r8169. Signed-off-by: Ivan Vecera Acked-by: Francois Romieu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 0fa1776563a33..4a0762b2808fb 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c @@ -5816,6 +5816,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i goto out_error; } + netif_carrier_off(dev); + dev_printk(KERN_INFO, &pci_dev->dev, "ifname %s, PHY OUI 0x%x @ %d, " "addr %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", dev->name, diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 2eda96279f8e4..b17e356dbd27b 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c @@ -3236,6 +3236,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) if (pci_dev_run_wake(pdev)) pm_runtime_put_noidle(&pdev->dev); + netif_carrier_off(dev); + out: return rc;