[05/29] can: flexcan: disable completely the ECC mechanism
diff mbox series

Message ID 20191010121750.27237-6-mkl@pengutronix.de
State RFC
Delegated to: David Miller
Headers show
  • [01/29] can: dev: add missing of_node_put() after calling of_get_child_by_name()
Related show

Commit Message

Marc Kleine-Budde Oct. 10, 2019, 12:17 p.m. UTC
From: Joakim Zhang <qiangqing.zhang@nxp.com>

The ECC (memory error detection and correction) mechanism can be
activated or not, controlled by the ECCDIS bit in CAN_MECR. When
disabled, updates on indications and reporting registers are stopped.
So if want to disable ECC completely, had better assert ECCDIS bit, not
just mask the related interrupts.

Fixes: cdce844865be ("can: flexcan: add vf610 support for FlexCAN")
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
 drivers/net/can/flexcan.c | 1 +
 1 file changed, 1 insertion(+)

diff mbox series

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index dc5695dffc2e..1cd5179cb876 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -1188,6 +1188,7 @@  static int flexcan_chip_start(struct net_device *dev)
 		reg_mecr = priv->read(&regs->mecr);
 		reg_mecr &= ~FLEXCAN_MECR_ECRWRDIS;
 		priv->write(reg_mecr, &regs->mecr);
+		reg_mecr |= FLEXCAN_MECR_ECCDIS;
 		priv->write(reg_mecr, &regs->mecr);