From: Yasushi SHOJI <yashi@atmark-techno.com>
To: helmut.schaa@googlemail.com
Cc: ivdoorn@gmail.com
Cc: hanada@atmark-techno.com
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 04/23] rt2x00: Make rt2x00_queue_entry_for_each more flexible
Date: Thu, 28 Apr 2011 11:55:22 +0900 [thread overview]
Message-ID: <878vuvt78l.wl@dns1.atmark-techno.com> (raw)
In-Reply-To: <201104181527.44542.IvDoorn@gmail.com>
Hi,
At Mon, 18 Apr 2011 15:27:43 +0200,
Ivo van Doorn wrote:
>
> From: Helmut Schaa <helmut.schaa-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
>
> Allow passing a void pointer to rt2x00_queue_entry_for_each which in
> turn in provided to the callback function.
>
> Furthermore, allow the callback function to stop processing by returning
> true. And also notify the caller of rt2x00_queue_entry_for_each if the
> loop was canceled by the callback.
My colleague just tested this patch set and found out that the in
question makes our 400MHz ARM cpu board with ralink usb dongle non
functional due to high cpu consumption. it seems for us that exiting
from function every time it finds an entry is too expensive on systems
slower than PCs.
To verify our thought, we changed the source code as the patch below.
What we intended to do with this change is to continue processing all
entry without breaking semantics.
With the patch below our board seem to work fine again, but not sure
exactly why it takes so much time to check the list again. We are not
against the idea of the patch at all. We just want to ask you guys
how we should go to track this problem. it might be the slow usb?
Thanks,
> diff -urN compat-wireless-2011-04-26/drivers/net/wireless/rt2x00/rt2x00queue.c compat-wireless-2011-04-26-armadillo/drivers/net/wireless/rt2x00/rt2x00queue.c
> --- compat-wireless-2011-04-26/drivers/net/wireless/rt2x00/rt2x00queue.c 2011-04-27 04:04:26.000000000 +0900
> +++ compat-wireless-2011-04-26-armadillo/drivers/net/wireless/rt2x00/rt2x00queue.c 2011-04-27 17:13:45.000000000 +0900
> @@ -740,6 +740,7 @@
> unsigned int index_start;
> unsigned int index_end;
> unsigned int i;
> + bool ret = false;
>
> if (unlikely(start >= Q_INDEX_MAX || end >= Q_INDEX_MAX)) {
> ERROR(queue->rt2x00dev,
> @@ -766,21 +767,21 @@
> if (index_start < index_end) {
> for (i = index_start; i < index_end; i++) {
> if (fn(&queue->entries[i], data))
> - return true;
> + ret = true;
> }
> } else {
> for (i = index_start; i < queue->limit; i++) {
> if (fn(&queue->entries[i], data))
> - return true;
> + ret = true;
> }
>
> for (i = 0; i < index_end; i++) {
> if (fn(&queue->entries[i], data))
> - return true;
> + ret = true;
> }
> }
>
> - return false;
> + return ret;
> }
> EXPORT_SYMBOL_GPL(rt2x00queue_for_each_entry);
--
yashi
next prev parent reply other threads:[~2011-04-28 3:02 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-18 13:26 [PATCH 01/23] Enable WLAN LED on Ralink SoC (rt305x) devices Ivo van Doorn
2011-04-18 13:26 ` [PATCH 02/23] rt2x00: Fix stuck queue in tx failure case Ivo van Doorn
2011-04-18 13:27 ` [PATCH 03/23] rt2x00: Split rt2x00dev->flags Ivo van Doorn
2011-04-18 13:27 ` [PATCH 04/23] rt2x00: Make rt2x00_queue_entry_for_each more flexible Ivo van Doorn
2011-04-18 13:28 ` [PATCH 05/23] rt2x00: Use correct TBTT_SYNC config in AP mode Ivo van Doorn
2011-04-18 13:28 ` [PATCH 06/23] rt2x00: Update TX_SW_CFG2 init value Ivo van Doorn
2011-04-18 13:28 ` [PATCH 07/23] rt2x00: Use TXOP_HTTXOP for beacons Ivo van Doorn
2011-04-18 13:29 ` [PATCH 08/23] rt2800usb: read TX_STA_FIFO asynchronously Ivo van Doorn
2011-04-18 13:29 ` [PATCH 09/23] rt2x00: fix queue timeout checks Ivo van Doorn
2011-04-18 13:30 ` [PATCH 10/23] rt2800usb: handle TX status timeouts Ivo van Doorn
2011-04-18 13:30 ` [PATCH 11/23] rt2800usb: add timer to handle TX_STA_FIFO Ivo van Doorn
2011-04-18 13:31 ` [PATCH 12/23] Decrease association time for USB devices Ivo van Doorn
2011-04-18 13:31 ` [PATCH 13/23] rt2x00: Always inline rt2x00pci_enable_interrupt Ivo van Doorn
2011-04-18 13:31 ` [PATCH 14/23] rt2x00: Linksys WUSB600N rev2 is a RT3572 device Ivo van Doorn
2011-04-18 13:32 ` [PATCH 15/23] rt2x00: Allow dynamic addition of PCI/USB IDs Ivo van Doorn
2011-04-18 13:32 ` [PATCH 16/23] rt2x00: Add USB IDs Ivo van Doorn
2011-04-18 13:33 ` [PATCH 17/23] rt2x00: RT33xx device support is no longer experimental Ivo van Doorn
2011-04-18 13:33 ` [PATCH 18/23] rt2x00: Enable support for RT53xx PCI devices by default Ivo van Doorn
2011-04-18 13:33 ` [PATCH 19/23] rt2x00: Merge rt2x00ht.c contents in other files Ivo van Doorn
2011-04-18 13:34 ` [PATCH 20/23] rt2x00: Optimize register access in rt2800pci Ivo van Doorn
2011-04-18 13:34 ` [PATCH 21/23] rt2x00: Optimize register access in rt2800usb Ivo van Doorn
2011-04-18 13:34 ` [PATCH 22/23] rt2x00: Implement get_ringparam callback function Ivo van Doorn
2011-04-18 13:35 ` [PATCH 23/23] rt2x00: Implement get_antenna and set_antenna callback functions Ivo van Doorn
2011-04-18 13:56 ` [PATCH 21/23] rt2x00: Optimize register access in rt2800usb Rafał Miłecki
2011-04-18 14:06 ` Ivo Van Doorn
2011-04-18 14:14 ` Rafał Miłecki
2011-04-18 14:48 ` Helmut Schaa
2011-04-18 15:02 ` Rafał Miłecki
2011-04-28 2:55 ` [PATCH 04/23] rt2x00: Make rt2x00_queue_entry_for_each more flexible Yasushi SHOJI
2011-04-28 2:55 ` Yasushi SHOJI [this message]
2011-04-28 18:55 ` Ivo Van Doorn
2011-04-29 6:06 ` Gertjan van Wingerde
2011-04-30 14:01 ` Ivo van Doorn
2011-05-02 13:33 ` Yasushi SHOJI
2011-05-02 19:24 ` Ivo van Doorn
2011-05-09 8:08 ` Yasushi SHOJI
2011-05-09 8:50 ` Ivo Van Doorn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878vuvt78l.wl@dns1.atmark-techno.com \
--to=yashi@atmark-techno.com \
--cc=helmut.schaa@googlemail.com \
--cc=ivdoorn@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).