diff options
author | Avinash Patil <patila@marvell.com> | 2014-09-29 12:14:14 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-09-30 13:17:46 -0400 |
commit | b43a0d9d01dbe498632e83632a2409a575fcee23 (patch) | |
tree | dac8a24a778388ba11465ce91fab73131c2e4b20 /drivers/net/wireless/mwifiex/main.c | |
parent | f73e557bca0609d0f997414a5b1403e3fadd5dea (diff) |
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/mwifiex/main.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/main.c | 8 |
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) | |||
130 | { | 130 | { |
131 | unsigned long flags; | 131 | unsigned long flags; |
132 | struct sk_buff *skb; | 132 | struct sk_buff *skb; |
133 | bool delay_main_work = adapter->delay_main_work; | ||
134 | 133 | ||
135 | spin_lock_irqsave(&adapter->rx_proc_lock, flags); | 134 | spin_lock_irqsave(&adapter->rx_proc_lock, flags); |
136 | if (adapter->rx_processing || adapter->rx_locked) { | 135 | if (adapter->rx_processing || adapter->rx_locked) { |
@@ -145,10 +144,9 @@ static int mwifiex_process_rx(struct mwifiex_adapter *adapter) | |||
145 | while ((skb = skb_dequeue(&adapter->rx_data_q))) { | 144 | while ((skb = skb_dequeue(&adapter->rx_data_q))) { |
146 | atomic_dec(&adapter->rx_pending); | 145 | atomic_dec(&adapter->rx_pending); |
147 | if (adapter->delay_main_work && | 146 | if (adapter->delay_main_work && |
148 | (atomic_dec_return(&adapter->rx_pending) < | 147 | (atomic_read(&adapter->rx_pending) < LOW_RX_PENDING)) { |
149 | LOW_RX_PENDING)) { | ||
150 | adapter->delay_main_work = false; | 148 | adapter->delay_main_work = false; |
151 | queue_work(adapter->rx_workqueue, &adapter->rx_work); | 149 | queue_work(adapter->workqueue, &adapter->main_work); |
152 | } | 150 | } |
153 | mwifiex_handle_rx_packet(adapter, skb); | 151 | mwifiex_handle_rx_packet(adapter, skb); |
154 | } | 152 | } |
@@ -156,8 +154,6 @@ static int mwifiex_process_rx(struct mwifiex_adapter *adapter) | |||
156 | adapter->rx_processing = false; | 154 | adapter->rx_processing = false; |
157 | spin_unlock_irqrestore(&adapter->rx_proc_lock, flags); | 155 | spin_unlock_irqrestore(&adapter->rx_proc_lock, flags); |
158 | 156 | ||
159 | if (delay_main_work) | ||
160 | queue_work(adapter->workqueue, &adapter->main_work); | ||
161 | exit_rx_proc: | 157 | exit_rx_proc: |
162 | return 0; | 158 | return 0; |
163 | } | 159 | } |