Skip to content

Commit

Permalink
mwifiex: process event before command response
Browse files Browse the repository at this point in the history
During extended scan, SCAN report event is always followed by
command response. Sometimes It is observed that command response
is processed before SCAN report which leads to a crash, because
current command node is cleared while handling the response.
This patch makes sure that driver's main thread gives priority
to events over command responses.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Maithili Hinge <maithili@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Amitkumar Karwar authored and John W. Linville committed Apr 15, 2014
1 parent c0da71f commit 2047412
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/net/wireless/mwifiex/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,12 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
while ((skb = skb_dequeue(&adapter->usb_rx_data_q)))
mwifiex_handle_rx_packet(adapter, skb);

/* Check for event */
if (adapter->event_received) {
adapter->event_received = false;
mwifiex_process_event(adapter);
}

/* Check for Cmd Resp */
if (adapter->cmd_resp_received) {
adapter->cmd_resp_received = false;
Expand All @@ -304,12 +310,6 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
}
}

/* Check for event */
if (adapter->event_received) {
adapter->event_received = false;
mwifiex_process_event(adapter);
}

/* Check if we need to confirm Sleep Request
received previously */
if (adapter->ps_state == PS_STATE_PRE_SLEEP) {
Expand Down

0 comments on commit 2047412

Please sign in to comment.