Imx8qm double mdio bus, eth0 can work, but eth1: kernel panic

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Imx8qm double mdio bus, eth0 can work, but eth1: kernel panic

1,212件の閲覧回数
jeffin
Contributor I

Imx8qm double mdio bus hardware design, in 4.14.98 kernel is ok, but in 5.4.24_2.1.0 eth1 registered phy kernel panic:

[ 3.927884] fec 5b040000.ethernet: Invalid MAC address: 00:00:00:00:00:00
[ 3.934695] fec 5b040000.ethernet: Using random MAC address: 92:bb:97:c9:a8:be
[ 3.943177] libphy: fec_enet_mii_bus: probed
[ 3.947458] ------of_mdiobus_register_phy-----62---
[ 3.952670] ------of_mdiobus_register_phy-----64---
[ 3.957558] ------of_mdiobus_register_phy-----68---
[ 3.962451] ------of_mdiobus_register_phy-----75---
[ 3.967344] ------of_mdiobus_register_phy-----99---
[ 3.972516] ------of_mdiobus_register_phy-----101---
[ 3.978171] fec 5b040000.ethernet eth0: registered PHC device 0
[ 3.985787] pps pps1: new PPS source ptp1
[ 3.990357] fec 5b050000.ethernet: Invalid MAC address: 00:00:00:00:00:00
[ 3.997160] fec 5b050000.ethernet: Using random MAC address: 86:d3:21:ab:69:4c
[ 4.005623] libphy: fec_enet_mii_bus: probed
[ 4.009911] ------of_mdiobus_register_phy-----62---
[ 4.015308] ------of_mdiobus_register_phy-----64---
[ 4.020221] ------of_mdiobus_register_phy-----68---
[ 4.025137] ------of_mdiobus_register_phy-----75---
[ 4.030035] ------of_mdiobus_register_phy-----99---
[ 4.035458] Marvell 88Q5050 5b050000.ethernet-2:01: PHY1_CTRL = 0xe03e
[ 4.042009] Marvell 88Q5050 5b050000.ethernet-2:01: Switch ID = 0xff00a511
[ 4.048907] Unable to handle kernel paging request at virtual address 0000000000002000
[ 4.056831] Mem abort info:
[ 4.059628] ESR = 0x96000004
[ 4.062689] EC = 0x25: DABT (current EL), IL = 32 bits
[ 4.068003] SET = 0, FnV = 0
[ 4.071062] EA = 0, S1PTW = 0
[ 4.074199] Data abort info:
[ 4.077082] ISV = 0, ISS = 0x00000004
[ 4.080936] CM = 0, WnR = 0
[ 4.083914] [0000000000002000] user address but active_mm is swapper
[ 4.090275] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[ 4.095854] Modules linked in:
[ 4.098915] CPU: 1 PID: 141 Comm: kworker/1:13 Not tainted 5.4.24-ga7f920fdbecd-dirty #65
[ 4.107093] Hardware name: Freescale i.MX8QM MEK (DT)
[ 4.112155] Workqueue: events deferred_probe_work_func
[ 4.117293] pstate: 60000005 (nZCv daif -PAN -UAO)
[ 4.122093] pc : phy_probe+0xb0/0x1f4
[ 4.125753] lr : phy_probe+0x9c/0x1f4
[ 4.129419] sp : ffff80001223b780
[ 4.132727] x29: ffff80001223b780 x28: 0000000000000010
[ 4.138043] x27: ffff0008ff40d880 x26: ffff800011a46b70
[ 4.143352] x25: ffff8000111ae400 x24: 0000000000000034
[ 4.148668] x23: ffff0008f2600c38 x22: 0000000000000000
[ 4.153985] x21: ffff0008f690d400 x20: ffff0008f2600c00
[ 4.159302] x19: ffff0008f2600800 x18: 0000000000000010
[ 4.164618] x17: 0000000000000000 x16: 0000000000000001
[ 4.169935] x15: ffff0008f690d870 x14: ffffffffffffffff
[ 4.175243] x13: ffff80009223b3d7 x12: ffff80001223b3e0
[ 4.180560] x11: ffff8000119f1000 x10: ffff800011b4b328
[ 4.185877] x9 : 0000000000000000 x8 : ffff800011b4c000
[ 4.191194] x7 : ffff8000106926d8 x6 : 00000000000001dc
[ 4.196510] x5 : 0000000000000000 x4 : 0000000000000000
[ 4.201827] x3 : 00000000ffffffff x2 : 9ef00b5e34fa7100
[ 4.207144] x1 : 9ef00b5e34fa7100 x0 : 0000000000002000
[ 4.212462] Call trace:
[ 4.214907] phy_probe+0xb0/0x1f4
[ 4.218225] really_probe+0xd4/0x318
[ 4.221807] driver_probe_device+0x54/0xe8
[ 4.225905] __device_attach_driver+0x80/0xb8
[ 4.230266] bus_for_each_drv+0x74/0xc0
[ 4.234104] __device_attach+0xdc/0x138
[ 4.237935] device_initial_probe+0x10/0x18
[ 4.242122] bus_probe_device+0x90/0x98
[ 4.245963] device_add+0x378/0x648
[ 4.249456] phy_device_register+0x50/0x98
[ 4.253561] of_mdiobus_register_phy+0x21c/0x268
[ 4.258176] of_mdiobus_register+0x110/0x340
[ 4.262448] fec_probe+0x10a0/0x12d0
[ 4.266024] platform_drv_probe+0x50/0xa0
[ 4.270035] really_probe+0xd4/0x318
[ 4.273606] driver_probe_device+0x54/0xe8
[ 4.277697] __device_attach_driver+0x80/0xb8
[ 4.282049] bus_for_each_drv+0x74/0xc0
[ 4.285890] __device_attach+0xdc/0x138
[ 4.289730] device_initial_probe+0x10/0x18
[ 4.293908] bus_probe_device+0x90/0x98
[ 4.297748] deferred_probe_work_func+0x64/0x98
[ 4.302290] process_one_work+0x198/0x320
[ 4.306299] worker_thread+0x48/0x420
[ 4.309969] kthread+0xf0/0x120
[ 4.313113] ret_from_fork+0x10/0x18


