Skip to content

Commit

Permalink
net: ravb: Fix lack of register setting after system resumed for Gen3
Browse files Browse the repository at this point in the history
[ Upstream commit c2b6cde ]

After system entered Suspend to RAM, registers setting of this
hardware is reset because the SoC will be turned off. On R-Car Gen3
(info->ccc_gac), ravb_ptp_init() is called in ravb_probe() only. So,
after system resumed, it lacks of the initial settings for ptp. So,
add ravb_ptp_{init,stop}() into ravb_{resume,suspend}().

Fixes: f5d7837 ("ravb: ptp: Add CONFIG mode support")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
shimoday authored and gregkh committed Feb 1, 2023
1 parent fc48270 commit 4fd88b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/ethernet/renesas/ravb_main.c
Expand Up @@ -2973,6 +2973,9 @@ static int __maybe_unused ravb_suspend(struct device *dev)
else
ret = ravb_close(ndev);

if (priv->info->ccc_gac)
ravb_ptp_stop(ndev);

return ret;
}

Expand Down Expand Up @@ -3011,6 +3014,9 @@ static int __maybe_unused ravb_resume(struct device *dev)
/* Restore descriptor base address table */
ravb_write(ndev, priv->desc_bat_dma, DBAT);

if (priv->info->ccc_gac)
ravb_ptp_init(ndev, priv->pdev);

if (netif_running(ndev)) {
if (priv->wol_enabled) {
ret = ravb_wol_restore(ndev);
Expand Down

0 comments on commit 4fd88b8

Please sign in to comment.