From: "Pandey, Radhey Shyam" <radheys@amd.com>
To: Kusuma Vasana <kusuma.vasana@amd.com>,
radhey.shyam.pandey@amd.com, andrew+netdev@lunn.ch,
davem@davemloft.net, dumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, michal.simek@amd.com, Suraj.Gupta2@amd.com
Cc: git@amd.com, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: axienet: Clear stale AXI DMA TX/RX status before re-enabling interrupts
Date: Wed, 15 Jul 2026 18:38:52 +0530 [thread overview]
Message-ID: <2c6bba39-58b7-47ed-879d-235ab23ef6ae@amd.com> (raw)
In-Reply-To: <20260715125028.2104305-1-kusuma.vasana@amd.com>
On 7/15/2026 6:20 PM, Kusuma Vasana wrote:
designate your patch to a tree - [PATCH net] or [PATCH net-next]
https://docs.kernel.org/process/maintainer-netdev.html
also keep all list in cc from get_maintainer.pl.
> The AXI DMA interrupt line is level-sensitive: it asserts whenever
> the IOC (XAXIDMA_IRQ_IOC_MASK) or DELAY (XAXIDMA_IRQ_DELAY_MASK) bits
> in the status register (XAXIDMA_TX_SR_OFFSET / XAXIDMA_RX_SR_OFFSET)
> are set and their corresponding enable bits in the control register
> are active.
>
> During TX/RX, interrupts are disabled in the control register while
> NAPI runs. Completions arriving in this window cause hardware to latch
> IOC/DELAY into the status register regardless of the control register
> mask state. After NAPI completion, re-enabling interrupts immediately
> re-asserts the IRQ line due to these stale status register bits, even
> when no new work is pending.
>
> This results in a stale interrupt and redundant NAPI poll cycle with
> no new work pending, causing unnecessary CPU processing.
>
> In the initial driver, the status register was cleared after polling
> all packets, which naturally consumed any status accumulated during
> processing. When the driver was converted to NAPI, status register
> clearing was moved to the ISR before polling begins, leaving no
> mechanism to clear status bits that arrive during the NAPI poll window.
> Fix the same.
rephrase - fix the same.
Once addressed- feel free to add:
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Thanks!
>
> Signed-off-by: Kusuma Vasana <kusuma.vasana@amd.com>
> ---
> drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index fcf517069d16..29050c8d04e2 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -1018,6 +1018,13 @@ static int axienet_tx_poll(struct napi_struct *napi, int budget)
> netif_wake_queue(ndev);
> }
>
> + /* Clear stale IOC/DELAY bits that may have latched during the
> + * poll window to prevent a stale interrupt when there is no
> + * work pending.
> + */
> + axienet_dma_out32(lp, XAXIDMA_TX_SR_OFFSET,
> + XAXIDMA_IRQ_IOC_MASK | XAXIDMA_IRQ_DELAY_MASK);
> +
> if (packets < budget && napi_complete_done(napi, packets)) {
> /* Re-enable TX completion interrupts. This should
> * cause an immediate interrupt if any TX packets are
> @@ -1293,6 +1300,13 @@ static int axienet_rx_poll(struct napi_struct *napi, int budget)
> cur_p = &lp->rx_bd_v[lp->rx_bd_ci];
> }
>
> + /* Clear stale IOC/DELAY bits that may have latched during the
> + * poll window to prevent a stale interrupt when there is no
> + * work pending.
> + */
> + axienet_dma_out32(lp, XAXIDMA_RX_SR_OFFSET,
> + XAXIDMA_IRQ_IOC_MASK | XAXIDMA_IRQ_DELAY_MASK);
> +
> u64_stats_update_begin(&lp->rx_stat_sync);
> u64_stats_add(&lp->rx_packets, packets);
> u64_stats_add(&lp->rx_bytes, size);
prev parent reply other threads:[~2026-07-15 13:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 12:50 Kusuma Vasana
2026-07-15 13:08 ` Pandey, Radhey Shyam [this message]
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=2c6bba39-58b7-47ed-879d-235ab23ef6ae@amd.com \
--to=radheys@amd.com \
--cc=Suraj.Gupta2@amd.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=dumazet@google.com \
--cc=git@amd.com \
--cc=kuba@kernel.org \
--cc=kusuma.vasana@amd.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=pabeni@redhat.com \
--cc=radhey.shyam.pandey@amd.com \
/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
all inboxes | Powered by JetHome®