Subject: WARNING: CPU: 1 PID: 1 at net/core/netpoll.c:370 netpoll_send_skb+0x1fc/0x20c at boot when netconsole is enabled (kernel v6.9-rc5, v6.8.7, sungem, PowerMac G4 DP)

From: Erhard Furtner <[email-masked]>
Date: Sun, 28 Apr 2024 12:53:06 +0200

Greetings!

With netconsole enabled I get this "WARNING: CPU: 1 PID: 1 at net/core/netpoll.c:370 netpoll_send_skb+0x1fc/0x20c" and "WARNING: CPU: 1 PID: 1 at kernel/locking/irqflag-debug.c:10 warn_bogus_irq_restore+0x30/0x44" at boot on my PowerMac G4 DP. Happens more often than not (6-7 out of 10 times booting):

[...]
netpoll: netconsole: local port 6666
netpoll: netconsole: local IPv4 address 192.168.2.8
netpoll: netconsole: interface 'eth0'
netpoll: netconsole: remote port 6666
netpoll: netconsole: remote IPv4 address 192.168.2.3
netpoll: netconsole: remote ethernet address a8:a1:59:16:4f:ea
netpoll: netconsole: device eth0 not up yet, forcing it
gem 0002:00:0f.0 eth0: Found BCM5421 PHY
gem 0002:00:0f.0 eth0: Link is up at 1000 Mbps, full-duplex
gem 0002:00:0f.0 eth0: Pause is enabled (rxfifo: 10240 off: 7168 on: 5632)
printk: legacy console [netcon0] enabled
------------[ cut here ]------------
netpoll_send_skb_on_dev(): eth0 enabled interrupts in poll (gem_start_xmit+0x0/0x398)
WARNING: CPU: 1 PID: 1 at net/core/netpoll.c:370 netpoll_send_skb+0x1fc/0x20c
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.9.0-rc5-PMacG4 #4
Hardware name: PowerMac3,6 7455 0x80010303 PowerMac
NIP:  c0699828 LR: c0699828 CTR: 00000000
REGS: f1021b30 TRAP: 0700   Not tainted  (6.9.0-rc5-PMacG4)
MSR:  00029032 <EE,ME,IR,DR,RI>  CR: 24004222  XER: 00000000

GPR00: c0699828 f1021bf0 c1180ba0 00000055 000001d6 f1021a24 f1021a18 00000000 
GPR08: 2e078000 00000027 00000027 f1021bf0 28004222 00000000 00000000 00000000 
GPR16: 00000000 00009032 c0df6022 c0df6022 00000000 00000001 c1df8f8c c0da8058 
GPR24: 00000000 00001032 c1eae680 c1df8f8c 00000041 c22b3640 c10dcb00 c1f69000 
NIP [c0699828] netpoll_send_skb+0x1fc/0x20c
LR [c0699828] netpoll_send_skb+0x1fc/0x20c
Call Trace:
[f1021bf0] [c0699828] netpoll_send_skb+0x1fc/0x20c (unreliable)
[f1021c20] [c05b6790] write_msg+0x10c/0x120
[f1021c60] [c0094d14] console_flush_all+0x20c/0x2c0
[f1021ce0] [c0094e34] console_unlock+0x6c/0x108
[f1021d20] [c0095cdc] vprintk_emit+0x1a0/0x1a4
[f1021d50] [c0091ff0] _printk+0x6c/0x74
[f1021da0] [c00956d8] register_console+0x2f0/0x45c
[f1021de0] [c0c47c24] init_netconsole+0xc8/0x4a0
[f1021e50] [c0007bd8] do_one_initcall+0x84/0x294
[f1021ec0] [c0c03dd4] kernel_init_freeable+0x2e0/0x398
[f1021f10] [c0007ec4] kernel_init+0x24/0x138
[f1021f30] [c00152ec] ret_from_kernel_user_thread+0x10/0x18
--- interrupt: 0 at 0x0
Code: 39295fdf 89490002 2c0a0000 40a20028 39400001 3c60c09a 389f00e0 99490002 3863d208 813f0008 80a90010 4b9b16c5 <0fe00000> 2c18000e 4081fec8 4bfffea0 
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
raw_local_irq_restore() called with IRQs enabled
WARNING: CPU: 1 PID: 1 at kernel/locking/irqflag-debug.c:10 warn_bogus_irq_restore+0x30/0x44
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Tainted: G        W          6.9.0-rc5-PMacG4 #4
Hardware name: PowerMac3,6 7455 0x80010303 PowerMac
NIP:  c07b3280 LR: c07b3280 CTR: 00000000
REGS: f1021b20 TRAP: 0700   Tainted: G        W           (6.9.0-rc5-PMacG4)
MSR:  00029032 <EE,ME,IR,DR,RI>  CR: 24004222  XER: 00000000

