Raspberry Pi 4/400 network interface switching between down and up status

Open
#4,560 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, linux, raspberry-pi

Research direction

Start with the bcmgenet eth0 messages in the attached rpi4 and rpi400 dmesg logs, and compare them with the linked Raspberry Pi OS 64-bit report. Reproduce the link transitions on Raspberry Pi 4/400 using both 32-bit and 64-bit Raspberry Pi OS images. Done means identifying the cause and preventing the interface from repeatedly switching between down and up.

Written by the indexing model from the issue text.

Description

Warning: This is a more or less a copy of the initial bug report written against Raspberry Pi OS 64bits since I thought it was 64bits-specific: https://github.com/raspberrypi/Raspberry-Pi-OS-64bit/issues/178. Let me know which one should be kept.

Current behavior:

  • The interface (eth0) of the integrated NIC of the SoC of my Rasperry Pi 4 (and 400) is constantly switching between "up" and "down" status, as reported by dmesg:
[13311.171718] bcmgenet fd580000.ethernet eth0: Link is Down
[13313.219840] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[13393.092824] bcmgenet fd580000.ethernet eth0: Link is Down
[13396.164840] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[13432.005229] bcmgenet fd580000.ethernet eth0: Link is Down
[13435.077479] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[13562.054861] bcmgenet fd580000.ethernet eth0: Link is Down
[13565.126956] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[13639.879848] bcmgenet fd580000.ethernet eth0: Link is Down
[13642.952052] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[13851.850591] bcmgenet fd580000.ethernet eth0: Link is Down
[13854.922580] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[14254.287566] bcmgenet fd580000.ethernet eth0: Link is Down
[14257.359734] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[14309.584214] bcmgenet fd580000.ethernet eth0: Link is Down
[14312.656314] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
  • This can be seen by an ssh session freezing for a while for example.

Expected behavior:

  • eth0 interface stays "up" after boot
  • the kernel only needs to brings up the interface once (at boot)

Steps to reproduce:

  1. Flash an SD card with Raspberry Pi OS (Lite in my case) 64bits
  2. Create an empty ssh file in the /boot/ directory/partition
  3. Insert the SD card in a Raspberry Pi 4 or 400
  4. Power up the Raspberry Pi
  5. Connect via ssh to the Pi
  6. Update the system (apt update && apt upgrade -y)
  7. Reboot and reconnect via ssh
  8. Wait for the problem to occur
  9. Display the kernel buffer

Context

  • This issue occurs with any fresh install of Raspberry Pi OS 64bits (I even tried with older images I still had).
  • Every image was verified before flashing.
  • Before reporting this issue, the system had been updated to the current versions of RPOS.
  • I tried to change everything - from the power supply to the Ethernet cable, SD card, switch and even other versions of Raspberry Pi 4(00).
  • Apart from the SD card, the Ethernet cable and the PSU nothing is connected to the Pi used to reproduce this issue.
  • The Raspberry Pi is, of course, left in autonegociation and is assigned an IP by a DHCP server, no static IP is assigned on the device itself, not a single setting was changed.

Here are logs from a Raspberry Pi 400:
rpi400_dmesg_64bits.txt

I did not find any duplicate showing this exact issue, please let me know if this is a duplicate or if I forgot any relevant detail.

Edit:

After troubleshooting for 64bits, I did the same with a 32bits version of Raspberry Pi OS, to be exhaustive, and, to my surprise, it happened as well, but at a lower frequency.

Here is the kernel log on the same device Raspberry Pi 400:
rpi400_dmesg_32bits.txt

I never saw the same on my Raspberry Pi 1, 2 or 3 models B.

##Logs:

rpi4_dmesg_64bits.txt
rpi400_dmesg_32bits.txt
rpi400_dmesg_64bits.txt

Dominant language
C
Stars
13.2k
Forks
5.5k
Avg merge
2d 21h
Merged PRs (30d)
21

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/linux

All issues in raspberrypi/linux

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.