[wireless,3/5] wifi: b43: Stop/wake correct queue in PIO Tx path when QoS is disabled
Message ID | 20231230045105.91351-4-sergeantsagara@protonmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-13331-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp2930732dyb; Fri, 29 Dec 2023 20:53:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFHZuTPhU3XrXko0xGF/5e+3qCz2N4FjL5JK7P7XhBF/Xj34OFpK1CL2TOfTYEfjo7+xjkE X-Received: by 2002:a05:6358:7f02:b0:174:e99d:ebcc with SMTP id p2-20020a0563587f0200b00174e99debccmr11897651rwn.10.1703912002948; Fri, 29 Dec 2023 20:53:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703912002; cv=none; d=google.com; s=arc-20160816; b=pyKlOOqgjEo7R2Q2NXwtWMgoGp8h+s1SFFQz3vpye2Omw6c/avYsewmFyRux2lfixs lB4FTCWq1olFuasQlj0MIPT21/WvmHVWWjZyES3hakbM8P3W1j44ULP4MkHh3irHenYr XFgmWBZ77Thq4xh3Pd8DIWDITFvpGYREVnTaV2RVtmVR6Vj2xaWVnfOyIsO2N/xfxcXi zFrx7vv4ORd2/YUzvVOn/TqcJ1rMYtbbH/V8p7jHxyuZNoOwQ7Ey5jqe3afJBCToAUYa UbwZFMRNzyFEgsI0xkDxHa+BqfA8gDtZ9fl0SlVYAkraFO27NiWLU1KDfjOxhvp7ThKK 3oNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=caRSz9JKsn3mBdUsKSY4AOfcZFf54zv3YQQgaKNP9h8=; fh=+21FHHkXcWPzhlDv3RJju/ybCufC5jSccWkxzweibX0=; b=KxQFOzVefMdnd/sRFAQbKmXh6MwkRSYrN8KBqf2e2PHF2e+ou6XlMYrMd1nzRnSnnN vE6AEcIegwbC8MN6P0xMX9OFqpaM3fqWCrna/+rGrGn0GHfxgBCd9ggVTdmyKVw9fZpC SARKTATqYz1vaQwv4rS85LOIfn15Sfd9/RmPFsQFzgumIUyM4S8KVaJjxUImghpK0jJL RcXPts7Nitio3d87ELwOUqGiq2TE6VqpIaqSSd4m1cMu6d3Lws7f1ifJdp3HZ5UOSWBN ETzdT2uKaHSr+4balG9c0t/okk+2TYcdy6PTv9qhjY5fWao5tou28KeQIaNkMDxkhT+K tcDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=njDNIiTL; spf=pass (google.com: domain of linux-kernel+bounces-13331-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13331-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id jk24-20020a170903331800b001d4a6ce115bsi973130plb.53.2023.12.29.20.53.22 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 20:53:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13331-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=njDNIiTL; spf=pass (google.com: domain of linux-kernel+bounces-13331-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13331-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A0070B221AC for <ouuuleilei@gmail.com>; Sat, 30 Dec 2023 04:53:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D2C341FC5; Sat, 30 Dec 2023 04:52:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="njDNIiTL" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC792187E; Sat, 30 Dec 2023 04:51:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=protonmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1703911916; x=1704171116; bh=caRSz9JKsn3mBdUsKSY4AOfcZFf54zv3YQQgaKNP9h8=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=njDNIiTL3IF6x3x/pXq0Ry8quqaGuG+CzH54ahHsfyz+W9qccrydDwGbmqrzrCiXb sqqjDsPkSodTUlwTgtcdPPGNbJrE9btj76ixqdc1ueE8oAiKqZmfCDvpsApMDQ8SIr qY3kJpQ1H3auM0Q4I11P/ro6ivWXDDREHKOjhfLNxCCyfiLBxt4zs9M7TW1sK+hA9+ nbNckCWKvkDxJtTd61NfF16H77lrJRY9s4D3nv83TCFJ9Qv+jomqj5cxVQICc/3O2w sCVU66WXaT+qO4m+PXOrw9D8sUWiWn5fRgY9rDhBQkVmMXDVBJCimasNFRzENUls95 mIhtexoqM3YLQ== Date: Sat, 30 Dec 2023 04:51:40 +0000 To: Kalle Valo <kvalo@kernel.org> From: Rahul Rameshbabu <sergeantsagara@protonmail.com> Cc: linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org, linux-kernel@vger.kernel.org, Rahul Rameshbabu <sergeantsagara@protonmail.com> Subject: [PATCH wireless 3/5] wifi: b43: Stop/wake correct queue in PIO Tx path when QoS is disabled Message-ID: <20231230045105.91351-4-sergeantsagara@protonmail.com> In-Reply-To: <20231230045105.91351-1-sergeantsagara@protonmail.com> References: <20231230045105.91351-1-sergeantsagara@protonmail.com> Feedback-ID: 26003777:user:proton Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786681232514423299 X-GMAIL-MSGID: 1786681232514423299 |
Series |
wifi: b43: Various QoS-related fixes
|
|
Commit Message
Rahul Rameshbabu
Dec. 30, 2023, 4:51 a.m. UTC
When QoS is disabled, the queue priority value will not map to the correct
ieee80211 queue since there is only one queue. Stop/wake queue 0 when QoS
is disabled to prevent trying to stop/wake a non-existent queue and failing
to stop/wake the actual queue instantiated.
Fixes: 5100d5ac81b9 ("b43: Add PIO support for PCMCIA devices")
Signed-off-by: Rahul Rameshbabu <sergeantsagara@protonmail.com>
---
drivers/net/wireless/broadcom/b43/pio.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
Comments
On 12/29/23 22:51, Rahul Rameshbabu wrote: > + if (dev->qos_enabled) > + ieee80211_stop_queue(dev->wl->hw, > + skb_get_queue_mapping(skb)); > + else > + ieee80211_stop_queue(dev->wl->hw, 0); This code sequence occurs in several places. Would it be better to put this in a routine specific to b43, thus it would only be used once? We certainly could try extracting firmware from a newer binary. Any suggestions? Larry
On Sat, 30 Dec, 2023 12:04:02 -0600 "Larry Finger" <Larry.Finger@lwfinger.net> wrote: > On 12/29/23 22:51, Rahul Rameshbabu wrote: >> + if (dev->qos_enabled) >> + ieee80211_stop_queue(dev->wl->hw, >> + skb_get_queue_mapping(skb)); >> + else >> + ieee80211_stop_queue(dev->wl->hw, 0); > > This code sequence occurs in several places. Would it be better to put this in a > routine specific to b43, thus it would only be used once? Right, I am waiting to converge on the discussion in the second patch in this series before making this refactor, but I agree that this pattern is prevelant and should be refactored if this is the approach taken. > > We certainly could try extracting firmware from a newer binary. Any suggestions? Unfortunately, new firmware would not prevent the need to fix up the code with regards to QoS being disabled via the kernel parameter or using OpenFW. That said, new firmware could help us drop the fifth patch in this series. I am thinking about using b43-fwcutter to extract proprietary fw from a newer release of broadcom-wl to see if that makes a difference. That said, I am a bit puzzled since the device I am testing on released in early 2011, and I used firmware released in late 2012. -- Thanks, Rahul Rameshbabu
On 12/30/23 13:43, Rahul Rameshbabu wrote: > Unfortunately, new firmware would not prevent the need to fix up the > code with regards to QoS being disabled via the kernel parameter or > using OpenFW. That said, new firmware could help us drop the fifth patch > in this series. I am thinking about using b43-fwcutter to extract > proprietary fw from a newer release of broadcom-wl to see if that makes > a difference. That said, I am a bit puzzled since the device I am > testing on released in early 2011, and I used firmware released in late > 2012. Unfortunately, it is very difficult to get the parameters for fwcutter from an x86 binary. Some of the other architectures are easier. Larry
On Sat, 30 Dec, 2023 16:23:58 -0600 "Larry Finger" <Larry.Finger@lwfinger.net> wrote: > On 12/30/23 13:43, Rahul Rameshbabu wrote: >> Unfortunately, new firmware would not prevent the need to fix up the >> code with regards to QoS being disabled via the kernel parameter or >> using OpenFW. That said, new firmware could help us drop the fifth patch >> in this series. I am thinking about using b43-fwcutter to extract >> proprietary fw from a newer release of broadcom-wl to see if that makes >> a difference. That said, I am a bit puzzled since the device I am >> testing on released in early 2011, and I used firmware released in late >> 2012. > > Unfortunately, it is very difficult to get the parameters for fwcutter from an > x86 binary. Some of the other architectures are easier. Just tried this with the x86 binary just because and ran into extraction issues as expected. I could not find other architecture options from Broadcom's download page, but I may not have been looking well enough... ❯ b43-fwcutter ./wlc_hybrid.o_shipped Sorry, the input file is either wrong or not supported by b43-fwcutter. This file has an unknown MD5sum 6889dbd24abf8006de5cc6eddd138518. https://www.broadcom.com/support/download-search?pg=Wireless+Embedded+Solutions+and+RF+Components&pf=Legacy+Wireless&pn=&pa=Driver&po=&dk=BCM4331&pl=&l=true I guess, for now, we can keep the exception for bcm4331 and see if future firmware extractions help. -- Thanks, Rahul Rameshbabu
On Sun, 31 Dec 2023 00:02:32 +0000 Rahul Rameshbabu <sergeantsagara@protonmail.com> wrote: > > Unfortunately, it is very difficult to get the parameters for fwcutter from an > > x86 binary. Some of the other architectures are easier. > > Just tried this with the x86 binary just because and ran into extraction > issues as expected. I could not find other architecture options from > Broadcom's download page, but I may not have been looking well enough... > > ❯ b43-fwcutter ./wlc_hybrid.o_shipped > Sorry, the input file is either wrong or not supported by b43-fwcutter. > This file has an unknown MD5sum 6889dbd24abf8006de5cc6eddd138518. b43-fwcutter works only on known files. It has a table of hashes of these files. But there is a script that can be used to create a hash table entry for a .o file: https://bues.ch/cgit/b43-tools.git/plain/fwcutter/mklist.py This probably doesn't work on x86 binaries, though. But maybe by reading the script you can get an idea how this works.
On Sun, 31 Dec, 2023 10:33:02 +0100 Michael Büsch <m@bues.ch> wrote: > [[PGP Signed Part:Undecided]] > On Sun, 31 Dec 2023 00:02:32 +0000 > Rahul Rameshbabu <sergeantsagara@protonmail.com> wrote: > >> > Unfortunately, it is very difficult to get the parameters for fwcutter from an >> > x86 binary. Some of the other architectures are easier. >> >> Just tried this with the x86 binary just because and ran into extraction >> issues as expected. I could not find other architecture options from >> Broadcom's download page, but I may not have been looking well enough... >> >> ❯ b43-fwcutter ./wlc_hybrid.o_shipped >> Sorry, the input file is either wrong or not supported by b43-fwcutter. >> This file has an unknown MD5sum 6889dbd24abf8006de5cc6eddd138518. > > b43-fwcutter works only on known files. It has a table of hashes of these files. > > But there is a script that can be used to create a hash table entry for a .o file: > https://bues.ch/cgit/b43-tools.git/plain/fwcutter/mklist.py > > This probably doesn't work on x86 binaries, though. > But maybe by reading the script you can get an idea how this works. Thanks for the pointer. I will take a look and follow up with you and Larry with the b43-dev mailing list CCed. If we can get QoS working on bcm4331, then I can send a revert for the disablement patch. -- Thanks, Rahul Rameshbabu
diff --git a/drivers/net/wireless/broadcom/b43/pio.c b/drivers/net/wireless/broadcom/b43/pio.c index 0cf70fdb60a6..7168fe50af5b 100644 --- a/drivers/net/wireless/broadcom/b43/pio.c +++ b/drivers/net/wireless/broadcom/b43/pio.c @@ -525,7 +525,11 @@ int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb) if (total_len > (q->buffer_size - q->buffer_used)) { /* Not enough memory on the queue. */ err = -EBUSY; - ieee80211_stop_queue(dev->wl->hw, skb_get_queue_mapping(skb)); + if (dev->qos_enabled) + ieee80211_stop_queue(dev->wl->hw, + skb_get_queue_mapping(skb)); + else + ieee80211_stop_queue(dev->wl->hw, 0); q->stopped = true; goto out; } @@ -552,7 +556,11 @@ int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb) if (((q->buffer_size - q->buffer_used) < roundup(2 + 2 + 6, 4)) || (q->free_packet_slots == 0)) { /* The queue is full. */ - ieee80211_stop_queue(dev->wl->hw, skb_get_queue_mapping(skb)); + if (dev->qos_enabled) + ieee80211_stop_queue(dev->wl->hw, + skb_get_queue_mapping(skb)); + else + ieee80211_stop_queue(dev->wl->hw, 0); q->stopped = true; } @@ -587,7 +595,10 @@ void b43_pio_handle_txstatus(struct b43_wldev *dev, list_add(&pack->list, &q->packets_list); if (q->stopped) { - ieee80211_wake_queue(dev->wl->hw, q->queue_prio); + if (dev->qos_enabled) + ieee80211_wake_queue(dev->wl->hw, q->queue_prio); + else + ieee80211_wake_queue(dev->wl->hw, 0); q->stopped = false; } }