summaryrefslogtreecommitdiff
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorAvinash Patil <patila@marvell.com>2014-09-29 20:14:14 +0400
committerJohn W. Linville <linville@tuxdriver.com>2014-09-30 21:17:46 +0400
commitb43a0d9d01dbe498632e83632a2409a575fcee23 (patch)
treedac8a24a778388ba11465ce91fab73131c2e4b20 /drivers/net/wireless
parentf73e557bca0609d0f997414a5b1403e3fadd5dea (diff)
downloadlinux-b43a0d9d01dbe498632e83632a2409a575fcee23.tar.xz
mwifiex: do not decrement rx_pending count twice
This patch fixes an issue with rx processing function where we were decrementing rx_pending count twice. Patch also queues correct main_work item when rx_pending count reaches low watermark. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/mwifiex/main.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index be5218987101..d5070c444fe1 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -130,7 +130,6 @@ static int mwifiex_process_rx(struct mwifiex_adapter *adapter)
{
unsigned long flags;
struct sk_buff *skb;
- bool delay_main_work = adapter->delay_main_work;
spin_lock_irqsave(&adapter->rx_proc_lock, flags);
if (adapter->rx_processing || adapter->rx_locked) {
@@ -145,10 +144,9 @@ static int mwifiex_process_rx(struct mwifiex_adapter *adapter)
while ((skb = skb_dequeue(&adapter->rx_data_q))) {
atomic_dec(&adapter->rx_pending);
if (adapter->delay_main_work &&
- (atomic_dec_return(&adapter->rx_pending) <
- LOW_RX_PENDING)) {
+ (atomic_read(&adapter->rx_pending) < LOW_RX_PENDING)) {
adapter->delay_main_work = false;
- queue_work(adapter->rx_workqueue, &adapter->rx_work);
+ queue_work(adapter->workqueue, &adapter->main_work);
}
mwifiex_handle_rx_packet(adapter, skb);
}
@@ -156,8 +154,6 @@ static int mwifiex_process_rx(struct mwifiex_adapter *adapter)
adapter->rx_processing = false;
spin_unlock_irqrestore(&adapter->rx_proc_lock, flags);
- if (delay_main_work)
- queue_work(adapter->workqueue, &adapter->main_work);
exit_rx_proc:
return 0;
}