GPR00: c07b3280 f1021be0 c1180ba0 00000030 000001f2 f1021a14 f1021a08 00000000 
GPR08: 2e078000 00000027 00000027 f1021be0 28004222 00000000 00000000 00000000 
GPR16: 00000000 00009032 c0df6022 c0df6022 00000000 00000001 c1df8f8c c0da8058 
GPR24: 00000000 00001032 c1eae680 c1df8f8c 00000041 c22b3640 c10dcb00 00000000 
NIP [c07b3280] warn_bogus_irq_restore+0x30/0x44
LR [c07b3280] warn_bogus_irq_restore+0x30/0x44
Call Trace:
[f1021be0] [c07b3280] warn_bogus_irq_restore+0x30/0x44 (unreliable)
[f1021bf0] [c06996a0] netpoll_send_skb+0x74/0x20c
[f1021c20] [c05b6790] write_msg+0x10c/0x120
[f1021c60] [c0094d14] console_flush_all+0x20c/0x2c0
[f1021ce0] [c0094e34] console_unlock+0x6c/0x108
[f1021d20] [c0095cdc] vprintk_emit+0x1a0/0x1a4
[f1021d50] [c0091ff0] _printk+0x6c/0x74
[f1021da0] [c00956d8] register_console+0x2f0/0x45c
[f1021de0] [c0c47c24] init_netconsole+0xc8/0x4a0
[f1021e50] [c0007bd8] do_one_initcall+0x84/0x294
[f1021ec0] [c0c03dd4] kernel_init_freeable+0x2e0/0x398
[f1021f10] [c0007ec4] kernel_init+0x24/0x138
[f1021f30] [c00152ec] ret_from_kernel_user_thread+0x10/0x18
--- interrupt: 0 at 0x0
Code: 3d20c0db 89495e72 2c0a0000 4ca20020 9421fff0 3c60c092 7c0802a6 39400001 38634c9f 99495e72 90010014 4b897c6d <0fe00000> 80010014 38210010 7c0803a6 
---[ end trace 0000000000000000 ]---
netconsole: network logging started
[...]

This dmesg is from kernel v6.9-rc5 but I get these warnings on stable v6.8.x and v6.6.x too.

Some data about the machine and the network card:

 # inxi -bz
System:
  Kernel: 6.8.7-gentoo-PMacG4 arch: ppc bits: 32
  Desktop: WindowMaker v: 0.95.9 Distro: Gentoo Base System release 2.14
Machine:
  Type: PPC System: PowerMac3 6 details: N/A mobo: PowerMac3,6 MacRISC3 Power
    Macintosh serial: <filter>
CPU:
  Info: single core 7455 altivec supported [MT MCM] speed (MHz): avg: 1417
Graphics:
  Device-1: AMD RV350 [Radeon 9550/9600/X1050 Series] driver: radeon v: kernel
  Display: x11 server: X.org v: 1.21.1.13 driver: X: loaded: radeon
    unloaded: fbdev,modesetting dri: r300 gpu: radeon
    resolution: <missing: xdpyinfo/xrandr> resolution: 1920x1080
  API: OpenGL v: 4.5 vendor: mesa v: 24.0.4 renderer: llvmpipe (LLVM 17.0.6
    128 bits)
Network:
  Device-1: Broadcom BCM4306 802.11b/g Wireless LAN driver: b43-pci-bridge
  Device-2: Apple UniNorth 2 GMAC driver: gem
  Device-3: gmac driver: gem
Drives:
  Local Storage: total: 689.82 GiB used: 7.62 GiB (1.1%)
Info:
  Memory: total: 2 GiB available: 1.96 GiB used: 166.3 MiB (8.3%)
  Processes: 159 Uptime: 8m Shell: Bash inxi: 3.3.33
 # lspci 
0000:00:0b.0 Host bridge: Apple Inc. UniNorth 2 AGP
0000:00:10.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV350 [Radeon 9550/9600/X1050 Series]
0001:00:0b.0 Host bridge: Apple Inc. UniNorth 2 PCI
0001:00:12.0 USB controller: NEC Corporation OHCI USB Controller (rev 43)
0001:00:12.1 USB controller: NEC Corporation OHCI USB Controller (rev 43)
0001:00:12.2 USB controller: NEC Corporation uPD72010x USB 2.0 Controller (rev 04)
0001:00:13.0 Mass storage controller: Silicon Image, Inc. SiI 3112 [SATALink/SATARaid] Serial ATA Controller (rev 02)
0001:00:15.0 Serial controller: MosChip Semiconductor Technology Ltd. PCI 9865 Multi-I/O Controller
0001:00:15.1 Serial controller: MosChip Semiconductor Technology Ltd. PCI 9865 Multi-I/O Controller
0001:00:15.2 Parallel controller: Illegal Vendor ID Device 9865
0001:00:16.0 Network controller: Broadcom Inc. and subsidiaries BCM4306 802.11b/g Wireless LAN Controller (rev 02)
0001:00:17.0 Unassigned class [ff00]: Apple Inc. KeyLargo Mac I/O (rev 03)
0001:00:18.0 USB controller: Apple Inc. KeyLargo USB
0001:00:19.0 USB controller: Apple Inc. KeyLargo USB
0001:00:1b.0 USB controller: NEC Corporation OHCI USB Controller (rev 43)
0001:00:1b.1 USB controller: NEC Corporation OHCI USB Controller (rev 43)
0001:00:1b.2 USB controller: NEC Corporation uPD72010x USB 2.0 Controller (rev 04)
0002:00:0b.0 Host bridge: Apple Inc. UniNorth 2 Internal PCI
0002:00:0d.0 Unassigned class [ff00]: Apple Inc. UniNorth 2 ATA/100
0002:00:0e.0 FireWire (IEEE 1394): Apple Inc. UniNorth 2 FireWire (rev 01)
0002:00:0f.0 Ethernet controller: Apple Inc. UniNorth 2 GMAC (Sun GEM)
 # lspci -s 0002:00:0f.0 -vv
0002:00:0f.0 Ethernet controller: Apple Inc. UniNorth 2 GMAC (Sun GEM)
	Device tree node: /sys/firmware/devicetree/base/pci@f4000000/ethernet@f
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR+ INTx-
	Latency: 16 (16000ns min, 16000ns max), Cache Line Size: 32 bytes
	Interrupt: pin A routed to IRQ 41
	Region 0: Memory at f5200000 (32-bit, non-prefetchable) [size=2M]
	Expansion ROM at f5100000 [disabled] [size=1M]
	Kernel driver in use: gem

Full dmesg an kernel .config attached.

Regards,
Erhard