Using KSZ9131 PHY On i.MX8MP and 5.4.70-2.3.0

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using KSZ9131 PHY On i.MX8MP and 5.4.70-2.3.0

916 Views
Candle_zzw
Contributor I

Hello,

We are working on imx8mp custom board with ksz9131. The fec mac works ok.,but the eqos has some problem. The eqos is eth1, using PING to PC then I found the package loss is serious,and  some times the kernel appears Call Trace,here is the log:

[ 6.553097] imx-dwmac 30bf0000.ethernet eth1: PHY [stmmac-1:03] driver [Microchip KSZ9131 Gigabit PHY]

[ 6.568810] imx-dwmac 30bf0000.ethernet eth1: No Safety Features support found
User Sessions...
[ 6.576439] imx-dwmac 30bf0000.ethernet eth1: IEEE 1588-2008 Advanced Timestamp supported
[ 6.586925] imx-dwmac 30bf0000.ethernet eth1: registered PTP clock
[ 6.593151] imx-dwmac 30bf0000.ethernet eth1: configuring for phy/rgmii-id link mode
[ 6.603367] 8021q: adding VLAN 0 to HW filter on device eth1
[ 6.606324] imx-dwmac 30bf0000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[ 6.609152] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready

 

root@Router:~# [ 981.185066] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 981.191171] (detected by 3, t=17749 jiffies, g=2521, q=497)
[ 981.196834] rcu: All QSes seen, last rcu_preempt kthread activity 17750 (4295137595-4295119845), jiffies_till_next_fqs=1, root ->qsmask 0x0
[ 981.209351] swapper/3 R running task 0 0 1 0x0000002a
[ 981.216400] Call trace:
[ 981.218854] dump_backtrace+0x0/0x140
[ 981.222517] show_stack+0x14/0x20
[ 981.225834] sched_show_task+0x108/0x138
[ 981.229758] rcu_sched_clock_irq+0x910/0x9c8
[ 981.234029] update_process_times+0x2c/0xb8
[ 981.238213] tick_sched_handle.isra.0+0x30/0x50
[ 981.242740] tick_sched_timer+0x48/0x98
[ 981.246576] __hrtimer_run_queues+0x110/0x1b0
[ 981.250932] hrtimer_interrupt+0xe4/0x240
[ 981.254943] arch_timer_handler_phys+0x30/0x40
[ 981.259387] handle_percpu_devid_irq+0x80/0x140
[ 981.263917] generic_handle_irq+0x24/0x38
[ 981.267925] __handle_domain_irq+0x60/0xb8
[ 981.272022] gic_handle_irq+0x5c/0x148
[ 981.275771] el1_irq+0xb8/0x180
[ 981.278913] cpuidle_enter_state+0x84/0x360
[ 981.283093] cpuidle_enter+0x34/0x48
[ 981.286672] call_cpuidle+0x18/0x38
[ 981.290157] do_idle+0x1e0/0x280
[ 981.293384] cpu_startup_entry+0x20/0x80
[ 981.297307] secondary_start_kernel+0x154/0x190
[ 981.301839] rcu: rcu_preempt kthread starved for 17777 jiffies! g2521 f0x2 RCU_GP_WAIT_FQS(5) ->state=0x0 ->cpu=3
[ 981.312094] rcu: RCU grace-period kthread stack dump:
[ 981.317146] rcu_preempt R running task 0 10 2 0x00000028
[ 981.324196] Call trace:
[ 981.326643] __switch_to+0x108/0x1c0
[ 981.330219] __schedule+0x224/0x560
[ 981.333707] schedule+0x40/0xe0
[ 981.336848] schedule_timeout+0x144/0x290
[ 981.340858] rcu_gp_kthread+0x480/0x8b8
[ 981.344694] kthread+0x138/0x158
[ 981.347922] ret_from_fork+0x10/0x1c


