From patchwork Wed May 4 19:42:05 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: 754582 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p44Jgqdc021505 for ; Wed, 4 May 2011 19:42:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755460Ab1EDTmu (ORCPT ); Wed, 4 May 2011 15:42:50 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:44639 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750897Ab1EDTmt (ORCPT ); Wed, 4 May 2011 15:42:49 -0400 Received: by eyx24 with SMTP id 24so461591eyx.19 for ; Wed, 04 May 2011 12:42:48 -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=eeXU5nBu3+mKEGYcQEGkvAIXe7+COF59nPoG4Duv0nE=; b=RzrdkFePN3eRMuvCF4WzysiWnJjPe6XyqmL+1eglAFOP9nhI7pYoxdk0weuWe+nyT3 uEy2AQHlLkYXTPAp78uPr2THp0276BHDU9SLb2jK2gh0uj2Ee+3k4RaL2+45NOjJIT3C zrIqv1/m0rDF9CAcGyV7O595edo1zHL0Z9/z0= 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=S7yaGCNriR74q1CHRGNLBciJw7s6HIrqJRDjtpvqz0k9IUkSiTsCex1JRX/mkGqPmF dUmWWOGVNugfAK3FdM5/v53i4HoNMpltGye4FS2qSQnIO32Fi8WWtGtWpt3D8T5Pmg4S DhdVoM0clXFqfAHOTpiuvROmI6zKsRmF6vGMU= Received: by 10.213.32.2 with SMTP id a2mr2203159ebd.80.1304538167664; Wed, 04 May 2011 12:42:47 -0700 (PDT) Received: from localhost.localdomain (g121037.upc-g.chello.nl [80.57.121.37]) by mx.google.com with ESMTPS id s49sm1073258eei.26.2011.05.04.12.42.46 (version=SSLv3 cipher=OTHER); Wed, 04 May 2011 12:42:46 -0700 (PDT) From: Ivo van Doorn To: "John W. Linville" Subject: [PATCH 2/2] rt2x00: Fix transfer speed regression for USB hardware Date: Wed, 4 May 2011 21:42:05 +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: <201105042141.37135.IvDoorn@gmail.com> In-Reply-To: <201105042141.37135.IvDoorn@gmail.com> MIME-Version: 1.0 Message-Id: <201105042142.06091.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 (demeter2.kernel.org [140.211.167.43]); Wed, 04 May 2011 19:42:52 +0000 (UTC) From: Ivo van Doorn Patch: rt2x00: Make rt2x00_queue_entry_for_each more flexible commit: 10e11568ca8b8a15f7478f6a4ceebabcbdba1018 introduced a severe regression on the throughput for USB hardware. It turns out that the exiting of the rt2x00queue_for_each_entry() was done too early. The exact cause for this regression is unknown, but by disabling the premature exiting of the loop seems to resolve the issue. Signed-off-by: Ivo van Doorn Reported-by: Yasushi SHOJI Reported-by: Balint Viragh Tested-by: Balint Viragh --- drivers/net/wireless/rt2x00/rt2x00usb.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index e027ebd..dc6b662 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c @@ -298,7 +298,7 @@ static bool rt2x00usb_kick_tx_entry(struct queue_entry *entry, void* data) if (!test_and_clear_bit(ENTRY_DATA_PENDING, &entry->flags) || test_bit(ENTRY_DATA_STATUS_PENDING, &entry->flags)) - return true; + return false; /* * USB devices cannot blindly pass the skb->len as the @@ -392,7 +392,7 @@ static bool rt2x00usb_kick_rx_entry(struct queue_entry *entry, void* data) if (test_and_set_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags) || test_bit(ENTRY_DATA_STATUS_PENDING, &entry->flags)) - return true; + return false; rt2x00lib_dmastart(entry); @@ -447,7 +447,7 @@ static bool rt2x00usb_flush_entry(struct queue_entry *entry, void* data) struct queue_entry_priv_usb_bcn *bcn_priv = entry->priv_data; if (!test_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags)) - return true; + return false; usb_kill_urb(entry_priv->urb);