Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] can: flexcan: disable completely the ECC mechanism
@ 2019-08-15  8:00 Joakim Zhang
  2019-08-16  6:37 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: Joakim Zhang @ 2019-08-15  8:00 UTC (permalink / raw)
  To: mkl, linux-can; +Cc: wg, netdev, stefan, dl-linux-imx, Joakim Zhang

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>
---
 drivers/net/can/flexcan.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index def8cbbc04e8..6a48333b40c7 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -1428,6 +1428,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;
 		reg_mecr &= ~(FLEXCAN_MECR_NCEFAFRZ | FLEXCAN_MECR_HANCEI_MSK |
 			      FLEXCAN_MECR_FANCEI_MSK);
 		priv->write(reg_mecr, &regs->mecr);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] can: flexcan: disable completely the ECC mechanism
  2019-08-15  8:00 [PATCH] can: flexcan: disable completely the ECC mechanism Joakim Zhang
@ 2019-08-16  6:37 ` Marc Kleine-Budde
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2019-08-16  6:37 UTC (permalink / raw)
  To: Joakim Zhang, linux-can; +Cc: wg, netdev, stefan, dl-linux-imx

[-- Attachment #1.1: Type: text/plain, Size: 799 bytes --]

On 8/15/19 10:00 AM, Joakim Zhang wrote:
> 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>

Added to can.

tnx
Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-15  8:00 [PATCH] can: flexcan: disable completely the ECC mechanism Joakim Zhang
2019-08-16  6:37 ` Marc Kleine-Budde

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org netdev@archiver.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox