Phy chip ksz9031 can not be networked

hello,
We designed a carrier board, and the network phy chip uses micrel’s ksz9031. Now we find that it needs to be plugged and unplugged twice to connect to the network. Is there any configuration required? The phy address is 0. Can partners with the same experience provide help?

Please share the dmesg and below info when error happens.

  1. ifconfig eth0
  2. ethtool -S eth0

faild.txt (5.0 KB) ifconfig_failed.txt (338 Bytes) ifconfig_success.txt (513 Bytes) success.txt (5.1 KB)

The attachment is detailed information. The failed.txt is the information that the network cable is connected, but the Internet is not connected. success.txt is the information that the network cable is connected and can work normally.

Could you post the dmesg? The failed case looks like hardware issue because the mac does not send or receive anything.

dmesg.txt (73.4 KB) dmesg_2.txt (73.6 KB)

The first one is dmesg without successful internet connection. dmesg_2.txt is the dmesg after successful network connection

Are you able to use dhclient eth0 to assign a IP? If it cannot work, could you check what log is inside the syslog?

eth0 uses automatic (DHCP)
syslog.txt (811.4 KB)

Hi,

Yes, i know it is automatic. I want you to run dhclient manually and see what would happen.
Did you run?

Also, if dhclient does not work could you restart networkmanager and see what would happen?

syslog615.txt.txt (423.0 KB)

Hello, can you see if I’ve got it , I’ll run dhclient manually to display file exists Restart the networkmanger is to restart the network icon

I’ll run dhclient manually to display file exists Restart the networkmanger is to restart the network icon

Not very sure what you want to say. Could you make a more clear description?

Also, could you describe what you’ve done in your log. It looks like the dhcp works good. Are you still not able to see the IP in ifconfig?

Jun 15 15:28:45 nvidia-desktop avahi-autoipd(eth0)[11551]: Callout BIND, address 169.254.8.53 on interface eth0
Jun 15 15:28:45 nvidia-desktop avahi-daemon[5035]: Joining mDNS multicast group on interface eth0.IPv4 with address 169.254.8.53.
Jun 15 15:28:45 nvidia-desktop avahi-daemon[5035]: New relevant interface eth0.IPv4 for mDNS.
Jun 15 15:28:45 nvidia-desktop avahi-daemon[5035]: Registering new address record for 169.254.8.53 on eth0.IPv4.
Jun 15 15:28:45 nvidia-desktop NetworkManager[5006]: [1592206125.3992] keyfile: add connection in-memory (0e66d175-3ec1-463e-8ea3-72bb97e9d5ca,“eth0”)
Jun 15 15:28:45 nvidia-desktop NetworkManager[5006]: [1592206125.4037] device (eth0): state change: unavailable -> disconnected (reason ‘connection-assumed’, sys-iface-state: ‘external’)
Jun 15 15:28:45 nvidia-desktop systemd-resolved[11482]: Using degraded feature set (UDP) for DNS server 192.168.2.10.
Jun 15 15:28:45 nvidia-desktop systemd-resolved[11482]: Using degraded feature set (UDP) for DNS server 192.168.2.10.
Jun 15 15:28:45 nvidia-desktop NetworkManager[5006]: [1592206125.4096] device (eth0): Activation: starting connection ‘eth0’ (0e66d175-3ec1-463e-8ea3-72bb97e9d5ca)
Jun 15 15:28:45 nvidia-desktop NetworkManager[5006]: [1592206125.4139] device (eth0): state change: disconnected -> prepare (reason ‘none’, sys-iface-state: ‘external’)
Jun 15 15:28:45 nvidia-desktop NetworkManager[5006]: [1592206125.4187] device (eth0): state change: prepare -> config (reason ‘none’, sys-iface-state: ‘external’)
Jun 15 15:28:45 nvidia-desktop nm-applet[7277]: gtk_widget_destroy: assertion ‘GTK_IS_WIDGET (widget)’ failed
Jun 15 15:28:45 nvidia-desktop NetworkManager[5006]: [1592206125.4527] device (eth0): state change: config -> ip-config (reason ‘none’, sys-iface-state: ‘external’)
Jun 15 15:28:45 nvidia-desktop NetworkManager[5006]: [1592206125.4535] device (eth0): state change: ip-config -> ip-check (reason ‘none’, sys-iface-state: ‘external’)
Jun 15 15:28:45 nvidia-desktop nm-applet[7277]: gtk_widget_destroy: assertion ‘GTK_IS_WIDGET (widget)’ failed
Jun 15 15:28:45 nvidia-desktop NetworkManager[5006]: [1592206125.4572] device (eth0): state change: ip-check -> secondaries (reason ‘none’, sys-iface-state: ‘external’)
Jun 15 15:28:45 nvidia-desktop NetworkManager[5006]: [1592206125.4584] device (eth0): state change: secondaries -> activated (reason ‘none’, sys-iface-state: ‘external’)
Jun 15 15:28:45 nvidia-desktop NetworkManager[5006]: [1592206125.4688] device (eth0): Activation: successful, device activated.

Hello, how to make sure my PHY chip ksz9031 is recognized and loaded

hello WayneWWW,
I added printk print information to the micrel.c file, but I checked the dmesg information and there is no relevant print information. It should be the problem that the driver is not running. How does the phy chip device and driver match?

Hi,

The ethernet controller will search for your phy driver if it is registered as mdio bus device.

Generally, I think such issue is in hardware aspect but not software side.

If this could work after hotplug twice, then I don’t think it is software issue.

Hi,
Now my device tree information is as follows:
mdio {
compatible = “nvidia,eqos-mdio”;
#address-cells = <1>;
#size-cells = <0>;

                    phy0: ethernet-phy@0 {
                            //compatible = "micrel,ksz9031";
                            reg = <0>;
                            interrupt-parent = <&tegra_main_gpio>;
                            interrupts = <TEGRA194_MAIN_GPIO(G, 4) IRQ_TYPE_LEVEL_LOW>;
                       
                            //marvell,copper-mode;
                            /* Setup LED[2] as interrupt pin (active low) */
                            //marvell,reg-init = <0x03 0x12 0x7fff 0x880>;
                            //micrel,copper-mode;
                            //micrel,reg-init = <0x03 0x12 0x7fff 0x880>;
                            //micrel,rmii-reference-clock-select-25-mhz;
                            //clocks,clock-names = "rmii-ref";
                            //rxc-skew-ps = <3000>;
                            //rxdv-skew-ps = <0>;
                            //txc-skew-ps = <3000>;
                            //txen-skew-ps = <0>;
                    };

and phy device in folder “/sys/bus/mdio_bus/device”

But the driver is not loaded and running

But after the hotplug, will you see the driver running?

I mean you could see eth0 works after hotplug so that driver is actually running after you hotplug, right?

I test to check。

Hello, I don’t know much about the network card. May I ask, what are the possible reasons for this phenomenon?

hello Wayne WWW
the1.txt (1.5 MB)is the system boot syslog。
2.txt (1.5 MB) The system log when the network cable is first inserted.DHCP cannot get IP address
3.txt (1.5 MB) System log when I unplugged the network cable.
4.txt (1.5 MB) System log when the network cable is inserted for the second time. DHCP automatically obtains the IP address.

I compared the log files and found that the signal did not seem to be recognized by the system when it was first inserted.

Can you help analyze the reason?