From patchwork Mon Mar 28 11:30:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivo van Doorn X-Patchwork-Id: 668171 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 p2SBamvO010486 for ; Mon, 28 Mar 2011 11:36:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752517Ab1C1Lgr (ORCPT ); Mon, 28 Mar 2011 07:36:47 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:58041 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752436Ab1C1Lgq (ORCPT ); Mon, 28 Mar 2011 07:36:46 -0400 Received: by mail-ww0-f44.google.com with SMTP id 36so3686803wwa.1 for ; Mon, 28 Mar 2011 04:36:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; bh=CjhDT+uMq8Ne5G5XAJDJtnaYKgJHyygijpRc+rz2VQE=; b=kDndEMMhii5RThQJcQJ+zc/1io8scnGf48hEthz2fLAOPreDNLqi3gH4pyY7MmgOkm rDO/MrLt+MmbUPCiFh8f1fpOZKIa0TYc0r+CjX80pBJrSkw+5fOJ7x0KEBHjCDonbO/O xm3TCm2kT392beqqFQSUnGWTeLfPy9F4YxTj4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=DmEG1/vAVL/7ymUzukBLxY6qE6kNYmhBaFZTw8cvwgOzr3ohZgb8U2Vy0mV4wL3QUC BFCkPAfoZy7xw1avwOXR47LWZCvIiWyYArJdz2s4t6blGXIBTFE0e4owEqpdJa6qAXfi rCMKSbgubhE08Loub4j+r8lvsOhDo3EoUWkII= Received: by 10.216.9.159 with SMTP id 31mr2782643wet.0.1301312206053; Mon, 28 Mar 2011 04:36:46 -0700 (PDT) Received: from localhost.localdomain (g121037.upc-g.chello.nl [80.57.121.37]) by mx.google.com with ESMTPS id h11sm1945140wbc.9.2011.03.28.04.36.43 (version=SSLv3 cipher=OTHER); Mon, 28 Mar 2011 04:36:45 -0700 (PDT) From: Ivo van Doorn To: "John W. Linville" Subject: [PATCH 02/13] rt2x00: Limit rt2800pci txdone processing to 16 entries at once Date: Mon, 28 Mar 2011 13:30:09 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.x86_64; KDE/4.4.5; x86_64; ; ) Cc: linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com References: <201103281329.45470.IvDoorn@gmail.com> In-Reply-To: <201103281329.45470.IvDoorn@gmail.com> MIME-Version: 1.0 Message-Id: <201103281330.10560.IvDoorn@gmail.com> 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, 28 Mar 2011 11:36:48 +0000 (UTC) diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index 4672dc9..d305514 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c @@ -717,12 +717,13 @@ static void rt2800pci_wakeup(struct rt2x00_dev *rt2x00dev) rt2800_config(rt2x00dev, &libconf, IEEE80211_CONF_CHANGE_PS); } -static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev) +static bool rt2800pci_txdone(struct rt2x00_dev *rt2x00dev) { struct data_queue *queue; struct queue_entry *entry; u32 status; u8 qid; + int max_tx_done = 16; while (kfifo_get(&rt2x00dev->txstatus_fifo, &status)) { qid = rt2x00_get_field32(status, TX_STA_FIFO_PID_QUEUE); @@ -759,7 +760,12 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev) entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE); rt2800_txdone_entry(entry, status); + + if (--max_tx_done == 0) + break; } + + return !max_tx_done; } static void rt2800pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, @@ -780,7 +786,9 @@ static void rt2800pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, static void rt2800pci_txstatus_tasklet(unsigned long data) { - rt2800pci_txdone((struct rt2x00_dev *)data); + struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; + if (rt2800pci_txdone(rt2x00dev)) + tasklet_schedule(&rt2x00dev->txstatus_tasklet); /* * No need to enable the tx status interrupt here as we always