summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwmc3200wifi/debugfs.c
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2010-02-25 07:15:28 +0100
committerJohn W. Linville <linville@tuxdriver.com>2010-03-10 23:09:38 +0100
commitc03c6aefdc2c1f5785a5b0d1a3f7e48eeaae3505 (patch)
tree5f00ed890b35708e04da459cfdd37ab9a7f46c23 /drivers/net/wireless/iwmc3200wifi/debugfs.c
parentiwmc3200wifi: add ftrace event tracing support (diff)
downloadlinux-c03c6aefdc2c1f5785a5b0d1a3f7e48eeaae3505.tar.xz
linux-c03c6aefdc2c1f5785a5b0d1a3f7e48eeaae3505.zip
iwmc3200wifi: protect rx_tickets and rx_packets[] lists
Protect rx_tickets and rx_packets[] lists with spinlocks to fix the race condition for concurrent list operations. In iwmc3200wifi both sdio_isr_worker and rx_worker workqueues can access the rx ticket and packets lists at the same time under high rx load. Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwmc3200wifi/debugfs.c')
-rw-r--r--drivers/net/wireless/iwmc3200wifi/debugfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/debugfs.c b/drivers/net/wireless/iwmc3200wifi/debugfs.c
index 6ac5c8dbe051..48930c1a0f76 100644
--- a/drivers/net/wireless/iwmc3200wifi/debugfs.c
+++ b/drivers/net/wireless/iwmc3200wifi/debugfs.c
@@ -280,6 +280,7 @@ static ssize_t iwm_debugfs_rx_ticket_read(struct file *filp,
if (!buf)
return -ENOMEM;
+ spin_lock(&iwm->ticket_lock);
list_for_each_entry(ticket, &iwm->rx_tickets, node) {
len += snprintf(buf + len, buf_len - len, "Ticket #%d\n",
ticket->ticket->id);
@@ -288,6 +289,7 @@ static ssize_t iwm_debugfs_rx_ticket_read(struct file *filp,
len += snprintf(buf + len, buf_len - len, "\tflags: 0x%x\n",
ticket->ticket->flags);
}
+ spin_unlock(&iwm->ticket_lock);
for (i = 0; i < IWM_RX_ID_HASH; i++) {
struct iwm_rx_packet *packet;
@@ -296,6 +298,7 @@ static ssize_t iwm_debugfs_rx_ticket_read(struct file *filp,
if (!list_empty(pkt_list)) {
len += snprintf(buf + len, buf_len - len,
"Packet hash #%d\n", i);
+ spin_lock(&iwm->packet_lock[i]);
list_for_each_entry(packet, pkt_list, node) {
len += snprintf(buf + len, buf_len - len,
"\tPacket id: %d\n",
@@ -304,6 +307,7 @@ static ssize_t iwm_debugfs_rx_ticket_read(struct file *filp,
"\tPacket length: %lu\n",
packet->pkt_size);
}
+ spin_unlock(&iwm->packet_lock[i]);
}
}