linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mwifiex: Ignore BTCOEX events from the 88W8897 firmware
@ 2021-11-03 20:58 Jonas Dreßler
  2021-11-26 16:30 ` Kalle Valo
  2021-11-29 23:32 ` Bjorn Helgaas
  0 siblings, 2 replies; 5+ messages in thread
From: Jonas Dreßler @ 2021-11-03 20:58 UTC (permalink / raw)
  To: Amitkumar Karwar, Ganapathi Bhat, Xinming Hu, Kalle Valo,
	David S. Miller, Jakub Kicinski
  Cc: Jonas Dreßler, Tsuchiya Yuto, linux-wireless, netdev,
	linux-kernel, Maximilian Luz, Andy Shevchenko, Bjorn Helgaas,
	Pali Rohár

The firmware of the 88W8897 PCIe+USB card sends those events very
unreliably, sometimes bluetooth together with 2.4ghz-wifi is used and no
COEX event comes in, and sometimes bluetooth is disabled but the
coexistance mode doesn't get disabled.

This means we sometimes end up capping the rx/tx window size while
bluetooth is not enabled anymore, artifically limiting wifi speeds even
though bluetooth is not being used.

Since we can't fix the firmware, let's just ignore those events on the
88W8897 device. From some Wireshark capture sessions it seems that the
Windows driver also doesn't change the rx/tx window sizes when bluetooth
gets enabled or disabled, so this is fairly consistent with the Windows
driver.