dts file code:

&fec1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_fec1>;
phy-mode = "rgmii-txid";
phy-handle = <&ethphy0>;
fsl,magic-packet;
nvmem-cells = <&fec_mac0>;
nvmem-cell-names = "mac-address";
fsl,rgmii_rxc_dly;
fsl,rgmii_txc_dly;
fsl,mii-exclusive;
status = "okay";

mdio {
#address-cells = <1>;
#size-cells = <0>;

ethphy0: ethernet-phy@0 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0>;
};
};
};

&fec2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_fec2>;
phy-mode = "rgmii-txid";
phy-handle = <&ethphy1>;
fsl,magic-packet;
nvmem-cells = <&fec_mac1>;
nvmem-cell-names = "mac-address";
fsl,rgmii_rxc_dly;
fsl,rgmii_txc_dly;
fsl,mii-exclusive;
status = "okay";

mdio {
#address-cells = <1>;
#size-cells = <0>;

ethphy1: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <1>;
};
};
};
.....

pinctrl_fec1: fec1grp {
fsl,pins = <
IMX8QM_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB_PAD 0x000014a0
IMX8QM_ENET0_MDC_CONN_ENET0_MDC 0x06000020
IMX8QM_ENET0_MDIO_CONN_ENET0_MDIO 0x06000020
IMX8QM_ENET0_RGMII_TX_CTL_CONN_ENET0_RGMII_TX_CTL 0x06000020
IMX8QM_ENET0_RGMII_TXC_CONN_ENET0_RGMII_TXC 0x06000020
IMX8QM_ENET0_RGMII_TXD0_CONN_ENET0_RGMII_TXD0 0x06000020
IMX8QM_ENET0_RGMII_TXD1_CONN_ENET0_RGMII_TXD1 0x06000020
IMX8QM_ENET0_RGMII_TXD2_CONN_ENET0_RGMII_TXD2 0x06000020
IMX8QM_ENET0_RGMII_TXD3_CONN_ENET0_RGMII_TXD3 0x06000020
IMX8QM_ENET0_RGMII_RXC_CONN_ENET0_RGMII_RXC 0x06000020
IMX8QM_ENET0_RGMII_RX_CTL_CONN_ENET0_RGMII_RX_CTL 0x06000020
IMX8QM_ENET0_RGMII_RXD0_CONN_ENET0_RGMII_RXD0 0x06000020
IMX8QM_ENET0_RGMII_RXD1_CONN_ENET0_RGMII_RXD1 0x06000020
IMX8QM_ENET0_RGMII_RXD2_CONN_ENET0_RGMII_RXD2 0x06000020
IMX8QM_ENET0_RGMII_RXD3_CONN_ENET0_RGMII_RXD3 0x06000020
>;
};

