netxen: hold tx lock while sending firmware commands

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, January 15, 2009 - 7:04 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=03e678...
Commit:     03e678ee968ae54b79c1580c2935895bd863ad95
Parent:     06e9d9f9783860fe4c602ef491f47211804ccc96
Author:     Dhananjay Phadke <dhananjay@netxen.com>
AuthorDate: Wed Jan 14 20:49:43 2009 -0800
Committer:  David S. Miller <davem@davemloft.net>
CommitDate: Wed Jan 14 20:49:43 2009 -0800

    netxen: hold tx lock while sending firmware commands
    
    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>
    Signed-off-by: David S. Miller <davem@davemloft.net>
---
 drivers/net/netxen/netxen_nic_hw.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index e2d2a2f..821cff6 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;
 }
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
netxen: hold tx lock while sending firmware commands, Linux Kernel Mailing ..., (Thu Jan 15, 7:04 pm)