Signed-off-by: Jonas Dreßler <verdre@v0yd.nl>
---
 drivers/net/wireless/marvell/mwifiex/main.h      | 2 ++
 drivers/net/wireless/marvell/mwifiex/pcie.c      | 3 +++
 drivers/net/wireless/marvell/mwifiex/sta_event.c | 3 +++
 3 files changed, 8 insertions(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
index 90012cbcfd15..486315691851 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.h
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
@@ -1055,6 +1055,8 @@ struct mwifiex_adapter {
 	void *devdump_data;
 	int devdump_len;
 	struct timer_list devdump_timer;
+
+	bool ignore_btcoex_events;
 };
 
 void mwifiex_process_tx_queue(struct mwifiex_adapter *adapter);
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index c3f5583ea70d..d5fb29400bad 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -3152,6 +3152,9 @@ static int mwifiex_init_pcie(struct mwifiex_adapter *adapter)
 	if (ret)
 		goto err_alloc_buffers;
 
+	if (pdev->device == PCIE_DEVICE_ID_MARVELL_88W8897)
+		adapter->ignore_btcoex_events = true;
+
 	return 0;
 
 err_alloc_buffers:
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_event.c b/drivers/net/wireless/marvell/mwifiex/sta_event.c
index 68c63268e2e6..80e5d44bad9d 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_event.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c
@@ -1058,6 +1058,9 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
 		break;
 	case EVENT_BT_COEX_WLAN_PARA_CHANGE:
 		dev_dbg(adapter->dev, "EVENT: BT coex wlan param update\n");
+		if (adapter->ignore_btcoex_events)
+			break;
+
 		mwifiex_bt_coex_wlan_param_update_event(priv,
 							adapter->event_skb);
 		break;
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mwifiex: Ignore BTCOEX events from the 88W8897 firmware
  2021-11-03 20:58 [PATCH] mwifiex: Ignore BTCOEX events from the 88W8897 firmware Jonas Dreßler
@ 2021-11-26 16:30 ` Kalle Valo
  2021-11-29 23:32 ` Bjorn Helgaas
  1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2021-11-26 16:30 UTC (permalink / raw)
  To: Jonas Dreßler
  Cc: Amitkumar Karwar, Ganapathi Bhat, Xinming Hu, David S. Miller,
	Jakub Kicinski, Jonas Dreßler, Tsuchiya Yuto,
	linux-wireless, netdev, linux-kernel, Maximilian Luz,
	Andy Shevchenko, Bjorn Helgaas, Pali Rohár

Jonas Dreßler <verdre@v0yd.nl> wrote:

> The firmware of the 88W8897 PCIe+USB card sends those events very
> unreliably, sometimes bluetooth together with 2.4ghz-wifi is used and no
> COEX event comes in, and sometimes bluetooth is disabled but the
> coexistance mode doesn't get disabled.
> 
> This means we sometimes end up capping the rx/tx window size while
> bluetooth is not enabled anymore, artifically limiting wifi speeds even
> though bluetooth is not being used.
> 
> Since we can't fix the firmware, let's just ignore those events on the
> 88W8897 device. From some Wireshark capture sessions it seems that the
> Windows driver also doesn't change the rx/tx window sizes when bluetooth
> gets enabled or disabled, so this is fairly consistent with the Windows
> driver.
> 
> Signed-off-by: Jonas Dreßler <verdre@v0yd.nl>

Patch applied to wireless-drivers-next.git, thanks.

84d94e16efa2 mwifiex: Ignore BTCOEX events from the 88W8897 firmware

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20211103205827.14559-1-verdre@v0yd.nl/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mwifiex: Ignore BTCOEX events from the 88W8897 firmware
  2021-11-03 20:58 [PATCH] mwifiex: Ignore BTCOEX events from the 88W8897 firmware Jonas Dreßler
  2021-11-26 16:30 ` Kalle Valo
@ 2021-11-29 23:32 ` Bjorn Helgaas
  2021-11-29 23:38   ` Bjorn Helgaas
  1 sibling, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2021-11-29 23:32 UTC (permalink / raw)
  To: Jonas Dreßler
  Cc: Amitkumar Karwar, Ganapathi Bhat, Xinming Hu, Kalle Valo,
	David S. Miller, Jakub Kicinski, Tsuchiya Yuto, linux-wireless,
	netdev, linux-kernel, Maximilian Luz, Andy Shevchenko,
	Bjorn Helgaas, Pali Rohár

On Wed, Nov 03, 2021 at 09:58:27PM +0100, Jonas Dreßler wrote:
> The firmware of the 88W8897 PCIe+USB card sends those events very
> unreliably, sometimes bluetooth together with 2.4ghz-wifi is used and no
> COEX event comes in, and sometimes bluetooth is disabled but the
> coexistance mode doesn't get disabled.

s/sends those events/sends BTCOEX events/ so it reads well without the
subject.

s/coexistance/coexistence/

Is BTCOEX a standard Bluetooth thing?  Is there a spec reference that
could be useful here?  I've never seen those specs, so this is just
curiosity.  I did download the "Bluetooth Core Spec v5.3", which does
have a "Wireless Coexistence Signaling and Interfaces" chapter, but
"BTCOEX" doesn't appear in that doc.

> This means we sometimes end up capping the rx/tx window size while
> bluetooth is not enabled anymore, artifically limiting wifi speeds even
> though bluetooth is not being used.

s/artifically/artificially/

> Since we can't fix the firmware, let's just ignore those events on the
> 88W8897 device. From some Wireshark capture sessions it seems that the
> Windows driver also doesn't change the rx/tx window sizes when bluetooth
> gets enabled or disabled, so this is fairly consistent with the Windows
> driver.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mwifiex: Ignore BTCOEX events from the 88W8897 firmware
  2021-11-29 23:32 ` Bjorn Helgaas
@ 2021-11-29 23:38   ` Bjorn Helgaas
  2021-11-30 10:15     ` Jonas Dreßler
  0 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2021-11-29 23:38 UTC (permalink / raw)
  To: Jonas Dreßler
  Cc: Amitkumar Karwar, Ganapathi Bhat, Xinming Hu, Kalle Valo,
	David S. Miller, Jakub Kicinski, Tsuchiya Yuto, linux-wireless,
	netdev, linux-kernel, Maximilian Luz, Andy Shevchenko,
	Bjorn Helgaas, Pali Rohár

On Mon, Nov 29, 2021 at 05:32:11PM -0600, Bjorn Helgaas wrote:
> On Wed, Nov 03, 2021 at 09:58:27PM +0100, Jonas Dreßler wrote:
> > The firmware of the 88W8897 PCIe+USB card sends those events very
> > unreliably, sometimes bluetooth together with 2.4ghz-wifi is used and no
> > COEX event comes in, and sometimes bluetooth is disabled but the
> > coexistance mode doesn't get disabled.
> 
> s/sends those events/sends BTCOEX events/ so it reads well without the
> subject.
> 
> s/coexistance/coexistence/
> 
> Is BTCOEX a standard Bluetooth thing?  Is there a spec reference that
> could be useful here?  I've never seen those specs, so this is just
> curiosity.  I did download the "Bluetooth Core Spec v5.3", which does
> have a "Wireless Coexistence Signaling and Interfaces" chapter, but
> "BTCOEX" doesn't appear in that doc.
> 
> > This means we sometimes end up capping the rx/tx window size while
> > bluetooth is not enabled anymore, artifically limiting wifi speeds even
> > though bluetooth is not being used.
> 
> s/artifically/artificially/
> 
> > Since we can't fix the firmware, let's just ignore those events on the
> > 88W8897 device. From some Wireshark capture sessions it seems that the
> > Windows driver also doesn't change the rx/tx window sizes when bluetooth
> > gets enabled or disabled, so this is fairly consistent with the Windows
> > driver.

I hadn't read far enough to see that the patch was already applied,
sorry for the noise :)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mwifiex: Ignore BTCOEX events from the 88W8897 firmware
  2021-11-29 23:38   ` Bjorn Helgaas
@ 2021-11-30 10:15     ` Jonas Dreßler
  0 siblings, 0 replies; 5+ messages in thread
