Commit 547b1ae5ec50 for kernel

commit 547b1ae5ec50b7d81b05b4219e0db7e56279d65f
Author: Colton Pawielski <colton.pawielski@gmail.com>
Date:   Sat Oct 31 11:47:23 2026 -0500

    net: 8139cp: keep Rx masked while NAPI is scheduled

    cp_rx_poll() calls napi_complete_done() and only then takes cp->lock
    with interrupts disabled to unmask the Rx interrupts. An interrupt
    that is not masked while polling (TxOK, TxErr, ...) can arrive in
    between. cp_interrupt() then sees the Rx status bits, which are still
    set, finds NAPI no longer scheduled, masks Rx and schedules NAPI again.
    cp_rx_poll() then carries on and unmasks Rx anyway.

    From that point Rx interrupts are enabled while NAPI is scheduled:
    cp_interrupt() leaves the Rx bits for the poll routine, does not mask
    them because napi_schedule_prep() fails, and the level-triggered
    interrupt fires again as soon as it returns. On an SH7751 LANDISK
    under combined Tx/Rx load this interrupt storm was captured with a RAM
    trace right before the board locked up hard.

    Mask Rx in cp_interrupt() whenever Rx status is pending, not only when
    NAPI gets scheduled. If the race leaves Rx unmasked, the next interrupt
    masks it again, and the pending poll unmasks it when it completes.

    Fixes: ab1e7e1d2666 ("8139cp: use napi_complete_done()")
    Signed-off-by: Colton Pawielski <colton.pawielski@gmail.com>
    Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
    Link: https://patch.msgid.link/20261031-b4-8139cp-napi-v2-1-5824797c0fe6@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c
index 9016527e229a..8f81dc7deef1 100644
--- a/drivers/net/ethernet/realtek/8139cp.c
+++ b/drivers/net/ethernet/realtek/8139cp.c
@@ -600,11 +600,11 @@ static irqreturn_t cp_interrupt (int irq, void *dev_instance)
 		goto out_unlock;
 	}

-	if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr))
-		if (napi_schedule_prep(&cp->napi)) {
-			cpw16_f(IntrMask, cp_norx_intr_mask);
+	if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr)) {
+		cpw16_f(IntrMask, cp_norx_intr_mask);
+		if (napi_schedule_prep(&cp->napi))
 			__napi_schedule(&cp->napi);
-		}
+	}

 	if (status & (TxOK | TxErr | TxEmpty | SWInt))
 		cp_tx(cp);