netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] netxen: Bug fixes.
@ 2014-09-30  7:56 Manish Chopra
  2014-09-30  7:56 ` [PATCH net 1/2] netxen: Fix BUG "sleeping function called from invalid context" Manish Chopra
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Manish Chopra @ 2014-09-30  7:56 UTC (permalink / raw)
  To: davem; +Cc: netdev, umgwanakikbuti, Dept-GELinuxNICDev

Hi David,

This series fixes some TX specific issues.
* Move spin_lock(tx_clean_lock) in down path to fix
  atomic sleep bug (Reported by Mike Galbraith).
* Fix hang in interface down while running traffic.

Please consider applying this to 'net'.

Thanks,
Manish

Manish Chopra (2):
  netxen: Fix BUG "sleeping function called from invalid context"
  netxen: Fix bug in Tx completion path

 .../net/ethernet/qlogic/netxen/netxen_nic_init.c   |    6 ++++--
 .../net/ethernet/qlogic/netxen/netxen_nic_main.c   |    2 --
 2 files changed, 4 insertions(+), 4 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net 1/2] netxen: Fix BUG "sleeping function called from invalid context"
  2014-09-30  7:56 [PATCH net 0/2] netxen: Bug fixes Manish Chopra
@ 2014-09-30  7:56 ` Manish Chopra
  2014-09-30  7:56 ` [PATCH net 2/2] netxen: Fix bug in Tx completion path Manish Chopra
  2014-09-30 20:23 ` [PATCH net 0/2] netxen: Bug fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Manish Chopra @ 2014-09-30  7:56 UTC (permalink / raw)
  To: davem; +Cc: netdev, umgwanakikbuti, Dept-GELinuxNICDev

o __netxen_nic_down() function might sleep while holding spinlock_t(tx_clean_lock).
  Acquire this lock for only releasing TX buffers instead of taking it
  for whole down path.

Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
---
 .../net/ethernet/qlogic/netxen/netxen_nic_init.c   |    2 ++
 .../net/ethernet/qlogic/netxen/netxen_nic_main.c   |    2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
index 3205861..ae4ec7b 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
@@ -135,6 +135,7 @@ void netxen_release_tx_buffers(struct netxen_adapter *adapter)
 	int i, j;
 	struct nx_host_tx_ring *tx_ring = adapter->tx_ring;
 
+	spin_lock(&adapter->tx_clean_lock);
 	cmd_buf = tx_ring->cmd_buf_arr;
 	for (i = 0; i < tx_ring->num_desc; i++) {
 		buffrag = cmd_buf->frag_array;
@@ -158,6 +159,7 @@ void netxen_release_tx_buffers(struct netxen_adapter *adapter)
 		}
 		cmd_buf++;
 	}
+	spin_unlock(&adapter->tx_clean_lock);
 }
 
 void netxen_free_sw_resources(struct netxen_adapter *adapter)
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index 1159031..5ec5a2b 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -1186,7 +1186,6 @@ __netxen_nic_down(struct netxen_adapter *adapter, struct net_device *netdev)
 		return;
 
 	smp_mb();
-	spin_lock(&adapter->tx_clean_lock);
 	netif_carrier_off(netdev);
 	netif_tx_disable(netdev);
 
@@ -1204,7 +1203,6 @@ __netxen_nic_down(struct netxen_adapter *adapter, struct net_device *netdev)
 	netxen_napi_disable(adapter);
 
 	netxen_release_tx_buffers(adapter);
-	spin_unlock(&adapter->tx_clean_lock);
 }
 
 /* Usage: During suspend and firmware recovery module */
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net 2/2] netxen: Fix bug in Tx completion path.
  2014-09-30  7:56 [PATCH net 0/2] netxen: Bug fixes Manish Chopra
  2014-09-30  7:56 ` [PATCH net 1/2] netxen: Fix BUG "sleeping function called from invalid context" Manish Chopra
@ 2014-09-30  7:56 ` Manish Chopra
  2014-09-30 20:23 ` [PATCH net 0/2] netxen: Bug fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Manish Chopra @ 2014-09-30  7:56 UTC (permalink / raw)
  To: davem; +Cc: netdev, umgwanakikbuti, Dept-GELinuxNICDev

o Driver is not updating sw_consumer while processing Tx completion
  when interface is going down. Due to this interface down path gets
  stuck forever waiting for NAPI to complete.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
---
 .../net/ethernet/qlogic/netxen/netxen_nic_init.c   |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
index ae4ec7b..5c40683 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
@@ -1794,9 +1794,9 @@ int netxen_process_cmd_ring(struct netxen_adapter *adapter)
 			break;
 	}
 
-	if (count && netif_running(netdev)) {
-		tx_ring->sw_consumer = sw_consumer;
+	tx_ring->sw_consumer = sw_consumer;
 
+	if (count && netif_running(netdev)) {
 		smp_mb();
 
 		if (netif_queue_stopped(netdev) && netif_carrier_ok(netdev))
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net 0/2] netxen: Bug fixes.
  2014-09-30  7:56 [PATCH net 0/2] netxen: Bug fixes Manish Chopra
  2014-09-30  7:56 ` [PATCH net 1/2] netxen: Fix BUG "sleeping function called from invalid context" Manish Chopra
  2014-09-30  7:56 ` [PATCH net 2/2] netxen: Fix bug in Tx completion path Manish Chopra
@ 2014-09-30 20:23 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2014-09-30 20:23 UTC (permalink / raw)
  To: manish.chopra; +Cc: netdev, umgwanakikbuti, Dept-GELinuxNICDev

From: Manish Chopra <manish.chopra@qlogic.com>
Date: Tue, 30 Sep 2014 03:56:34 -0400

> This series fixes some TX specific issues.
> * Move spin_lock(tx_clean_lock) in down path to fix
>   atomic sleep bug (Reported by Mike Galbraith).
> * Fix hang in interface down while running traffic.
> 
> Please consider applying this to 'net'.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-09-30 20:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-30  7:56 [PATCH net 0/2] netxen: Bug fixes Manish Chopra
2014-09-30  7:56 ` [PATCH net 1/2] netxen: Fix BUG "sleeping function called from invalid context" Manish Chopra
2014-09-30  7:56 ` [PATCH net 2/2] netxen: Fix bug in Tx completion path Manish Chopra
2014-09-30 20:23 ` [PATCH net 0/2] netxen: Bug fixes David Miller

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).