From: Jonas Dreßler @ 2021-11-30 10:15 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Amitkumar Karwar, Ganapathi Bhat, Xinming Hu, Kalle Valo,
	David S. Miller, Jakub Kicinski, Tsuchiya Yuto, linux-wireless,
	netdev, linux-kernel, Maximilian Luz, Andy Shevchenko,
	Bjorn Helgaas, Pali Rohár

On 30.11.21 00:38, Bjorn Helgaas wrote:
> On Mon, Nov 29, 2021 at 05:32:11PM -0600, Bjorn Helgaas wrote:
>> On Wed, Nov 03, 2021 at 09:58:27PM +0100, Jonas Dreßler wrote:
>>> The firmware of the 88W8897 PCIe+USB card sends those events very
>>> unreliably, sometimes bluetooth together with 2.4ghz-wifi is used and no
>>> COEX event comes in, and sometimes bluetooth is disabled but the
>>> coexistance mode doesn't get disabled.
>>
>> s/sends those events/sends BTCOEX events/ so it reads well without the
>> subject.
>>
>> s/coexistance/coexistence/
>>
>> Is BTCOEX a standard Bluetooth thing?  Is there a spec reference that
>> could be useful here?  I've never seen those specs, so this is just
>> curiosity.  I did download the "Bluetooth Core Spec v5.3", which does
>> have a "Wireless Coexistence Signaling and Interfaces" chapter, but
>> "BTCOEX" doesn't appear in that doc.
>>
>>> This means we sometimes end up capping the rx/tx window size while
>>> bluetooth is not enabled anymore, artifically limiting wifi speeds even
>>> though bluetooth is not being used.
>>
>> s/artifically/artificially/
>>
>>> Since we can't fix the firmware, let's just ignore those events on the
>>> 88W8897 device. From some Wireshark capture sessions it seems that the
>>> Windows driver also doesn't change the rx/tx window sizes when bluetooth
>>> gets enabled or disabled, so this is fairly consistent with the Windows
>>> driver.
> 
> I hadn't read far enough to see that the patch was already applied,
> sorry for the noise :)
> 
No problem, in case you still want to know about BTCOEX:

 From what I've seen that's not something defined in any standards, but
it's usually the name of the (sometimes patented) tricks every manufacturer
has to make wifi and bt (which are both on the 2.4ghz band) behave well
together.

In almost every wifi driver you'll find functionality named
btcoex/coexist/coexistence. The way it usually works is that the card
sends an event to the kernel driver (in our case that event is called
BTCOEX), and then the driver decides which quirks to apply to make wifi
more interference-resistant (here's where the patents come in because
some of those quirks are quite tricky, see for example
https://patents.google.com/patent/US9226102B1/en).

Now with our Marvell card the firmware is buggy and sends those events
so unreliably (the card "forgets" to inform us that the BT connection
has ended) that we're better off ignoring them.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-30 10:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03 20:58 [PATCH] mwifiex: Ignore BTCOEX events from the 88W8897 firmware Jonas Dreßler
2021-11-26 16:30 ` Kalle Valo
2021-11-29 23:32 ` Bjorn Helgaas
2021-11-29 23:38   ` Bjorn Helgaas
2021-11-30 10:15     ` Jonas Dreßler

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).