Commit 5cbba2d4 authored by Victor Goldenshtein's avatar Victor Goldenshtein Committed by Luciano Coelho

wlcore: fix occasional AP TX stop after recovery

The fw_status wasn't zeroed during allocation, resulting
in uninitialized var usage, and finally causing AP
traffic stop after recovery.

The wrong value in fw_status_2->counters.tx_lnk_free_pkts
led to a bad lnk->allocated_pkts calculation in
wlcore_fw_status(), causing wl18xx_lnk_low_prio() to return
FALSE (lnk->allocated_pkts > thold).
This eventually blocked the link in wlcore_tx_work_locked(),
as wl1271_skb_dequeue() continuously returned NULL.

Fix it by zeroing wl->fw_status_1/2 during allocation.
Signed-off-by: default avatarVictor Goldenshtein <victorg@ti.com>
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent 2baf53c6
...@@ -970,7 +970,7 @@ static int wlcore_fw_wakeup(struct wl1271 *wl) ...@@ -970,7 +970,7 @@ static int wlcore_fw_wakeup(struct wl1271 *wl)
static int wl1271_setup(struct wl1271 *wl) static int wl1271_setup(struct wl1271 *wl)
{ {
wl->fw_status_1 = kmalloc(WLCORE_FW_STATUS_1_LEN(wl->num_rx_desc) + wl->fw_status_1 = kzalloc(WLCORE_FW_STATUS_1_LEN(wl->num_rx_desc) +
sizeof(*wl->fw_status_2) + sizeof(*wl->fw_status_2) +
wl->fw_status_priv_len, GFP_KERNEL); wl->fw_status_priv_len, GFP_KERNEL);
if (!wl->fw_status_1) if (!wl->fw_status_1)
...@@ -980,7 +980,7 @@ static int wl1271_setup(struct wl1271 *wl) ...@@ -980,7 +980,7 @@ static int wl1271_setup(struct wl1271 *wl)
(((u8 *) wl->fw_status_1) + (((u8 *) wl->fw_status_1) +
WLCORE_FW_STATUS_1_LEN(wl->num_rx_desc)); WLCORE_FW_STATUS_1_LEN(wl->num_rx_desc));
wl->tx_res_if = kmalloc(sizeof(*wl->tx_res_if), GFP_KERNEL); wl->tx_res_if = kzalloc(sizeof(*wl->tx_res_if), GFP_KERNEL);
if (!wl->tx_res_if) { if (!wl->tx_res_if) {
kfree(wl->fw_status_1); kfree(wl->fw_status_1);
return -ENOMEM; return -ENOMEM;
......
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