netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] 8139cp: fix Rx and Tx not being disabled in cp_suspend
@ 2026-08-17  4:30 Karl Mehltretter
  2026-08-17 15:11 ` Andrew Lunn
  2026-08-18 10:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Karl Mehltretter @ 2026-08-17  4:30 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: Karl Mehltretter, netdev, linux-kernel

On QEMU rtl8139 model, frames that arrive while the interface is
suspended still end up in the stack after resume. With pm_test=devices,
which keeps devices suspended for 5s, 200 frames sent to interface
during that time and 50 frames after resume, eth0 reports 113
received frames.

cp_suspend() is supposed to stop receiver and the transmitter, but
the mask is wrong: (~RxOn | ~TxOn) is ~0, nothing is cleared and Cmd
still reads 0x0d when cp_suspend() returns.

Use ~(RxOn | TxOn) so both bits are actually cleared.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
 drivers/net/ethernet/realtek/8139cp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c
index 5652da8a178c0..9016527e229ac 100644
--- a/drivers/net/ethernet/realtek/8139cp.c
+++ b/drivers/net/ethernet/realtek/8139cp.c
@@ -2066,7 +2066,7 @@ static int __maybe_unused cp_suspend(struct device *device)
 
 	/* Disable Rx and Tx */
 	cpw16 (IntrMask, 0);
-	cpw8  (Cmd, cpr8 (Cmd) & (~RxOn | ~TxOn));
+	cpw8  (Cmd, cpr8 (Cmd) & ~(RxOn | TxOn));
 
 	spin_unlock_irqrestore (&cp->lock, flags);
 

base-commit: 3eb40771c00a8488fa6ed2cc1fe203477908bf38
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] 8139cp: fix Rx and Tx not being disabled in cp_suspend
  2026-08-17  4:30 [PATCH net] 8139cp: fix Rx and Tx not being disabled in cp_suspend Karl Mehltretter
@ 2026-08-17 15:11 ` Andrew Lunn
  2026-08-18 10:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2026-08-17 15:11 UTC (permalink / raw)
  To: Karl Mehltretter
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

On Mon, Aug 17, 2026 at 06:30:57AM +0200, Karl Mehltretter wrote:
> On QEMU rtl8139 model, frames that arrive while the interface is
> suspended still end up in the stack after resume. With pm_test=devices,
> which keeps devices suspended for 5s, 200 frames sent to interface
> during that time and 50 frames after resume, eth0 reports 113
> received frames.
> 
> cp_suspend() is supposed to stop receiver and the transmitter, but
> the mask is wrong: (~RxOn | ~TxOn) is ~0, nothing is cleared and Cmd
> still reads 0x0d when cp_suspend() returns.
> 
> Use ~(RxOn | TxOn) so both bits are actually cleared.
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] 8139cp: fix Rx and Tx not being disabled in cp_suspend
  2026-08-17  4:30 [PATCH net] 8139cp: fix Rx and Tx not being disabled in cp_suspend Karl Mehltretter
  2026-08-17 15:11 ` Andrew Lunn
@ 2026-08-18 10:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-08-18 10:10 UTC (permalink / raw)
  To: Karl Mehltretter
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Mon, 17 Aug 2026 06:30:57 +0200 you wrote:
> On QEMU rtl8139 model, frames that arrive while the interface is
> suspended still end up in the stack after resume. With pm_test=devices,
> which keeps devices suspended for 5s, 200 frames sent to interface
> during that time and 50 frames after resume, eth0 reports 113
> received frames.
> 
> cp_suspend() is supposed to stop receiver and the transmitter, but
> the mask is wrong: (~RxOn | ~TxOn) is ~0, nothing is cleared and Cmd
> still reads 0x0d when cp_suspend() returns.
> 
> [...]

Here is the summary with links:
  - [net] 8139cp: fix Rx and Tx not being disabled in cp_suspend
    https://git.kernel.org/netdev/net/c/cb7643b78d35

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-18 10:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-17  4:30 [PATCH net] 8139cp: fix Rx and Tx not being disabled in cp_suspend Karl Mehltretter
2026-08-17 15:11 ` Andrew Lunn
2026-08-18 10:10 ` patchwork-bot+netdevbpf

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 NNTP newsgroup(s).