linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] can: flexcan: disable bus error interrupts for the i.MX6q
@ 2012-10-11 13:39 Marc Kleine-Budde
  2012-10-11 15:18 ` Wolfgang Grandegger
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Kleine-Budde @ 2012-10-11 13:39 UTC (permalink / raw)
  To: linux-can; +Cc: wg, Hui Wang, Shawn Guo, Marc Kleine-Budde

From: Wolfgang Grandegger <wg@grandegger.com>

Due to a bug in most Flexcan cores, the bus error interrupt needs
to be enabled. Otherwise we don't get any error warning or passive
interrupts. This is _not_ necessary for the i.MX6q and this patch
disables bus error interrupts if "berr-reporting" is not requested.
This avoids bus error flooding, which might harm, especially on
low-end systems.

Cc: Hui Wang <jason77.wang@gmail.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
[mkl: convert to incremental patch]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Changes since v3:
- convert to incremental patch
- update mx6 glitch filter information
---
Hello Wolfgang,

I've converted your patch so that it can be applied to current net, where David
already accepted your v1 version of the patch.

cheers, Marc

 drivers/net/can/flexcan.c |   19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index c78ecfc..a412bf6 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -144,9 +144,22 @@
 
 #define FLEXCAN_MB_CODE_MASK		(0xf0ffffff)
 
-/* FLEXCAN hardware feature flags */
+/*
+ * FLEXCAN hardware feature flags
+ *
+ * Below is some version info we got:
+ *    SOC   Version   IP-Version  Glitch-  [TR]WRN_INT
+ *                                Filter?   connected?
+ *   MX25  FlexCAN2  03.00.00.00     no         no
+ *   MX28  FlexCAN2  03.00.04.00    yes        yes
+ *   MX35  FlexCAN2  03.00.00.00     no         no
+ *   MX53  FlexCAN2  03.00.00.00    yes         no
+ *   MX6s  FlexCAN3  10.00.12.00    yes        yes
+ *
+ * Some SOCs do not have the RX_WARN & TX_WARN interrupt line connected.
+ */
 #define FLEXCAN_HAS_V10_FEATURES	BIT(1) /* For core version >= 10 */
-#define FLEXCAN_HAS_BROKEN_ERR_STATE	BIT(2) /* Broken error state handling */
+#define FLEXCAN_HAS_BROKEN_ERR_STATE	BIT(2) /* [TR]WRN_INT not connected */
 
 /* Structure of the message buffer */
 struct flexcan_mb {
@@ -205,7 +218,7 @@ static struct flexcan_devtype_data fsl_p1010_devtype_data = {
 };
 static struct flexcan_devtype_data fsl_imx28_devtype_data;
 static struct flexcan_devtype_data fsl_imx6q_devtype_data = {
-	.features = FLEXCAN_HAS_V10_FEATURES | FLEXCAN_HAS_BROKEN_ERR_STATE,
+	.features = FLEXCAN_HAS_V10_FEATURES,
 };
 
 static const struct can_bittiming_const flexcan_bittiming_const = {
-- 
1.7.10


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

* Re: [PATCH v3] can: flexcan: disable bus error interrupts for the i.MX6q
  2012-10-11 13:39 [PATCH v3] can: flexcan: disable bus error interrupts for the i.MX6q Marc Kleine-Budde
@ 2012-10-11 15:18 ` Wolfgang Grandegger
  2012-10-11 15:28   ` Marc Kleine-Budde
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Grandegger @ 2012-10-11 15:18 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: linux-can, Hui Wang, Shawn Guo

Hi Marc,

On 10/11/2012 03:39 PM, Marc Kleine-Budde wrote:
> From: Wolfgang Grandegger <wg@grandegger.com>
> 
> Due to a bug in most Flexcan cores, the bus error interrupt needs
> to be enabled. Otherwise we don't get any error warning or passive
> interrupts. This is _not_ necessary for the i.MX6q and this patch
> disables bus error interrupts if "berr-reporting" is not requested.
> This avoids bus error flooding, which might harm, especially on
> low-end systems.

Should be something like:

This patch adds some Flexcan version info and removes the feature flag
FLEXCAN_HAS_BROKEN_ERR_STATE for the i.MX6Q. It also has the line
[TR]WRN_INT properly connected.

> Cc: Hui Wang <jason77.wang@gmail.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
> [mkl: convert to incremental patch]
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
> Changes since v3:
> - convert to incremental patch
> - update mx6 glitch filter information
> ---
> Hello Wolfgang,
> 
> I've converted your patch so that it can be applied to current net, where David
> already accepted your v1 version of the patch.

Thanks, I will not have time before this evening. Looks good, apart from
the commit message. Feel free to go ahead.

Thanks,

Wolfgang.

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

* Re: [PATCH v3] can: flexcan: disable bus error interrupts for the i.MX6q
  2012-10-11 15:18 ` Wolfgang Grandegger
@ 2012-10-11 15:28   ` Marc Kleine-Budde
  0 siblings, 0 replies; 3+ messages in thread
From: Marc Kleine-Budde @ 2012-10-11 15:28 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: linux-can, Hui Wang, Shawn Guo

[-- Attachment #1: Type: text/plain, Size: 1755 bytes --]

On 10/11/2012 05:18 PM, Wolfgang Grandegger wrote:
> Hi Marc,
> 
> On 10/11/2012 03:39 PM, Marc Kleine-Budde wrote:
>> From: Wolfgang Grandegger <wg@grandegger.com>
>>
>> Due to a bug in most Flexcan cores, the bus error interrupt needs
>> to be enabled. Otherwise we don't get any error warning or passive
>> interrupts. This is _not_ necessary for the i.MX6q and this patch
>> disables bus error interrupts if "berr-reporting" is not requested.
>> This avoids bus error flooding, which might harm, especially on
>> low-end systems.
> 
> Should be something like:
> 
> This patch adds some Flexcan version info and removes the feature flag
> FLEXCAN_HAS_BROKEN_ERR_STATE for the i.MX6Q. It also has the line
> [TR]WRN_INT properly connected.

Tnx, I've send a v4 with the new commit message.

> 
>> Cc: Hui Wang <jason77.wang@gmail.com>
>> Cc: Shawn Guo <shawn.guo@linaro.org>
>> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
>> [mkl: convert to incremental patch]
>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>> ---
>> Changes since v3:
>> - convert to incremental patch
>> - update mx6 glitch filter information
>> ---
>> Hello Wolfgang,
>>
>> I've converted your patch so that it can be applied to current net, where David
>> already accepted your v1 version of the patch.
> 
> Thanks, I will not have time before this evening. Looks good, apart from
> the commit message. Feel free to go ahead.

Will do,
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: 259 bytes --]

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

end of thread, other threads:[~2012-10-11 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-11 13:39 [PATCH v3] can: flexcan: disable bus error interrupts for the i.MX6q Marc Kleine-Budde
2012-10-11 15:18 ` Wolfgang Grandegger
2012-10-11 15:28   ` Marc Kleine-Budde

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).