linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtl8xxxu: disable interrupt_in transfer for 8188cu and 8192cu
@ 2021-07-01 16:33 chris.chiu
  2021-07-02  8:41 ` Kalle Valo
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: chris.chiu @ 2021-07-01 16:33 UTC (permalink / raw)
  To: Jes.Sorensen, kvalo, davem, kuba, code
  Cc: linux-wireless, netdev, linux-kernel, Chris Chiu

From: Chris Chiu <chris.chiu@canonical.com>

There will be crazy numbers of interrupts triggered by 8188cu and
8192cu module, around 8000~10000 interrupts per second, on the usb
host controller. Compare with the vendor driver source code, it's
mapping to the configuration CONFIG_USB_INTERRUPT_IN_PIPE and it is
disabled by default.

Since the interrupt transfer is neither used for TX/RX nor H2C
commands. Disable it to avoid the confusing interrupts for the
8188cu and 8192cu module which I only have for verification.

Signed-off-by: Chris Chiu <chris.chiu@canonical.com>
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index 03c6ed7efe06..6a3dfa71b27f 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -1670,7 +1670,7 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
 			priv->rf_paths = 2;
 			priv->rx_paths = 2;
 			priv->tx_paths = 2;
-			priv->usb_interrupts = 1;
+			priv->usb_interrupts = 0;
 			priv->rtl_chip = RTL8192C;
 		}
 		priv->has_wifi = 1;
@@ -1680,7 +1680,7 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
 		priv->rx_paths = 1;
 		priv->tx_paths = 1;
 		priv->rtl_chip = RTL8188C;
-		priv->usb_interrupts = 1;
+		priv->usb_interrupts = 0;
 		priv->has_wifi = 1;
 	}
 
-- 
2.20.1


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

* Re: [PATCH] rtl8xxxu: disable interrupt_in transfer for 8188cu and 8192cu
  2021-07-01 16:33 [PATCH] rtl8xxxu: disable interrupt_in transfer for 8188cu and 8192cu chris.chiu
@ 2021-07-02  8:41 ` Kalle Valo
  2021-07-05  9:00   ` Chris Chiu
  2021-07-05  0:35 ` Reto Schneider
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2021-07-02  8:41 UTC (permalink / raw)
  To: chris.chiu
  Cc: Jes.Sorensen, davem, kuba, code, linux-wireless, netdev, linux-kernel

chris.chiu@canonical.com writes:

> From: Chris Chiu <chris.chiu@canonical.com>
>
> There will be crazy numbers of interrupts triggered by 8188cu and
> 8192cu module, around 8000~10000 interrupts per second, on the usb
> host controller. Compare with the vendor driver source code, it's
> mapping to the configuration CONFIG_USB_INTERRUPT_IN_PIPE and it is
> disabled by default.
>
> Since the interrupt transfer is neither used for TX/RX nor H2C
> commands. Disable it to avoid the confusing interrupts for the
> 8188cu and 8192cu module which I only have for verification.

The last paragraph is not entirely clear for me, can you elaborate it
more? What do you mean with "confusing interrupts"? And is this fixing
an actual user visible bug or are you just reducing the number of
interrupts?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

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

* Re: [PATCH] rtl8xxxu: disable interrupt_in transfer for 8188cu and 8192cu
  2021-07-01 16:33 [PATCH] rtl8xxxu: disable interrupt_in transfer for 8188cu and 8192cu chris.chiu
  2021-07-02  8:41 ` Kalle Valo
@ 2021-07-05  0:35 ` Reto Schneider
  2021-07-06 17:35 ` Jes Sorensen
  2021-08-21 18:17 ` Kalle Valo
  3 siblings, 0 replies; 6+ messages in thread
From: Reto Schneider @ 2021-07-05  0:35 UTC (permalink / raw)
  To: chris.chiu, Jes.Sorensen, kvalo, davem, kuba
  Cc: linux-wireless, netdev, linux-kernel

On 01.07.21 18:33, chris.chiu@canonical.com wrote:
> There will be crazy numbers of interrupts triggered by 8188cu and
> 8192cu module, around 8000~10000 interrupts per second, on the usb
> host controller. Compare with the vendor driver source code, it's
> mapping to the configuration CONFIG_USB_INTERRUPT_IN_PIPE and it is
> disabled by default.
> 
> Since the interrupt transfer is neither used for TX/RX nor H2C
> commands. Disable it to avoid the confusing interrupts for the
> 8188cu and 8192cu module which I only have for verification.

I tested the new code on the GARDENA smart gateway and it works as 
expected. Interrupts are greatly reduced while the same level of TX/RX 
performance could be measured as before the change: A (too) high 
percentage of retransmissions, but otherwise fine.

Tested-by: reto.schneider@husqvarnagroup.com

Kind regards,
Reto

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

* Re: [PATCH] rtl8xxxu: disable interrupt_in transfer for 8188cu and 8192cu
  2021-07-02  8:41 ` Kalle Valo
@ 2021-07-05  9:00   ` Chris Chiu
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Chiu @ 2021-07-05  9:00 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Jes.Sorensen, davem, kuba, code, linux-wireless, netdev, Linux Kernel

