From: Bing Zhao Date: Mon, 1 Apr 2013 19:44:46 +0000 (-0700) Subject: mwifiex: fix negative cmd_pending count X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~65^2~170^2^2~27 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9908b07465556d4c96685d7f1ead0e17b01c662d;p=pandora-kernel.git mwifiex: fix negative cmd_pending count cmd_pending is increased in mwifiex_wait_queue_complete() and decreased in mwifiex_complete_cmd() currently. If there are two or more commands in the cmd_pending_q the main worker thread will pick up next command from cmd_pending_q automatically after finishing current command. As a result mwifiex_wait_queue_complete() will not be called because the command is alreay completed. This leads to a negative number in cmd_pending count. Fix it by increasing cmd_pending when a cmd is queued into cmd_pending_q and decreasing when that cmd is recycled. For scan commands we don't perform inc/dec operations until it's moved from scan_pending_q to cmd_pending_q. This covers both synchronous and asynchronous commands. Reported-by: Daniel Drake Tested-by: Daniel Drake Tested-by: Marco Cesarano Signed-off-by: Bing Zhao Signed-off-by: John W. Linville --- Reading git-diff-tree failed