pinctrl_fec2: fec2grp {
fsl,pins = <
IMX8QM_COMP_CTL_GPIO_1V8_3V3_ENET_ENETA_PAD 0x000014a0
IMX8QM_ENET1_MDC_CONN_ENET1_MDC 0x06000020
IMX8QM_ENET1_MDIO_CONN_ENET1_MDIO 0x06000020
IMX8QM_ENET1_RGMII_TX_CTL_CONN_ENET1_RGMII_TX_CTL 0x00000060
IMX8QM_ENET1_RGMII_TXC_CONN_ENET1_RGMII_TXC 0x00000060
IMX8QM_ENET1_RGMII_TXD0_CONN_ENET1_RGMII_TXD0 0x00000060
IMX8QM_ENET1_RGMII_TXD1_CONN_ENET1_RGMII_TXD1 0x00000060
IMX8QM_ENET1_RGMII_TXD2_CONN_ENET1_RGMII_TXD2 0x00000060
IMX8QM_ENET1_RGMII_TXD3_CONN_ENET1_RGMII_TXD3 0x00000060
IMX8QM_ENET1_RGMII_RXC_CONN_ENET1_RGMII_RXC 0x00000060
IMX8QM_ENET1_RGMII_RX_CTL_CONN_ENET1_RGMII_RX_CTL 0x00000060
IMX8QM_ENET1_RGMII_RXD0_CONN_ENET1_RGMII_RXD0 0x00000060
IMX8QM_ENET1_RGMII_RXD1_CONN_ENET1_RGMII_RXD1 0x00000060
IMX8QM_ENET1_RGMII_RXD2_CONN_ENET1_RGMII_RXD2 0x00000060
IMX8QM_ENET1_RGMII_RXD3_CONN_ENET1_RGMII_RXD3 0x00000060
>;
};

0 件の賞賛
2 返答(返信)

1,142件の閲覧回数
scottbrust
Contributor II

I ran into the same error when trying to add a new PHY driver. The issue for me is that the PHY driver "features" flag is used differently in different kernel versions. The panic is caused here:

drivers/net/phy/phy_device.c

/* Start out supporting everything. Eventually,
* a controller will attach, and may modify one
* or both of these values
*/
if (phydrv->features) {
linkmode_copy(phydev->supported, phydrv->features);
} else if (phydrv->get_features) {
err = phydrv->get_features(phydev);
} else if (phydev->is_c45) {
err = genphy_c45_pma_read_abilities(phydev);
} else {
err = genphy_read_abilities(phydev);
}

If you look at your phy driver (somewhere in /drivers/net/phy/********.c) look at the driver structure (static struct phy_driver ) and check if "features" flags are being set. Based on your log, I suspect there is a flag 0x2000 being set which is causing the panic when it tires to memcpy from that address. 

Unfortunately, im not sure how to port these flags correctly. I think it has something to do with the flags being (re?)defined in /include/uapi/linux/ethtool.h

Perhaps you can translate whatever 0x2000 is to something relevant in there. Good luck

0 件の賞賛

1,192件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi jeffin

 

as  i.MX8 software is very sensitive regarding version compatibility of

its components (like uboot, seco, scfw, e.t.c.),  for L5.4.24_2.1.0 issue may be

recommended to rebuild all image from scratch, including ddr test and use latest RPA

tool :

https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8-8X-Family-DDR-Tools-Release/ta-p/...

uboot ver.v2020.04

https://source.codeaurora.org/external/imx/uboot-imx/tree/?h=imx_v2020.04_5.4.24_2.1.0

versions of other components can be found in Release Notes document included

in documentation package for that BSP version:

https://www.nxp.com/webapp/Download?colCode=L5.4.24_2.1.0_LINUX_DOCS

 

Best regards
igor

0 件の賞賛