Skip to content

Commit 039dc98

Browse files
geertugregkh
authored andcommitted
can: rcar_can: rcar_can_resume(): fix s2ram with PSCI
[ Upstream commit 5c793af ] On R-Car Gen3 using PSCI, s2ram powers down the SoC. After resume, the CAN interface no longer works, until it is brought down and up again. Fix this by calling rcar_can_start() from the PM resume callback, to fully initialize the controller instead of just restarting it. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/699b2f7fcb60b31b6f976a37f08ce99c5ffccb31.1755165227.git.geert+renesas@glider.be Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 383a92c commit 039dc98

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

drivers/net/can/rcar/rcar_can.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,6 @@ static int __maybe_unused rcar_can_resume(struct device *dev)
867867
{
868868
struct net_device *ndev = dev_get_drvdata(dev);
869869
struct rcar_can_priv *priv = netdev_priv(ndev);
870-
u16 ctlr;
871870
int err;
872871

873872
if (!netif_running(ndev))
@@ -879,12 +878,7 @@ static int __maybe_unused rcar_can_resume(struct device *dev)
879878
return err;
880879
}
881880

882-
ctlr = readw(&priv->regs->ctlr);
883-
ctlr &= ~RCAR_CAN_CTLR_SLPM;
884-
writew(ctlr, &priv->regs->ctlr);
885-
ctlr &= ~RCAR_CAN_CTLR_CANM;
886-
writew(ctlr, &priv->regs->ctlr);
887-
priv->can.state = CAN_STATE_ERROR_ACTIVE;
881+
rcar_can_start(ndev);
888882

889883
netif_device_attach(ndev);
890884
netif_start_queue(ndev);

0 commit comments

Comments
 (0)