All of lore.kernel.org
 help / color / mirror / Atom feed
From: "ZHU Yi (ST-FIR/ENG1-Zhu)" <Yi.Zhu5@cn.bosch.com>
To: Wolfgang Grandegger <wg@grandegger.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Andri Yngvason <andri.yngvason@marel.com>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Cc: "hs@denx.de" <hs@denx.de>,
	"RUAN Tingquan (ST-FIR/ENG1-Zhu)" <Tingquan.Ruan@cn.bosch.com>,
	"Jonas Mark (ST-FIR/ENG1)" <Mark.Jonas@de.bosch.com>
Subject: [PATCH 1/6] can: flexcan: fix state transition regression
Date: Wed, 13 Sep 2017 09:33:36 +0000	[thread overview]
Message-ID: <3a362990f9e54dea8d359595c2e53c41@SGPMBX1017.APAC.bosch.com> (raw)

From bd1550533993968f20e972e72fa89e547264e09c Mon Sep 17 00:00:00 2001
From: Zhu Yi <yi.zhu5@cn.bosch.com>
Date: Wed, 30 Aug 2017 13:57:50 +0800
Subject: [PATCH 1/6] can: flexcan: fix state transition regression

Update state upon any interrupt to report correct state transitions
in case the flexcan core enabled the broken error state quirk fix.

Signed-off-by: Zhu Yi <yi.zhu5@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
---
 drivers/net/can/flexcan.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 13f0f21..df4bfb8 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -765,8 +765,9 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
 		flexcan_write(reg_esr & FLEXCAN_ESR_ALL_INT, &regs->esr);
 	}
 
-	/* state change interrupt */
-	if (reg_esr & FLEXCAN_ESR_ERR_STATE)
+	/* state change interrupt or broken error state quirk fix is enabled */
+	if ((reg_esr & FLEXCAN_ESR_ERR_STATE) ||
+	    (priv->devtype_data->quirks & FLEXCAN_QUIRK_BROKEN_ERR_STATE))
 		flexcan_irq_state(dev, reg_esr);
 
 	/* bus error IRQ - handle if bus error reporting is activated */
-- 
2.7.4




             reply	other threads:[~2017-09-13  9:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-13  9:33 ZHU Yi (ST-FIR/ENG1-Zhu) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-08-31  8:24 [PATCH 1/6] can: flexcan: fix state transition regression ZHU Yi (ST-FIR/ENG1-Zhu)
2017-08-31 11:37 ` Wolfgang Grandegger
2017-09-01  2:48   ` ZHU Yi (ST-FIR/ENG1-Zhu)
2017-09-01 15:14     ` Wolfgang Grandegger
2017-09-04 10:01       ` ZHU Yi (ST-FIR/ENG1-Zhu)
2017-09-04 11:09         ` Wolfgang Grandegger

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=3a362990f9e54dea8d359595c2e53c41@SGPMBX1017.APAC.bosch.com \
    --to=yi.zhu5@cn.bosch.com \
    --cc=Mark.Jonas@de.bosch.com \
    --cc=Tingquan.Ruan@cn.bosch.com \
    --cc=andri.yngvason@marel.com \
    --cc=hs@denx.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=wg@grandegger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.