From: Andreas Fenkart Date: Fri, 5 Apr 2013 03:03:52 +0000 (-0700) Subject: mwifiex: fix infinite loop by removing NO_PKT_PRIO_TID X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~65^2~170^2^2~18 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=333f6b22c5b88a9d856703b440257f46efa714c8;p=pandora-kernel.git mwifiex: fix infinite loop by removing NO_PKT_PRIO_TID Using NO_PKT_PRIO_TID and tx_pkts_queued to check for an empty state, can lead to a contradictory state, resulting in an infinite loop. Currently queueing and dequeuing of packets is not synchronized, and can happen concurrently. While tx_pkts_queued is incremented when adding a packet, max prio is set to NO_PKT when the WMM list is empty. If a packet is added right after the check for empty, but before setting max prio to NO_PKT, that packet is trapped and creates an infinite loop. Because of the new packet, tx_pkts_queued is at least 1, indicating wmm lists are not empty. Opposing that max prio is NO_PKT, which means "skip this wmm queue, it has no packets". The infinite loop results, because the main loop checks the wmm lists for not empty via tx_pkts_queued, but for dequeing it uses max_prio to see if it can skip current list. This will never end, unless a new packet is added which will restore max prio to the level of the trapped packet. The solution here is to rely on tx_pkts_queued solely for checking wmm queue to be empty, and drop the NO_PKT define. It does not address the locking issue. Signed-off-by: Andreas Fenkart Signed-off-by: Avinash Patil Signed-off-by: Bing Zhao Signed-off-by: John W. Linville --- Reading git-diff-tree failed