netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, linux-can@vger.kernel.org,
	kernel@pengutronix.de,
	Alexander Stein <alexander.stein@systec-electronic.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH 3/4] can: flexcan: Disable error interrupt when bus error reporting is disabled
Date: Thu, 21 Aug 2014 11:23:21 +0200	[thread overview]
Message-ID: <1408613002-29693-4-git-send-email-mkl@pengutronix.de> (raw)
In-Reply-To: <1408613002-29693-1-git-send-email-mkl@pengutronix.de>

From: Alexander Stein <alexander.stein@systec-electronic.com>

In case we don't have FLEXCAN_HAS_BROKEN_ERR_STATE and the user set
CAN_CTRLMODE_BERR_REPORTING once it can not be unset again until reboot.
So in case neither hardware nor user wants the error interrupt disable
the bit.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/flexcan.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index f425ec2..a691651 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -852,6 +852,8 @@ static int flexcan_chip_start(struct net_device *dev)
 	if (priv->devtype_data->features & FLEXCAN_HAS_BROKEN_ERR_STATE ||
 	    priv->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING)
 		reg_ctrl |= FLEXCAN_CTRL_ERR_MSK;
+	else
+		reg_ctrl &= ~FLEXCAN_CTRL_ERR_MSK;
 
 	/* save for later use */
 	priv->reg_ctrl_default = reg_ctrl;
-- 
2.1.0.rc1

  parent reply	other threads:[~2014-08-21  9:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21  9:23 pull-request: can 2014-08-21 Marc Kleine-Budde
2014-08-21  9:23 ` [PATCH 1/4] can: sja1000: Validate initialization state in start method Marc Kleine-Budde
2014-08-21  9:23 ` [PATCH 2/4] can: c_can: checking IS_ERR() instead of NULL Marc Kleine-Budde
2014-08-21  9:23 ` Marc Kleine-Budde [this message]
2014-08-21  9:23 ` [PATCH 4/4] can: flexcan: handle state passive -> warning transition Marc Kleine-Budde
2014-08-22  4:53 ` pull-request: can 2014-08-21 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=1408613002-29693-4-git-send-email-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=alexander.stein@systec-electronic.com \
    --cc=davem@davemloft.net \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).