netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sathya Perla <sathya.perla@emulex.com>
To: <netdev@vger.kernel.org>
Subject: [PATCH net-next 1/6] be2net: remove wrong and unnecessary calls to netif_carrier_off()
Date: Wed, 3 Aug 2011 11:27:41 +0530	[thread overview]
Message-ID: <1312351066-16745-2-git-send-email-sathya.perla@emulex.com> (raw)
In-Reply-To: <1312351066-16745-1-git-send-email-sathya.perla@emulex.com>

1) In be_probe(), as soon as the MCC Q is created a gratuitous link status
event is received and processed. Accordingly netif_carrier_off/on() is called.
The extra netif_carrier_off() call in probe can race with this and cause wrong
state.

2) be_close() need not call netif_carrier_off(). It is OK to show the actual
link state even when the device is administratively down.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
 drivers/net/benet/be_main.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 9f2f66c..553cc0d 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -2217,7 +2217,6 @@ static int be_close(struct net_device *netdev)
 
 	be_async_mcc_disable(adapter);
 
-	netif_carrier_off(netdev);
 	adapter->link_up = false;
 
 	if (!lancer_chip(adapter))
@@ -3345,7 +3344,6 @@ static int __devinit be_probe(struct pci_dev *pdev,
 	status = register_netdev(netdev);
 	if (status != 0)
 		goto unsetup;
-	netif_carrier_off(netdev);
 
 	if (be_physfn(adapter) && adapter->sriov_enabled) {
 		u8 mac_speed;
-- 
1.7.4


  reply	other threads:[~2011-08-03  5:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03  5:57 [PATCH net-next 0/6] be2net: fixes Sathya Perla
2011-08-03  5:57 ` Sathya Perla [this message]
2011-08-03  5:57 ` [PATCH net-next 2/6] be2net: no need to query link status Sathya Perla
2011-08-03  5:57 ` [PATCH net-next 3/6] be2net: non-member vlan pkts not received in promiscous mode Sathya Perla
2011-08-03  5:57 ` [PATCH net-next 4/6] be2net: use RX_FILTER cmd to program multicast addresses Sathya Perla
2011-08-03  5:57 ` [PATCH net-next 5/6] be2net: add support for flashing Teranetics PHY firmware Sathya Perla
2011-08-03  5:57 ` [PATCH net-next 6/6] be2net: drop pkts that do not belong to the port Sathya Perla
2011-08-03 10:27 ` [PATCH net-next 0/6] be2net: fixes David Miller
2011-08-09 15:47 ` Eric Dumazet
2011-08-09 16:23   ` Eric Dumazet
2011-08-10 10:15     ` Sathya.Perla
2011-08-12  9:56     ` 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=1312351066-16745-2-git-send-email-sathya.perla@emulex.com \
    --to=sathya.perla@emulex.com \
    --cc=netdev@vger.kernel.org \
    /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).