Skip to content

Commit 5c793af

Browse files
geertumarckleinebudde
authored andcommitted
can: rcar_can: rcar_can_resume(): fix s2ram with PSCI
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 <[email protected]> Link: https://patch.msgid.link/699b2f7fcb60b31b6f976a37f08ce99c5ffccb31.1755165227.git.geert+renesas@glider.be Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent ef79f00 commit 5c793af

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

drivers/net/can/rcar/rcar_can.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,6 @@ static int rcar_can_resume(struct device *dev)
861861
{
862862
struct net_device *ndev = dev_get_drvdata(dev);
863863
struct rcar_can_priv *priv = netdev_priv(ndev);
864-
u16 ctlr;
865864
int err;
866865

867866
if (!netif_running(ndev))
@@ -873,12 +872,7 @@ static int rcar_can_resume(struct device *dev)
873872
return err;
874873
}
875874

876-
ctlr = readw(&priv->regs->ctlr);
877-
ctlr &= ~RCAR_CAN_CTLR_SLPM;
878-
writew(ctlr, &priv->regs->ctlr);
879-
ctlr &= ~RCAR_CAN_CTLR_CANM;
880-
writew(ctlr, &priv->regs->ctlr);
881-
priv->can.state = CAN_STATE_ERROR_ACTIVE;
875+
rcar_can_start(ndev);
882876

883877
netif_device_attach(ndev);
884878
netif_start_queue(ndev);

0 commit comments

Comments
 (0)