On Fri, Jul 2, 2021 at 4:42 PM Kalle Valo <kvalo@codeaurora.org> wrote:
>
> chris.chiu@canonical.com writes:
>
> > From: Chris Chiu <chris.chiu@canonical.com>
> >
> > There will be crazy numbers of interrupts triggered by 8188cu and
> > 8192cu module, around 8000~10000 interrupts per second, on the usb
> > host controller. Compare with the vendor driver source code, it's
> > mapping to the configuration CONFIG_USB_INTERRUPT_IN_PIPE and it is
> > disabled by default.
> >
> > Since the interrupt transfer is neither used for TX/RX nor H2C
> > commands. Disable it to avoid the confusing interrupts for the
> > 8188cu and 8192cu module which I only have for verification.
>
> The last paragraph is not entirely clear for me, can you elaborate it
> more? What do you mean with "confusing interrupts"? And is this fixing
> an actual user visible bug or are you just reducing the number of
> interrupts?
>
It's confusing because there are 8000~9000 interrupts per second even
though the association is not done yet and no traffic is pumped. It's
also way too many even the reception of the beacon frames triggers the
interrupt. This huge number overwhelms the normal interrupt we
expected from the register setting (only < 100/sec if runs with
rtlwif/rtl8192cu driver instead). It's difficult to judge where/why
the interrupts come from and what possible overhead it could possibly
incur.

> --
> https://patchwork.kernel.org/project/linux-wireless/list/
>
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

* Re: [PATCH] rtl8xxxu: disable interrupt_in transfer for 8188cu and 8192cu
  2021-07-01 16:33 [PATCH] rtl8xxxu: disable interrupt_in transfer for 8188cu and 8192cu chris.chiu
  2021-07-02  8:41 ` Kalle Valo
  2021-07-05  0:35 ` Reto Schneider
@ 2021-07-06 17:35 ` Jes Sorensen
  2021-08-21 18:17 ` Kalle Valo
  3 siblings, 0 replies; 6+ messages in thread
From: Jes Sorensen @ 2021-07-06 17:35 UTC (permalink / raw)
  To: chris.chiu, kvalo, davem, kuba, code; +Cc: linux-wireless, netdev, linux-kernel

On 7/1/21 12:33 PM, chris.chiu@canonical.com wrote:
> From: Chris Chiu <chris.chiu@canonical.com>
> 
> There will be crazy numbers of interrupts triggered by 8188cu and
> 8192cu module, around 8000~10000 interrupts per second, on the usb
> host controller. Compare with the vendor driver source code, it's
> mapping to the configuration CONFIG_USB_INTERRUPT_IN_PIPE and it is
> disabled by default.
> 
> Since the interrupt transfer is neither used for TX/RX nor H2C
> commands. Disable it to avoid the confusing interrupts for the
> 8188cu and 8192cu module which I only have for verification.
> 
> Signed-off-by: Chris Chiu <chris.chiu@canonical.com>

I remember noticing this earlier but never had a chance to dig into it.

Thanks for fixing this!

Acked-by: Jes Sorensen <Jes.Sorensen@gmail.com>

Jes


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

* Re: rtl8xxxu: disable interrupt_in transfer for 8188cu and 8192cu
  2021-07-01 16:33 [PATCH] rtl8xxxu: disable interrupt_in transfer for 8188cu and 8192cu chris.chiu
                   ` (2 preceding siblings ...)
  2021-07-06 17:35 ` Jes Sorensen
@ 2021-08-21 18:17 ` Kalle Valo
  3 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2021-08-21 18:17 UTC (permalink / raw)
  To: chris.chiu
  Cc: Jes.Sorensen, davem, kuba, code, linux-wireless, netdev,
	linux-kernel, Chris Chiu

chris.chiu@canonical.com wrote:

> From: Chris Chiu <chris.chiu@canonical.com>
> 
> There will be crazy numbers of interrupts triggered by 8188cu and
> 8192cu module, around 8000~10000 interrupts per second, on the usb
> host controller. Compare with the vendor driver source code, it's
> mapping to the configuration CONFIG_USB_INTERRUPT_IN_PIPE and it is
> disabled by default.
> 
> Since the interrupt transfer is neither used for TX/RX nor H2C
> commands. Disable it to avoid the excessive amount of interrupts
> for the 8188cu and 8192cu module which I only have for verification.
> 
> Signed-off-by: Chris Chiu <chris.chiu@canonical.com>
> Tested-by: reto.schneider@husqvarnagroup.com
> Acked-by: Jes Sorensen <Jes.Sorensen@gmail.com>

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

f62cdab7f5db rtl8xxxu: disable interrupt_in transfer for 8188cu and 8192cu

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210701163354.118403-1-chris.chiu@canonical.com/

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


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

end of thread, other threads:[~2021-08-21 18:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01 16:33 [PATCH] rtl8xxxu: disable interrupt_in transfer for 8188cu and 8192cu chris.chiu
2021-07-02  8:41 ` Kalle Valo
2021-07-05  9:00   ` Chris Chiu
2021-07-05  0:35 ` Reto Schneider
2021-07-06 17:35 ` Jes Sorensen
2021-08-21 18:17 ` Kalle Valo

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