Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux kernels cannot load network: (failed to connect to PHY) when UEFI netbooted through iPXE or grub #137

Closed
wernerb opened this issue Mar 7, 2021 · 4 comments

Comments

@wernerb
Copy link

wernerb commented Mar 7, 2021

Linux kernels started with network adapter already loaded previously fail to connect in final boot. This is on kernel 5.10.19.

I tested both grub2 and iPXE to make sure there is not a problem there.

Both will boot flatcar linux/fedora coreos over the internet but it shows failed to connect to PHY and Unable to find mii.
Reading the code a little at the linux kernel it seems it can't find the mac adress it already initialized. I also see when booting some warnings about ACPI table being corrupted. I don't know if this is related.

OS tried:

I verified that both can be installed locally directly without internet through usb stick and then booted correctly with no ethernet issues afterwards. It really seems re-use of the adapter that gives problems.

I should note that I am also booting the firmware from tftp instead of sd card.

This is a debug log of RPI4 master built with debug and the lastest zip of firmware files.
https://gist.github.com/wernerb/3d195cfdb640ec66d9029197e3be91b8 (Using

Reproduce with netboot.xyz

boot http://boot.netboot.xyz/ipxe/netboot.xyz-arm64.efi manually through the Network boot.
Then when booted into the menu.
Select Execute iPXE shell

Type in the following:

kernel https://alpha.release.flatcar-linux.net/arm64-usr/current/flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.config.url=http://urldoesntmatter flatcar.first_boot=yes console=tty0 console=ttyS0 flatcar.autologin
initrd https://alpha.release.flatcar-linux.net/arm64-usr/current/flatcar_production_pxe_image.cpio.gz
boot

You will see messages such as:

[  133.316150] Unable to find mii
[  133.319239] bcmgenet BCM6E4E:00 enabcm6e4ei0: failed to connect to PHY
@jlinton
Copy link
Member

jlinton commented Mar 9, 2021

This is because your failing to load the initrd, which contains the mdio_bcm_unimac.ko which is the mdio/phy driver for the genet.

Its likely related to #113

@wernerb
Copy link
Author

wernerb commented Mar 9, 2021

Am I not loading initrd here https://gist.github.com/wernerb/3d195cfdb640ec66d9029197e3be91b8#file-gistfile1-txt-L3671 before that grub fails on the first menuentry which is normal (there is no linuxefi command). But then it tries the second and that goes through.

I checked and saw the issue tried 1.16 but I could not get it to work without an sdcard. I will try that though. But that issue states he could not run grub net_dhcp while I can and have no problem with networking either in iPXE or grub.

@noahwilliamsson
Copy link

noahwilliamsson commented Mar 28, 2021

@wernerb FWIW, I just reported the apparent lack of CONFIG_MDIO_BCM_UNIMAC in the Fedora 34 pxeboot images: https://bugzilla.redhat.com/show_bug.cgi?id=1943983.

I've found that:

Regarding the SD and WiFi support, I believe the patches in 5.12 that d9e569d refers to are the ones available in:

Specifically:

  • mmc: sdhci-iproc: Add ACPI bindings for the RPi
  • mmc: sdhci: Update firmware interface API

@wernerb
Copy link
Author

wernerb commented Mar 29, 2021

@noahwilliamsson thank you for this information. I found out that Ubuntu, for example, could boot so I was already looking at kernels. I have asked Flatcar to also add the relevant flag here: flatcar/Flatcar#375

For Fedora Coreos I just cloned the 33 kernel and it shows CONFIG_MDIO_BCM_UNIMAC=m for aarch64-fedora 👍. Looking at your bug report the root cause is indeed dracut according to the latest comment. Hopefully they backport this to at least dracut-51 which is what is used now in the Rawhide branch at Fedora CoreOS: https://builds.coreos.fedoraproject.org/browser?stream=rawhide .

Because its confirmed this is not a firmeware issue I am closing this. I hope this helps people on the internet! Thanks again @noahwilliamsson

@wernerb wernerb closed this as completed Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants