From: Simon Horman <horms@kernel.org>
To: Ronald Wahl <rwahl@gmx.de>
Cc: Ronald Wahl <ronald.wahl@raritan.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] net: ks8851: Fix another TX stall caused by wrong ISR flag handling
Date: Tue, 14 May 2024 11:02:13 +0100 [thread overview]
Message-ID: <20240514100213.GA2787@kernel.org> (raw)
In-Reply-To: <20240513143922.1330122-1-rwahl@gmx.de>
On Mon, May 13, 2024 at 04:39:22PM +0200, Ronald Wahl wrote:
> From: Ronald Wahl <ronald.wahl@raritan.com>
>
> Under some circumstances it may happen that the ks8851 Ethernet driver
> stops sending data.
>
> Currently the interrupt handler resets the interrupt status flags in the
> hardware after handling TX. With this approach we may lose interrupts in
> the time window between handling the TX interrupt and resetting the TX
> interrupt status bit.
>
> When all of the three following conditions are true then transmitting
> data stops:
>
> - TX queue is stopped to wait for room in the hardware TX buffer
> - no queued SKBs in the driver (txq) that wait for being written to hw
> - hardware TX buffer is empty and the last TX interrupt was lost
>
> This is because reenabling the TX queue happens when handling the TX
> interrupt status but if the TX status bit has already been cleared then
> this interrupt will never come.
>
> With this commit the interrupt status flags will be cleared before they
> are handled. That way we stop losing interrupts.
>
> The wrong handling of the ISR flags was there from the beginning but
> with commit 3dc5d4454545 ("net: ks8851: Fix TX stall caused by TX
> buffer overrun") the issue becomes apparent.
>
> Fixes: 3dc5d4454545 ("net: ks8851: Fix TX stall caused by TX buffer overrun")
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Cc: Simon Horman <horms@kernel.org>
> Cc: netdev@vger.kernel.org
> Cc: stable@vger.kernel.org # 5.10+
> Signed-off-by: Ronald Wahl <ronald.wahl@raritan.com>
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2024-05-14 10:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-13 14:39 [PATCH] net: ks8851: Fix another TX stall caused by wrong ISR flag handling Ronald Wahl
2024-05-14 10:02 ` Simon Horman [this message]
2024-05-17 19:14 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240514100213.GA2787@kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ronald.wahl@raritan.com \
--cc=rwahl@gmx.de \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).