Return-path: Received: from arrakis.dune.hu ([78.24.191.176]:33983 "EHLO arrakis.dune.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753395Ab3FCUcN (ORCPT ); Mon, 3 Jun 2013 16:32:13 -0400 Message-ID: <51ACFD50.7000807@openwrt.org> (sfid-20130603_223307_576409_F75F65DC) Date: Mon, 03 Jun 2013 22:32:16 +0200 From: Gabor Juhos MIME-Version: 1.0 To: Jakub Kicinski CC: "John W. Linville" , linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com Subject: Re: [rt2x00-users] [PATCH 1/7] rt2x00: rt2x00dev: use rt2x00dev->tx->limit References: <1367421455-18463-1-git-send-email-juhosg@openwrt.org> <1367421455-18463-2-git-send-email-juhosg@openwrt.org> <20130603190959.70b1f4d2@north> In-Reply-To: <20130603190959.70b1f4d2@north> Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-wireless-owner@vger.kernel.org List-ID: Hi Kuba! > On Wed, 1 May 2013 17:17:29 +0200, Gabor Juhos wrote: >> The TX data queue is initialized already when >> the rt2x00lib_probe_hw() function is called. >> >> Fetch the number of the queue entries from that >> instead of using the entry_num field of the data >> queue descriptor. >> >> The two values are the same, and the use of the >> rt2x00dev->tx->limit value allows us to get rid >> of a superfluous pointer dereference. >> >> Signed-off-by: Gabor Juhos >> --- >> drivers/net/wireless/rt2x00/rt2x00dev.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c >> index 90dc143..b287467 100644 >> --- a/drivers/net/wireless/rt2x00/rt2x00dev.c >> +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c >> @@ -1077,7 +1077,7 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev) >> */ >> int kfifo_size = >> roundup_pow_of_two(rt2x00dev->ops->tx_queues * >> - rt2x00dev->ops->tx->entry_num * >> + rt2x00dev->tx->limit * >> sizeof(u32)); >> >> status = kfifo_alloc(&rt2x00dev->txstatus_fifo, kfifo_size, > > Unfortunately this does not work without your "get rid of > static data queue descriptors" series as well. > > queue->limit is set when rt2x00lib_start is called, not on > probe. kfifo_alloc will fail with EINVAL here. You are right. I should have been more careful while I have tested this patch-set. > As a result support for all rt2x00 devices is broken on wireless-testing. Only rt2800 devices are affected. The offending code runs only if REQUIRE_TXSTATUS_FIFO is set in rt2x00dev->cap_flags which is not set for older chips. > Maybe you can just post the mentioned series for inclusion? I will post a fix for the actual problem first, and will rebase the series on top of that. > I have been running with it since you posted it as RFC and > I did not notice any problems so far... Great! -Gabor