netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: dhananjay@netxen.com
To: netdev@vger.kernel.org
Cc: jeff@garzik.org
Subject: [patch 4/6] netxen: stop second phy correctly
Date: Thu, 20 Dec 2007 18:37:00 -0800	[thread overview]
Message-ID: <20071221024309.027774970@netxen.com> (raw)
In-Reply-To: 20071221023656.409657310@netxen.com

[-- Attachment #1: stop_port.patch --]
[-- Type: text/plain, Size: 1700 bytes --]

This patch fixes bug that doesn't quiesce second port when interface is
brought down, which could lead to unwarranted interrupt during rmmod/ifdown.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>

Index: netdev-2.6/drivers/net/netxen/netxen_nic_niu.c
===================================================================
--- netdev-2.6.orig/drivers/net/netxen/netxen_nic_niu.c
+++ netdev-2.6/drivers/net/netxen/netxen_nic_niu.c
@@ -742,12 +742,12 @@ int netxen_niu_disable_xg_port(struct ne
 	__u32 mac_cfg;
 	u32 port = physical_port[adapter->portnum];
 
-	if (port != 0)
+	if (port > NETXEN_NIU_MAX_XG_PORTS)
 		return -EINVAL;
+
 	mac_cfg = 0;
-	netxen_xg_soft_reset(mac_cfg);
-	if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_CONFIG_0,
-				   &mac_cfg, 4))
+	if (netxen_nic_hw_write_wx(adapter,
+		NETXEN_NIU_XGE_CONFIG_0 + (0x10000 * port), &mac_cfg, 4))
 		return -EIO;
 	return 0;
 }
Index: netdev-2.6/drivers/net/netxen/netxen_nic_main.c
===================================================================
--- netdev-2.6.orig/drivers/net/netxen/netxen_nic_main.c
+++ netdev-2.6/drivers/net/netxen/netxen_nic_main.c
@@ -725,11 +725,6 @@ static void __devexit netxen_nic_remove(
 
 	unregister_netdev(netdev);
 
-	if (adapter->stop_port)
-		adapter->stop_port(adapter);
-
-	netxen_nic_disable_int(adapter);
-
 	if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC) {
 		init_firmware_done++;
 		netxen_free_hw_resources(adapter);
@@ -912,6 +907,9 @@ static int netxen_nic_close(struct net_d
 	netif_stop_queue(netdev);
 	napi_disable(&adapter->napi);
 
+	if (adapter->stop_port)
+		adapter->stop_port(adapter);
+
 	netxen_nic_disable_int(adapter);
 
 	cmd_buff = adapter->cmd_buf_arr;

-- 

  parent reply	other threads:[~2007-12-21  2:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-21  2:36 [patch 0/6] netxen bug fixes dhananjay
2007-12-21  2:36 ` [patch 1/6] netxen: Update MAINTAINERS dhananjay
2007-12-21  2:36 ` [patch 2/6] netxen: update driver version dhananjay
2007-12-21  2:36 ` [patch 3/6] netxen: improve MSI interrupt handling dhananjay
2007-12-23  3:52   ` Jeff Garzik
2007-12-25  0:52     ` Dhananjay Phadke
2007-12-21  2:37 ` dhananjay [this message]
2007-12-21  2:37 ` [patch 5/6] netxen: fix race in interrupt / napi dhananjay
2007-12-21  2:37 ` [patch 6/6] netxen: optimize tx handling dhananjay

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=20071221024309.027774970@netxen.com \
    --to=dhananjay@netxen.com \
    --cc=jeff@garzik.org \
    --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).