sh_eth_close() does a synchronous power down of the device before
marking it closed. Revert the order, to make sure the device is never
marked opened while suspended.
While at it, use pm_runtime_put() instead of pm_runtime_put_sync(), as
there is no reason to do a synchronous power down.
Fixes: 7fa2955ff70ce453 ("sh_eth: Fix sleeping function called from invalid context")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/net/ethernet/renesas/sh_eth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -2606,10 +2606,10 @@ static int sh_eth_close(struct net_device *ndev)/* Free all the skbuffs in the Rx queue and the DMA buffer. */sh_eth_ring_free(ndev);-pm_runtime_put_sync(&mdp->pdev->dev);-mdp->is_opened=0;+pm_runtime_put(&mdp->pdev->dev);+return0;}
From: Sergei Shtylyov <hidden> Date: 2021-01-18 16:59:18
On 1/18/21 6:08 PM, Geert Uytterhoeven wrote:
sh_eth_close() does a synchronous power down of the device before
marking it closed. Revert the order, to make sure the device is never
marked opened while suspended.
While at it, use pm_runtime_put() instead of pm_runtime_put_sync(), as
there is no reason to do a synchronous power down.
Fixes: 7fa2955ff70ce453 ("sh_eth: Fix sleeping function called from invalid context")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Sergei Shtylyov <redacted>
[...]
MBR, Sergei
Hi Geert,
Thanks for your work.
On 2021-01-18 16:08:12 +0100, Geert Uytterhoeven wrote:
sh_eth_close() does a synchronous power down of the device before
marking it closed. Revert the order, to make sure the device is never
marked opened while suspended.
While at it, use pm_runtime_put() instead of pm_runtime_put_sync(), as
there is no reason to do a synchronous power down.
Fixes: 7fa2955ff70ce453 ("sh_eth: Fix sleeping function called from invalid context")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
@@ -2606,10 +2606,10 @@ static int sh_eth_close(struct net_device *ndev)/* Free all the skbuffs in the Rx queue and the DMA buffer. */sh_eth_ring_free(ndev);-pm_runtime_put_sync(&mdp->pdev->dev);-mdp->is_opened=0;+pm_runtime_put(&mdp->pdev->dev);+return0;}
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Mon, 18 Jan 2021 16:08:12 +0100 you wrote:
sh_eth_close() does a synchronous power down of the device before
marking it closed. Revert the order, to make sure the device is never
marked opened while suspended.
While at it, use pm_runtime_put() instead of pm_runtime_put_sync(), as
there is no reason to do a synchronous power down.
[...]