]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drivers/net: Call netif_carrier_off at the end of the probe
authorIvan Vecera <ivecera@redhat.com>
Tue, 15 Feb 2011 02:08:39 +0000 (02:08 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 14 Mar 2011 21:17:39 +0000 (14:17 -0700)
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 <ivecera@redhat.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/forcedeth.c
drivers/net/r8169.c

index 0fa1776563a33c61a827f79e6824c600e9b41efc..4a0762b2808fbce53c8f9066f6f733f707b8e194 100644 (file)
@@ -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,
index 2eda96279f8e49115ef284c56dc8b3c63049a81b..b17e356dbd27bb52afa1e9358914c5f0bbd4e44c 100644 (file)
@@ -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;