From patchwork Mon Apr 18 13:44:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Yariv X-Patchwork-Id: 715421 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3IDiMGR005473 for ; Mon, 18 Apr 2011 13:44:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752703Ab1DRNoV (ORCPT ); Mon, 18 Apr 2011 09:44:21 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:58781 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751830Ab1DRNoU (ORCPT ); Mon, 18 Apr 2011 09:44:20 -0400 Received: by wwa36 with SMTP id 36so5680567wwa.1 for ; Mon, 18 Apr 2011 06:44:19 -0700 (PDT) Received: by 10.227.11.148 with SMTP id t20mr4946074wbt.98.1303134259659; Mon, 18 Apr 2011 06:44:19 -0700 (PDT) Received: from localhost.localdomain (46-116-5-175.bb.netvision.net.il [46.116.5.175]) by mx.google.com with ESMTPS id l24sm3274943wbc.47.2011.04.18.06.44.18 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Apr 2011 06:44:19 -0700 (PDT) From: Ido Yariv To: "Luciano Coelho" Cc: linux-wireless@vger.kernel.org, Ido Yariv Subject: [PATCH] wl12xx: Restart TX when TX descriptors are available Date: Mon, 18 Apr 2011 16:44:11 +0300 Message-Id: <1303134251-31514-1-git-send-email-ido@wizery.com> X-Mailer: git-send-email 1.7.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 18 Apr 2011 13:44:38 +0000 (UTC) The driver stops sending TX packets when either there aren't enough memory blocks, or it runs out of TX descriptors. The driver continues to send packets to the FW only when more memory blocks are available. The FW might free TX descriptors without freeing the corresponding memory blocks, especially when dynamic memory is enabled. In cases where memory blocks are not freed at all, the driver will keep waiting for more memory blocks indefinitely. Fix this by clearing the WL1271_FLAG_FW_TX_BUSY flag when there are available TX descriptors. Signed-off-by: Ido Yariv --- drivers/net/wireless/wl12xx/tx.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c index 7a3339f..5a1575f 100644 --- a/drivers/net/wireless/wl12xx/tx.c +++ b/drivers/net/wireless/wl12xx/tx.c @@ -65,6 +65,9 @@ static int wl1271_alloc_tx_id(struct wl1271 *wl, struct sk_buff *skb) static void wl1271_free_tx_id(struct wl1271 *wl, int id) { if (__test_and_clear_bit(id, wl->tx_frames_map)) { + if (unlikely(wl->tx_frames_cnt == ACX_TX_DESCRIPTORS)) + clear_bit(WL1271_FLAG_FW_TX_BUSY, &wl->flags); + wl->tx_frames[id] = NULL; wl->tx_frames_cnt--; }