From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796384487; b=ofZcnKRYJ9Fl36j+6MPsLKvfhwRjSu8oQ6E901gFEKCFPi2yQb6eMtkcafnmzRmB7iSt Ad+ipWBFuGF8YWx7rSkETpawwJU9aKznpVf1xUhVtQLhRH01dJTBHxZtk8HZur8jb/uhX unXy20JPsE0CN9zDXlso1BFKjJICMuIl21dRW1tqmKyaYLr1As/kqRmnldA6JSLEk/niC gpYf6Bm7bVDdPKNBkHRPSG2PA15bLPBqtstXS6igGwYc1xGdez6oc+fT04fpRrvqpqiiQ X7DbxINa7RE342XLc93pCfRavfUM4ovxR/6ybZcnfrhhYzZc56yAVY1s7D7iJdCclXg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384487; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=VyhG9JYaxcYU2+DWs/yKcvKGLuiVObH6F6pBnHBBPD4=; b=mWcz0jqlpbijmtHD2pm6tWOoPQNQyBmd1hNmS7G/YeDAylSeMzmeOcE3ga5SFJfgjjLm gbPtooXUpGbHa9X7zvZ4eb/zIO+F6imlZ+MWQWnCqN3AxrX5gfq7dXAQOa8JnGI6wOv66 D6OoUkkMChsJ6ZiAR9ukpWNvzv0ML0hLFBOGmoACKNjj7rfM0VJZHmDEDWjdR88oqXUwo x0Oz3gQYBNKHenOfgAfqbzqvjtC1W8k9uUkndKUAYOGQa8W/PrgobYKYTE3OSdYWt90H8 x1FTOkjXssyNDx/DpiamrOHnHo7Wp/BtM34anVbz0OtYthjaKMUwpPDjWoXeRrX5HHQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="KcH/o+9N"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0DAF606A32C; Fri, 4 Dec 2026 11:41:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=KcH/o+9N Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34B641F000C2; Fri, 4 Dec 2026 11:41:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384487; bh=VyhG9JYaxcYU2+DWs/yKcvKGLuiVObH6F6pBnHBBPD4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KcH/o+9NmEbJVe72HQvH6urZRHeI2z5WFbmBxEBqw6reG4FmmnKeEIgmWujljHhYD 0D206VZOFiKD50ONUYCDuv4+wyWFLWLqN/gSQ8Jm15cTvrnvZ+R8J9YpeX7euqDFbC 7fIqxIlHZKT9otmks99wSSal0XLL5pbGV/yaKmls= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Colton Pawielski , Daniel Machon , Paolo Abeni , Sasha Levin Subject: [PATCH 6.6 0171/1167] net: 8139cp: keep Rx masked while NAPI is scheduled Date: Fri, 4 Dec 2026 18:53:18 +0900 Message-ID: <20261204100706.531337063@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Colton Pawielski [ Upstream commit 547b1ae5ec50b7d81b05b4219e0db7e56279d65f ] 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 Reviewed-by: Daniel Machon Link: https://patch.msgid.link/20261031-b4-8139cp-napi-v2-1-5824797c0fe6@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/realtek/8139cp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c index 4091762275d6a..4b70a95567e45 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); -- 2.53.0