You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If RPI is started with unplugged ethernet cable, after full boot it correctly detects that ethernet cable was connected or disconnected, e.g. /sys/class/net/eth0/carrier is changing content.
If RPI is started with plugged ethernet cable, it always responds that cable is connected.
To reproduce
turn on device with ethernet cable plugged in (ethernet must work)
watch /sys/class/net/eth0/carrier
unplug ethernet
Expected behaviour /sys/class/net/eth0/carrier content should be 0
Actual behaviour
unplug of ethernet is not detected but on ethernet card yellow light is switched off. /sys/class/net/eth0/carrier content is 1
System
Which model of Raspberry Pi? e.g. Pi3B+, PiZeroW
RPI3 model B+
Which OS and version (cat /etc/rpi-issue)?
Raspberry Pi reference 2019-04-08
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, e910bf55ac92e27c6e77043e8995bcb5e0a2d742, stage2
Which firmware version (vcgencmd version)?
Mar 27 2019 15:45:53
Copyright (c) 2012 Broadcom
version 2e98b31d18547962e564bdf88e57b3df7085c29b (clean) (release) (start)
Which kernel version (uname -a)?
Linux raspberrypi 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux
Logs
If applicable, add the relevant output from dmesg or similar.
Additional context
Add any other relevant context for the problem.
I am not able to replicate the issue with the following system information. Update me if I am missing anything.
System:
RPI3 model B+
OS version
cat /etc/rpi-issue
Raspberry Pi reference 2019-04-08
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, e910bf55ac92e27c6e77043e8995bcb5e0a2d742, stage4
I'm seeing this problem on my Raspberry Pi 3 B+ as well. I noticed it when power cycling a small switch with four RPi's (three 3B's, one 3B+) connected caused all but the RPi3+ to request a new DHCP lease (as was the intent).
root@rpi3p-01:~# uname -a
Linux rpi3p-01 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux
root@rpi3p-01:~# vcgencmd version
Aug 15 2019 12:07:10
Copyright (c) 2012 Broadcom
version 0e6daa5106dd4164474616408e0dc24f997ffcf3 (clean) (release) (start_cd)
Still present in 4.19.93-v7+
Workaround is to request the carrier state directly from the LAN78xx (using ETHTOOL_GLINK). If a discrepancy between the state and the carrier flag is detected, send USBDEVFS_RESET to the driver. From then on, it starts working normally.
FWIW, I did not patch the driver but use a daemon script to detect this and restart the driver. Never seen the issue since then (on quite a lot of RPI's), so I don't know if the root problem has been resolved or not.
This is just a quick update to say that I can reproduce the problem and am looking for the right solution. As a workaround you could try putting "ethtool -d eth0" in /etc/rc.local (or running "sudo ethtool -d eth0" manually), and see if the carrier tracking is correct from then on, or if it reverts to the bad state after a while.
Activity
XECDesign commentedon Apr 15, 2019
Also reported here:
raspberrypi/firmware#1100
sudhamani-hcl commentedon Jul 30, 2019
Hi Team,
I am not able to replicate the issue with the following system information. Update me if I am missing anything.
System:
cat /etc/rpi-issue
Raspberry Pi reference 2019-04-08
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, e910bf55ac92e27c6e77043e8995bcb5e0a2d742, stage4
Linux raspberrypi 4.14.98-v7+ Add FBUNSUPPORTED ioctl for bcm2708_fb #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux
Thanks & Regards,
Sudhamani B
JamesH65 commentedon Jul 30, 2019
It would be interesting to know if the problem is showing for anyone using the latest kernel (4.19)
sudhamani-hcl commentedon Jul 31, 2019
pelwell commentedon Jul 31, 2019
I think @JamesH65 answered your question before you asked it - we don't work on problems unless we know they exist.
XECDesign commentedon Jul 31, 2019
The problem is still there with 4.19.58
jasonemann commentedon Aug 23, 2019
I'm seeing this problem on my Raspberry Pi 3 B+ as well. I noticed it when power cycling a small switch with four RPi's (three 3B's, one 3B+) connected caused all but the RPi3+ to request a new DHCP lease (as was the intent).
sudhamani-hcl commentedon Sep 17, 2019
Hi,
This problem is occurring so rarely on the following kernel
Linux raspberrypi 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux
Anyone working on this isse?
Regards,
Sudhamani
brubbel commentedon Jan 25, 2020
Still present in 4.19.93-v7+
Workaround is to request the carrier state directly from the LAN78xx (using ETHTOOL_GLINK). If a discrepancy between the state and the carrier flag is detected, send USBDEVFS_RESET to the driver. From then on, it starts working normally.
JamesH65 commentedon Jan 27, 2020
@brubbel Have you got a patch that shows that change in the driver?
paul-1 commentedon Dec 13, 2020
@JamesH65 has anyone been able to resolve this issue. This is still a problem on 5.4 kernels.
brubbel commentedon Dec 14, 2020
FWIW, I did not patch the driver but use a daemon script to detect this and restart the driver. Never seen the issue since then (on quite a lot of RPI's), so I don't know if the root problem has been resolved or not.
Poll LAN controller link status:
Then compare with
cat /sys/class/net/ifaceNameHere/carrierIf those two disagree, reset LAN controller:
pelwell commentedon Dec 14, 2020
This is just a quick update to say that I can reproduce the problem and am looking for the right solution. As a workaround you could try putting "ethtool -d eth0" in /etc/rc.local (or running "sudo ethtool -d eth0" manually), and see if the carrier tracking is correct from then on, or if it reverts to the bad state after a while.
brubbel commentedon Dec 14, 2020
If I remember correctly this occurs only once. After reset of the LAN78XX device all goes well.
pelwell commentedon Dec 14, 2020
Does that mean you will try my workaround instead of your script?
281 remaining items
net: lan78xx: Ack pending PHY ints when resetting
net: lan78xx: Ack pending PHY ints when resetting
net: lan78xx: Ack pending PHY ints when resetting
net: lan78xx: Ack pending PHY ints when resetting
net: lan78xx: Ack pending PHY ints when resetting
net: lan78xx: Ack pending PHY ints when resetting
net: lan78xx: Ack pending PHY ints when resetting
net: lan78xx: Ack pending PHY ints when resetting
net: lan78xx: Ack pending PHY ints when resetting
net: lan78xx: Ack pending PHY ints when resetting
net: lan78xx: Ack pending PHY ints when resetting
net: lan78xx: Ack pending PHY ints when resetting
net: lan78xx: Ack pending PHY ints when resetting
net: lan78xx: Ack pending PHY ints when resetting
net: lan78xx: Ack pending PHY ints when resetting