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:
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
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 :
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