On Mon, Jan 18, 2021 at 04:06:56PM +0100, Geert Uytterhoeven wrote: > Wolfram reports that his R-Car H2-based Lager board can no longer be > rebooted in v5.11-rc1, as it crashes with an imprecise external abort. > The issue can be reproduced on other boards (e.g. Koelsch with R-Car > M2-W) too, if CONFIG_IP_PNP is disabled, and the Ethernet interface is > down at reboot time: > > Unhandled fault: imprecise external abort (0x1406) at 0x00000000 > pgd = (ptrval) > [00000000] *pgd=422b6835, *pte=00000000, *ppte=00000000 > Internal error: : 1406 [#1] ARM > Modules linked in: > CPU: 0 PID: 1105 Comm: init Tainted: G W 5.10.0-rc1-00402-ge2f016cf7751 #1048 > Hardware name: Generic R-Car Gen2 (Flattened Device Tree) > PC is at sh_mdio_ctrl+0x44/0x60 > LR is at sh_mmd_ctrl+0x20/0x24 > ... > Backtrace: > [] (sh_mdio_ctrl) from [] (sh_mmd_ctrl+0x20/0x24) > r7:0000001f r6:00000020 r5:00000002 r4:c22a1dc4 > [] (sh_mmd_ctrl) from [] (mdiobb_cmd+0x38/0xa8) > [] (mdiobb_cmd) from [] (mdiobb_read+0x58/0xdc) > r9:c229f844 r8:c0c329dc r7:c221e000 r6:00000001 r5:c22a1dc4 r4:00000001 > [] (mdiobb_read) from [] (__mdiobus_read+0x74/0xe0) > r7:0000001f r6:00000001 r5:c221e000 r4:c221e000 > [] (__mdiobus_read) from [] (mdiobus_read+0x40/0x54) > r7:0000001f r6:00000001 r5:c221e000 r4:c221e458 > [] (mdiobus_read) from [] (phy_read+0x1c/0x20) > r7:ffffe000 r6:c221e470 r5:00000200 r4:c229f800 > [] (phy_read) from [] (kszphy_config_intr+0x44/0x80) > [] (kszphy_config_intr) from [] (phy_disable_interrupts+0x44/0x50) > r5:c229f800 r4:c229f800 > [] (phy_disable_interrupts) from [] (phy_shutdown+0x18/0x1c) > r5:c229f800 r4:c229f804 > [] (phy_shutdown) from [] (device_shutdown+0x168/0x1f8) > [] (device_shutdown) from [] (kernel_restart_prepare+0x3c/0x48) > r9:c22d2000 r8:c0100264 r7:c0b0d034 r6:00000000 r5:4321fedc r4:00000000 > [] (kernel_restart_prepare) from [] (kernel_restart+0x1c/0x60) > [] (kernel_restart) from [] (__do_sys_reboot+0x168/0x208) > r5:4321fedc r4:01234567 > [] (__do_sys_reboot) from [] (sys_reboot+0x18/0x1c) > r7:00000058 r6:00000000 r5:00000000 r4:00000000 > [] (sys_reboot) from [] (ret_fast_syscall+0x0/0x54) > > As of commit e2f016cf775129c0 ("net: phy: add a shutdown procedure"), > system reboot calls phy_disable_interrupts() during shutdown. As this > happens unconditionally, the PHY registers may be accessed while the > device is suspended, causing undefined behavior, which may crash the > system. > > Fix this by wrapping the PHY bitbang accessors in the sh_eth driver by > wrappers that take care of Runtime PM, to resume the device when needed. > > Reported-by: Wolfram Sang > Suggested-by: Andrew Lunn > Signed-off-by: Geert Uytterhoeven Tested-by: Wolfram Sang Thanks for debugging and fixing this, Geert!