On Tue, Dec 13, 2022 at 09:59:38AM +0000, Biju Das wrote:
This patch fixes the error "ravb 11c20000.ethernet eth0: failed to switch device to config mode" during unbind.
We are doing register access after pm_runtime_put_sync().
We usually do cleanup in reverse order of init. Currently in remove(), the "pm_runtime_put_sync" is not in reverse order.
Probe reset_control_deassert(rstc); pm_runtime_enable(&pdev->dev); pm_runtime_get_sync(&pdev->dev);
remove pm_runtime_put_sync(&pdev->dev); unregister_netdev(ndev); .. ravb_mdio_release(priv); pm_runtime_disable(&pdev->dev);
Consider the call to unregister_netdev() unregister_netdev->unregister_netdevice_queue->rollback_registered_many that calls the below functions which access the registers after pm_runtime_put_sync()
- ravb_get_stats
- ravb_close
Fixes: a0d2f20650e8 ("Renesas Ethernet AVB PTP clock driver")
I don't know how you came to this fixes line, but the more correct one is c156633f1353 ("Renesas Ethernet AVB driver proper")
Ant the title should need to be "PATCH net".
When you resend the patch, feel free to add my tag.
Thanks, Reviewed-by: Leon Romanovsky leonro@nvidia.com