Skip to content

Commit c72a7e4

Browse files
bijudasPaolo Abeni
authored andcommitted
ravb: Fix "failed to switch device to config mode" message during unbind
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() 1) ravb_get_stats 2) ravb_close Fixes: c156633 ("Renesas Ethernet AVB driver proper") Cc: [email protected] Signed-off-by: Biju Das <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 2cb815c commit c72a7e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/renesas/ravb_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2903,12 +2903,12 @@ static int ravb_remove(struct platform_device *pdev)
29032903
priv->desc_bat_dma);
29042904
/* Set reset mode */
29052905
ravb_write(ndev, CCC_OPC_RESET, CCC);
2906-
pm_runtime_put_sync(&pdev->dev);
29072906
unregister_netdev(ndev);
29082907
if (info->nc_queues)
29092908
netif_napi_del(&priv->napi[RAVB_NC]);
29102909
netif_napi_del(&priv->napi[RAVB_BE]);
29112910
ravb_mdio_release(priv);
2911+
pm_runtime_put_sync(&pdev->dev);
29122912
pm_runtime_disable(&pdev->dev);
29132913
reset_control_assert(priv->rstc);
29142914
free_netdev(ndev);

0 commit comments

Comments
 (0)