diff mbox series

[net] net: lantiq: disable interrupt before sheduling NAPI

Message ID 20210608212107.222690-1-olek2@wp.pl (mailing list archive)
State Accepted
Commit f2386cf7c5f4ff5d7b584f5d92014edd7df6c676
Delegated to: Netdev Maintainers
Headers show
Series [net] net: lantiq: disable interrupt before sheduling NAPI | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Aleksander Jan Bajkowski June 8, 2021, 9:21 p.m. UTC
This patch fixes TX hangs with threaded NAPI enabled. The scheduled
NAPI seems to be executed in parallel with the interrupt on second
thread. Sometimes it happens that ltq_dma_disable_irq() is executed
after xrx200_tx_housekeeping(). The symptom is that TX interrupts
are disabled in the DMA controller. As a result, the TX hangs after
a few seconds of the iperf test. Scheduling NAPI after disabling
interrupts fixes this issue.

Tested on Lantiq xRX200 (BT Home Hub 5A).

Fixes: 9423361da523 ("net: lantiq: Disable IRQs only if NAPI gets scheduled ")
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
---
 drivers/net/ethernet/lantiq_xrx200.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hauke Mehrtens June 8, 2021, 9:33 p.m. UTC | #1
On 6/8/21 11:21 PM, Aleksander Jan Bajkowski wrote:
> This patch fixes TX hangs with threaded NAPI enabled. The scheduled
> NAPI seems to be executed in parallel with the interrupt on second
> thread. Sometimes it happens that ltq_dma_disable_irq() is executed
> after xrx200_tx_housekeeping(). The symptom is that TX interrupts
> are disabled in the DMA controller. As a result, the TX hangs after
> a few seconds of the iperf test. Scheduling NAPI after disabling
> interrupts fixes this issue.
> 
> Tested on Lantiq xRX200 (BT Home Hub 5A).
> 
> Fixes: 9423361da523 ("net: lantiq: Disable IRQs only if NAPI gets scheduled ")
> Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>

Acked-by: Hauke Mehrtens <hauke@hauke-m.de>

> ---
>   drivers/net/ethernet/lantiq_xrx200.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c
> index 36dc3e5f6218..0e10d8aeffe1 100644
> --- a/drivers/net/ethernet/lantiq_xrx200.c
> +++ b/drivers/net/ethernet/lantiq_xrx200.c
> @@ -352,8 +352,8 @@ static irqreturn_t xrx200_dma_irq(int irq, void *ptr)
>   	struct xrx200_chan *ch = ptr;
>   
>   	if (napi_schedule_prep(&ch->napi)) {
> -		__napi_schedule(&ch->napi);
>   		ltq_dma_disable_irq(&ch->dma);
> +		__napi_schedule(&ch->napi);
>   	}
>   
>   	ltq_dma_ack_irq(&ch->dma);
>
patchwork-bot+netdevbpf@kernel.org June 9, 2021, 2:20 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Tue,  8 Jun 2021 23:21:07 +0200 you wrote:
> This patch fixes TX hangs with threaded NAPI enabled. The scheduled
> NAPI seems to be executed in parallel with the interrupt on second
> thread. Sometimes it happens that ltq_dma_disable_irq() is executed
> after xrx200_tx_housekeeping(). The symptom is that TX interrupts
> are disabled in the DMA controller. As a result, the TX hangs after
> a few seconds of the iperf test. Scheduling NAPI after disabling
> interrupts fixes this issue.
> 
> [...]

Here is the summary with links:
  - [net] net: lantiq: disable interrupt before sheduling NAPI
    https://git.kernel.org/netdev/net/c/f2386cf7c5f4

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c
index 36dc3e5f6218..0e10d8aeffe1 100644
--- a/drivers/net/ethernet/lantiq_xrx200.c
+++ b/drivers/net/ethernet/lantiq_xrx200.c
@@ -352,8 +352,8 @@  static irqreturn_t xrx200_dma_irq(int irq, void *ptr)
 	struct xrx200_chan *ch = ptr;
 
 	if (napi_schedule_prep(&ch->napi)) {
-		__napi_schedule(&ch->napi);
 		ltq_dma_disable_irq(&ch->dma);
+		__napi_schedule(&ch->napi);
 	}
 
 	ltq_dma_ack_irq(&ch->dma);