Commit 8aad2464 authored by Ido Yariv's avatar Ido Yariv Committed by Luciano Coelho

wl12xx: Reorder data handling in irq_work

The FW has a limited amount of memory for holding frames. In case it
runs out of memory reserved for RX frames, it'll have no other choice
but to drop packets received from the AP. Thus, it is important to
handle RX data interrupts as soon as possible, before handling anything
else.

In addition, since there are enough TX descriptors to go around, it is
better to first send TX frames, and only then handle TX completions.

Fix this by changing the order of function calls in wl1271_irq_work.
Signed-off-by: default avatarIdo Yariv <ido@wizery.com>
Signed-off-by: default avatarOhad Ben-Cohen <ohad@wizery.com>
Reviewed-by: default avatarLuciano Coelho <coelho@ti.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent 50e9f746
...@@ -685,10 +685,7 @@ static void wl1271_irq_work(struct work_struct *work) ...@@ -685,10 +685,7 @@ static void wl1271_irq_work(struct work_struct *work)
if (intr & WL1271_ACX_INTR_DATA) { if (intr & WL1271_ACX_INTR_DATA) {
wl1271_debug(DEBUG_IRQ, "WL1271_ACX_INTR_DATA"); wl1271_debug(DEBUG_IRQ, "WL1271_ACX_INTR_DATA");
/* check for tx results */ wl1271_rx(wl, &wl->fw_status->common);
if (wl->fw_status->common.tx_results_counter !=
(wl->tx_results_count & 0xff))
wl1271_tx_complete(wl);
/* Check if any tx blocks were freed */ /* Check if any tx blocks were freed */
if (!test_bit(WL1271_FLAG_FW_TX_BUSY, &wl->flags) && if (!test_bit(WL1271_FLAG_FW_TX_BUSY, &wl->flags) &&
...@@ -700,7 +697,10 @@ static void wl1271_irq_work(struct work_struct *work) ...@@ -700,7 +697,10 @@ static void wl1271_irq_work(struct work_struct *work)
wl1271_tx_work_locked(wl); wl1271_tx_work_locked(wl);
} }
wl1271_rx(wl, &wl->fw_status->common); /* check for tx results */
if (wl->fw_status->common.tx_results_counter !=
(wl->tx_results_count & 0xff))
wl1271_tx_complete(wl);
} }
if (intr & WL1271_ACX_INTR_EVENT_A) { if (intr & WL1271_ACX_INTR_EVENT_A) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment