netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Fertser <fercerpav@gmail.com>
To: Gary Zambrano <zambrano@broadcom.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, Paul Fertser <fercerpav@gmail.com>,
	stable@kernel.org
Subject: [PATCH] b44: fix carrier detection on bind
Date: Tue, 12 Oct 2010 02:42:30 +0400	[thread overview]
Message-ID: <1286836950-3161-1-git-send-email-fercerpav@gmail.com> (raw)

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.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Cc: stable@kernel.org
---

Without this it's quite annoying to boot a laptop without ethernet
connection as the userspace is getting confused and can even add a default
route through a non-functional interface (when it's configured to use
static ip).

 drivers/net/b44.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 37617ab..d711eb6 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -2161,8 +2161,6 @@ static int __devinit b44_init_one(struct ssb_device *sdev,
 	dev->irq = sdev->irq;
 	SET_ETHTOOL_OPS(dev, &b44_ethtool_ops);
 
-	netif_carrier_off(dev);
-
 	err = ssb_bus_powerup(sdev->bus, 0);
 	if (err) {
 		dev_err(sdev->dev,
@@ -2204,6 +2202,8 @@ static int __devinit b44_init_one(struct ssb_device *sdev,
 		goto err_out_powerdown;
 	}
 
+	netif_carrier_off(dev);
+
 	ssb_set_drvdata(sdev, dev);
 
 	/* Chip reset provides power to the b44 MAC & PCI cores, which
-- 
1.7.2.2


             reply	other threads:[~2010-10-11 22:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-11 22:42 Paul Fertser [this message]
2010-10-11 22:45 ` [PATCH] b44: fix carrier detection on bind David Miller

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=1286836950-3161-1-git-send-email-fercerpav@gmail.com \
    --to=fercerpav@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=stable@kernel.org \
    --cc=zambrano@broadcom.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).