I'm building a system image with v4.19.106 kernel and BusyBox for BeagleBone Black using buildroot 2020.02. If I boot the board from the resulting SD card, I see a strange behaviour: system load stays between 0.60 and 0.75 while CPU usage is below 1%, with no services running, when there's no Ethernet cable connected. As soon as I plug in a cable, the load goes down to 0.00-0.01.
With the cable unplugged I see this line in
PID USER TIME+ S WCHAN COMMAND 42 root 0:03.03 D msleep [kworker/0:3+events_power_efficient]
ip link output:
4: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000 link/ether 4c:3f:d3:91:f2:66 brd ff:ff:ff:ff:ff:ff
eth0 Link encap:Ethernet HWaddr 4C:3F:D3:91:F2:66 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:49
When I plug in the cable, I see this message:
# [ 3811.689083] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
After that there's no process with Process Status D in
top -H, and the load goes down.
ip link output with the cable plugged in:
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether 4c:3f:d3:91:f2:66 brd ff:ff:ff:ff:ff:ff
ifconfig output the cable plugged in:
eth0 Link encap:Ethernet HWaddr 4C:3F:D3:91:F2:66 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:66 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:7605 (7.4 KiB) TX bytes:0 (0.0 B) Interrupt:49
Unplugging the cable brings back the high load.
My eth0 config in
auto eth0 iface eth0 inet dhcp
If I use
allow-hotplug eth0, the interface stays down when the cable is unplugged at boot (and the load stays normal), but it doesn't come up afterwards when I connect a cable, just when I run
How can I prevent the high load when a cable is unplugged, and get a working connection when it gets plugged in? Are there any kernel configs or device tree entries I should check?
Another confusing bit is that the issue does not appear after every boot. Power cycling the board usually makes it appear if it was not present, while
reboot not necessarily. (I'm not sure if it really makes a difference which method I use, or it just appeared so in my limited number of trials.)