summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Zhang <qiangqing.zhang@nxp.com>2021-02-18 19:00:35 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-17 16:07:19 +0100
commitc6e15c249c8341d0ca4f5c856cd14d8036c40534 (patch)
treebce96cd97b328c2c87d7b1e121e7ee6ac8776d3d
parent4798a42a50473ffc224b70a260e7485c8639ac7d (diff)
can: flexcan: assert FRZ bit in flexcan_chip_freeze()
commit 449052cfebf624b670faa040245d3feed770d22f upstream. Assert HALT bit to enter freeze mode, there is a premise that FRZ bit is asserted. This patch asserts FRZ bit in flexcan_chip_freeze, although the reset value is 1b'1. This is a prepare patch, later patch will invoke flexcan_chip_freeze() to enter freeze mode, which polling freeze mode acknowledge. Fixes: b1aa1c7a2165b ("can: flexcan: fix transition from and to freeze mode in chip_{,un}freeze") Link: https://lore.kernel.org/r/20210218110037.16591-2-qiangqing.zhang@nxp.com Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/can/flexcan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 6b866d0451b2..66aef0a575ef 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -383,7 +383,7 @@ static int flexcan_chip_freeze(struct flexcan_priv *priv)
u32 reg;
reg = flexcan_read(&regs->mcr);
- reg |= FLEXCAN_MCR_HALT;
+ reg |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT;
flexcan_write(reg, &regs->mcr);
while (timeout-- && !(flexcan_read(&regs->mcr) & FLEXCAN_MCR_FRZ_ACK))