Patchwork [08/13] netxen: hold tx lock while sending firmware commands

login
register
mail settings
Submitter Dhananjay Phadke
Date Jan. 12, 2009, 7:23 p.m.
Message ID <1231788191-23794-9-git-send-email-dhananjay@netxen.com>
Download mbox | patch
Permalink /patch/17991/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Dhananjay Phadke - Jan. 12, 2009, 7:23 p.m.
Some firmware commands like mac address addition/deletion are sent
on the transmit ring. So need to hold the tx lock before touching
tx producer/consumer indices.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
---
 drivers/net/netxen/netxen_nic_hw.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Patch

diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index 1ce3ab1..e8c7005 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -503,6 +503,8 @@  netxen_send_cmd_descs(struct netxen_adapter *adapter,
 
 	i = 0;
 
+	netif_tx_lock_bh(adapter->netdev);
+
 	producer = adapter->cmd_producer;
 	do {
 		cmd_desc = &cmd_desc_arr[i];
@@ -527,6 +529,8 @@  netxen_send_cmd_descs(struct netxen_adapter *adapter,
 
 	netxen_nic_update_cmd_producer(adapter, adapter->cmd_producer);
 
+	netif_tx_unlock_bh(adapter->netdev);
+
 	return 0;
 }