Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: macb: avoid calling phylink_init_phydev fixed link devices
In case of fixed link devices the mdiodev in mdio_device_reset() is null leading to the following crash: 8<--- cut here --- Unable to handle kernel NULL pointer dereference at virtual address 000001f0 [000001f0] *pgd=00000000 Internal error: Oops: 5 [#1] ARM Modules linked in: tag_ksz ksz_spi ksz_switch dsa_core bridge stp llc microchip lan78xx atmel_usba_udc CPU: 0 PID: 249 Comm: sh Not tainted 6.1.22-linux4microchip-2023.04-rc1+ torvalds#46 Hardware name: Atmel SAMA5 PC is at mdio_device_reset+0x8/0x9c LR is at phy_init_hw+0x10/0xa4 pc : [<c058f1a8>] lr : [<c058cbd0>] psr: 600b0013 sp : e0b61d80 ip : 00000100 fp : c0ab43cc r10: c0d92d50 r9 : 00000100 r8 : c13d1000 r7 : c13d0520 r6 : c13d1c0c r5 : c13d0000 r4 : 00000000 r3 : c1ad4440 r2 : 00000000 r1 : 00000000 r0 : 00000000 Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none Control: 10c53c7d Table: 21b20059 DAC: 00000051 Register r0 information: NULL pointer Register r1 information: NULL pointer Register r2 information: NULL pointer Register r3 information: slab task_struct start c1ad4440 pointer offset 0 Register r4 information: NULL pointer Register r5 information: slab kmalloc-cg-8k start c13d0000 pointer offset 0 size 8192 Register r6 information: slab kmalloc-cg-8k start c13d0000 pointer offset 7180 size 8192 Register r7 information: slab kmalloc-cg-8k start c13d0000 pointer offset 1312 size 8192 Register r8 information: slab kmalloc-cg-8k start c13d0000 pointer offset 4096 size 8192 Register r9 information: non-paged memory Register r10 information: non-slab/vmalloc memory Register r11 information: non-slab/vmalloc memory Register r12 information: non-paged memory Process sh (pid: 249, stack limit = 0x74d3815e) Stack: (0xe0b61d80 to 0xe0b62000) 1d80: 00000000 c13d0000 c13d1c0c c058cbd0 c13d1b64 c059d098 e0b61d9 00000006 1da0: e0b61dc0 c04fdbc0 c1056c10 c04fdbc0 c1056c10 c0d71eec 00000010 b66d215e 1dc0: 00000006 c0509e84 c1056c10 c0d5300c c1056c50 00000001 c1056c10 00000000 1de0: 00000010 c1056c54 00000010 c050a8b4 c1056c8c c0d52fe8 c1056c10 c0d52fe8 1e00: c0d5300c c050b4d8 00000010 c050b33c 931f958c 00000006 8eff9f7e 00000006 1e20: c0aeb4cc 00000010 00000001 00000002 00000000 c0d032b8 c0d0c6a4 00000000 1e40: c0d71ef c050b7d0 c0d71f0 c01483c0 c0aab0c4 c1ad4440 c0d03240 c0d032b0 1e60: 0056c190 c014bf68 e0b61e8c 29aa0439 c1ad4440 00000000 00000002 c0d032b0 1e80: c0aab0c4 00000008 c1bae640 c28c5110 0056c190 c0148928 00000002 c0adae58 1ea0: 00000007 c0d71f18 00000008 c0147378 00000008 c28c5100 00000000 00000000 1ec0: c1bae640 e0b61f28 c28c5110 c0262340 00000000 00000000 c1c0a600 c1ad4440 1ee0: 0056ebc8 00000008 c0908ac8 00004004 00000000 c01ee76 c290ea80 c1ad4440 1f00: c290ea80 0000000a 0000000a e0b61f78 01010006 00000008 00000000 0056ebc8 1f20: 00000000 00000000 c1c0a600 00000000 00000000 00000000 00000000 00000000 1f40: 00000000 00004004 00000000 00000000 00000001 29aa0439 c1c0a600 c1c0a600 1f60: 00000000 00000000 c1ad4440 0056ebc8 00000008 c01ee998 00000000 00000000 1f80: 00000000 29aa0439 00000001 00000000 b6f54480 00000004 c01002c0 c1ad4440 1fa0: 00000004 c0100060 00000001 00000000 00000001 0056ebc8 00000008 00000000 1fc0: 00000001 00000000 b6f54480 00000004 00000008 bed176c0 00000020 0056c190 1fe0: 00000004 bed17670 b6e675c7 b6dea9b6 60000030 00000001 00000000 00000000 mdio_device_reset from phy_init_hw+0x10/0xa4 phy_init_hw from macb_resume+0x2ac/0x358 macb_resume from dpm_run_callback.constprop.8+0x3c/0xbc dpm_run_callback.constprop.8 from device_resume+0xa4/0x17c device_resume from dpm_resume+0xd0/0x200 dpm_resume from dpm_resume_end+0xc/0x18 dpm_resume_end from suspend_devices_and_enter+0x2a4/0x5e4 suspend_devices_and_enter from pm_suspend+0x228/0x338 pm_suspend from state_store+0x6c/0xc8 state_store from kernfs_fop_write_iter+0x118/0x1b4 kernfs_fop_write_iter from vfs_write+0x294/0x34c vfs_write from ksys_write+0xa0/0xd0 ksys_write from ret_fast_syscall+0x0/0x54 Exception stack(0xe0b61fa8 to 0xe0b61ff0) 1fa0: 00000001 00000000 00000001 0056ebc8 00000008 00000000 1fc0: 00000001 00000000 b6f54480 00000004 00000008 bed176c0 00000020 0056c190 1fe0: 00000004 bed17670 b6e675c7 b6dea9b6 Code: e8bd4010 eafffc67 e92d4070 e1a04000 (e59001f0) ---[ end trace 0000000000000000 ]--- Fixes: e0bc931 ("net: macb: fix ethernet after resume") Fixes: 15a9dbe ("net: macb: Specify PHY PM management done by MAC") Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
- Loading branch information