From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, linux-can@vger.kernel.org,
kernel@pengutronix.de, Thomas Kopp <thomas.kopp@microchip.com>,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH 01/13] can: mcp25xxfd: mcp25xxfd_handle_eccif(): add ECC related errata and update log messages
Date: Wed, 30 Sep 2020 22:18:04 +0200 [thread overview]
Message-ID: <20200930201816.1032054-2-mkl@pengutronix.de> (raw)
In-Reply-To: <20200930201816.1032054-1-mkl@pengutronix.de>
From: Thomas Kopp <thomas.kopp@microchip.com>
This patch adds a reference to the recent released MCP2517FD and MCP2518FD
errata sheets and paste the explanation.
The single error correction does not always work, so always indicate that a
single error occurred. If the location of the ECC error is outside of the
TX-RAM always use netdev_notice() to log the problem. For ECC errors in the
TX-RAM, there is a recovery procedure.
Signed-off-by: Thomas Kopp <thomas.kopp@microchip.com>
Link: https://lore.kernel.org/r/20200925065606.358-1-thomas.kopp@microchip.com
[mkl: split into two patches, adjust subject and commit message]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
.../net/can/spi/mcp25xxfd/mcp25xxfd-core.c | 21 ++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/net/can/spi/mcp25xxfd/mcp25xxfd-core.c b/drivers/net/can/spi/mcp25xxfd/mcp25xxfd-core.c
index bd2ba981ae36..106dda8e5310 100644
--- a/drivers/net/can/spi/mcp25xxfd/mcp25xxfd-core.c
+++ b/drivers/net/can/spi/mcp25xxfd/mcp25xxfd-core.c
@@ -1973,8 +1973,20 @@ mcp25xxfd_handle_eccif(struct mcp25xxfd_priv *priv, bool set_normal_mode)
else
return err;
+ /* Errata Reference:
+ * mcp2517fd: DS80000789B, mcp2518fd: DS80000792C 2.
+ *
+ * ECC single error correction does not work in all cases:
+ *
+ * Fix/Work Around:
+ * Enable single error correction and double error detection
+ * interrupts by setting SECIE and DEDIE. Handle SECIF as a
+ * detection interrupt and do not rely on the error
+ * correction. Instead, handle both interrupts as a
+ * notification that the RAM word at ERRADDR was corrupted.
+ */
if (ecc_stat & MCP25XXFD_REG_ECCSTAT_SECIF)
- msg = "Single ECC Error corrected at address";
+ msg = "Single ECC Error detected at address";
else if (ecc_stat & MCP25XXFD_REG_ECCSTAT_DEDIF)
msg = "Double ECC Error detected at address";
else
@@ -1983,12 +1995,7 @@ mcp25xxfd_handle_eccif(struct mcp25xxfd_priv *priv, bool set_normal_mode)
if (!in_tx_ram) {
ecc->ecc_stat = 0;
- if (ecc_stat & MCP25XXFD_REG_ECCSTAT_SECIF)
- netdev_info(priv->ndev, "%s 0x%04x.\n",
- msg, addr);
- else
- netdev_notice(priv->ndev, "%s 0x%04x.\n",
- msg, addr);
+ netdev_notice(priv->ndev, "%s 0x%04x.\n", msg, addr);
} else {
/* Re-occurring error? */
if (ecc->ecc_stat == ecc_stat) {
--
2.28.0
next prev parent reply other threads:[~2020-09-30 20:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-30 20:18 pull-request: can-next 2020-09-30 Marc Kleine-Budde
2020-09-30 20:18 ` Marc Kleine-Budde [this message]
2020-09-30 20:18 ` [PATCH 02/13] can: mcp25xxfd: mcp25xxfd_probe(): add SPI clk limit related errata information Marc Kleine-Budde
2020-09-30 20:18 ` [PATCH 03/13] can: mcp25xxfd: mcp25xxfd_ring_free(): fix memory leak during cleanup Marc Kleine-Budde
2020-09-30 20:18 ` [PATCH 04/13] can: mcp25xxfd: mcp25xxfd_irq(): add missing initialization of variable set_normal mode Marc Kleine-Budde
2020-09-30 20:18 ` [PATCH 05/13] dt-binding: can: mcp25xxfd: documentation fixes Marc Kleine-Budde
2020-09-30 20:18 ` [PATCH 06/13] dt-binding: can: mcp251xfd: narrow down wildcards in device tree bindings to "microchip,mcp251xfd" Marc Kleine-Budde
2020-09-30 20:18 ` [PATCH 07/13] can: mcp25xxfd: " Marc Kleine-Budde
2020-09-30 20:18 ` [PATCH 08/13] can: mcp251xfd: rename driver files and subdir to mcp251xfd Marc Kleine-Budde
2020-09-30 20:18 ` [PATCH 09/13] can: mcp251xfd: rename all user facing strings " Marc Kleine-Budde
2020-09-30 20:18 ` [PATCH 11/13] can: flexcan: initialize all flexcan memory for ECC function Marc Kleine-Budde
2020-09-30 20:18 ` [PATCH 12/13] can: flexcan: add flexcan driver for i.MX8MP Marc Kleine-Budde
2020-09-30 20:18 ` [PATCH 13/13] can: flexcan: disable runtime PM if register flexcandev failed Marc Kleine-Budde
2020-09-30 22:21 ` pull-request: can-next 2020-09-30 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200930201816.1032054-2-mkl@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=davem@davemloft.net \
--cc=kernel@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=thomas.kopp@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).