root@Router:~# ping 192.168.0.10
PING 192.168.0.10 (192.168.0.10) 56(84) bytes of data.
64 bytes from 192.168.0.10: icmp_seq=1 ttl=64 time=2.29 ms
64 bytes from 192.168.0.10: icmp_seq=6 ttl=64 time=1.95 ms
From 192.168.0.1 icmp_seq=54 Destination Host Unreachable
From 192.168.0.1 icmp_seq=55 Destination Host Unreachable
From 192.168.0.1 icmp_seq=56 Destination Host Unreachable
From 192.168.0.1 icmp_seq=57 Destination Host Unreachable
From 192.168.0.1 icmp_seq=58 Destination Host Unreachable
From 192.168.0.1 icmp_seq=59 Destination Host Unreachable
From 192.168.0.1 icmp_seq=60 Destination Host Unreachable
From 192.168.0.1 icmp_seq=61 Destination Host Unreachable
From 192.168.0.1 icmp_seq=62 Destination Host Unreachable
From 192.168.0.1 icmp_seq=63 Destination Host Unreachable
From 192.168.0.1 icmp_seq=64 Destination Host Unreachable
From 192.168.0.1 icmp_seq=65 Destination Host Unreachable
From 192.168.0.1 icmp_seq=66 Destination Host Unreachable
^C
--- 192.168.0.10 ping statistics ---
67 packets transmitted, 2 received, +13 errors, 97.0149% packet loss, time 940ms
rtt min/avg/max/mdev = 1.953/2.123/2.294/0.176 ms, pipe 4

root@Router:~# ifconfig
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255
ether f2:6f:5d:92:7c:a7 txqueuelen 1000 (Ethernet)
RX packets 141 bytes 11821 (11.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 162 bytes 19832 (19.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 46

 

The hardware connection is basically unchanged,we use gpio3_1 for phy reset,here is my DTS file

&eqos {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_eqos>;
phy-mode = "rgmii-id";
phy-handle = <&ethphy0>;
snps,reset-gpios = <&gpio3 1 GPIO_ACTIVE_LOW>;
/* snps,reset-active-low; */
snps,reset-delays-us = <0 10000 50000>;
status = "okay";

mdio {
compatible = "snps,dwmac-mdio";
pinctrl-0 = <&pinctrl_mdio>;
#address-cells = <1>;
#size-cells = <0>;


ethphy0: ethernet-phy@3 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0x3>;
rxc-dll-2ns = <1>;
txc-dll-2ns = <1>;
};
};
};

pinctrl_eqos: eqosgrp {
fsl,pins = <
MX8MP_IOMUXC_ENET_MDC__ENET_QOS_MDC 0x3
MX8MP_IOMUXC_ENET_MDIO__ENET_QOS_MDIO 0x3
MX8MP_IOMUXC_ENET_RD0__ENET_QOS_RGMII_RD0 0x91
MX8MP_IOMUXC_ENET_RD1__ENET_QOS_RGMII_RD1 0x91
MX8MP_IOMUXC_ENET_RD2__ENET_QOS_RGMII_RD2 0x91
MX8MP_IOMUXC_ENET_RD3__ENET_QOS_RGMII_RD3 0x91
MX8MP_IOMUXC_ENET_RXC__CCM_ENET_QOS_CLOCK_GENERATE_RX_CLK 0x91
MX8MP_IOMUXC_ENET_RX_CTL__ENET_QOS_RGMII_RX_CTL 0x91
MX8MP_IOMUXC_ENET_TD0__ENET_QOS_RGMII_TD0 0x1f
MX8MP_IOMUXC_ENET_TD1__ENET_QOS_RGMII_TD1 0x1f
MX8MP_IOMUXC_ENET_TD2__ENET_QOS_RGMII_TD2 0x1f
MX8MP_IOMUXC_ENET_TD3__ENET_QOS_RGMII_TD3 0x1f
MX8MP_IOMUXC_ENET_TX_CTL__ENET_QOS_RGMII_TX_CTL 0x1f
MX8MP_IOMUXC_ENET_TXC__CCM_ENET_QOS_CLOCK_GENERATE_TX_CLK 0x1f
>;
};

pinctrl_mdio: mdiogrp {
fsl,pins = <
MX8MP_IOMUXC_NAND_CE0_B__GPIO3_IO01 0x19
>;
};

Have any suggestions I can try?

 

0 Kudos
0 Replies