From: Thomas Gleixner <tglx@linutronix.de>
To: linux-can <linux-can@vger.kernel.org>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
Wolfgang Grandegger <wg@grandegger.com>,
Alexander Stein <alexander.stein@systec-electronic.com>
Subject: [patch 06/10] can: c_can: Always update error stats
Date: Fri, 04 Apr 2014 15:24:26 -0000 [thread overview]
Message-ID: <20140404134857.333228984@linutronix.de> (raw)
In-Reply-To: 20140404134816.751883017@linutronix.de
[-- Attachment #1: can-c_can-always-update-error-stats.patch --]
[-- Type: text/plain, Size: 1712 bytes --]
If berr reporting is disabled or the allocation of the error skb
fails, we still want to see the error statistics.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
drivers/net/can/c_can/c_can.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
Index: linux-can/drivers/net/can/c_can/c_can.c
===================================================================
--- linux-can.orig/drivers/net/can/c_can/c_can.c
+++ linux-can/drivers/net/can/c_can/c_can.c
@@ -378,6 +378,9 @@ static int c_can_handle_lost_msg_obj(str
priv->write_reg(priv, C_CAN_IFACE(MSGCTRL_REG, iface), ctrl);
c_can_object_put(dev, iface, objno, IF_COMM_CONTROL);
+ stats->rx_errors++;
+ stats->rx_over_errors++;
+
/* create an error msg */
skb = alloc_can_err_skb(dev, &frame);
if (unlikely(!skb))
@@ -385,8 +388,6 @@ static int c_can_handle_lost_msg_obj(str
frame->can_id |= CAN_ERR_CRTL;
frame->data[1] = CAN_ERR_CRTL_RX_OVERFLOW;
- stats->rx_errors++;
- stats->rx_over_errors++;
netif_receive_skb(skb);
return 1;
@@ -993,6 +994,10 @@ static int c_can_handle_bus_err(struct n
if (lec_type == LEC_UNUSED || lec_type == LEC_NO_ERROR)
return 0;
+ /* common for all type of bus errors */
+ priv->can.can_stats.bus_error++;
+ stats->rx_errors++;
+
if (!(priv->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING))
return 0;
@@ -1005,10 +1010,6 @@ static int c_can_handle_bus_err(struct n
* check for 'last error code' which tells us the
* type of the last error to occur on the CAN bus
*/
-
- /* common for all type of bus errors */
- priv->can.can_stats.bus_error++;
- stats->rx_errors++;
cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;
cf->data[2] |= CAN_ERR_PROT_UNSPEC;
next prev parent reply other threads:[~2014-04-04 15:24 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-04 15:24 [patch 00/10] can: c_can: Another pile of fixes and improvements Thomas Gleixner
2014-04-04 15:24 ` [patch 01/10] can: c_can: Fix startup logic Thomas Gleixner
2014-04-04 15:24 ` [patch 02/10] can: c_can: Make bus off interrupt disable logic work Thomas Gleixner
2014-04-04 15:24 ` [patch 03/10] can: c_can: Do not access skb after net_receive_skb() Thomas Gleixner
2014-04-04 15:24 ` [patch 04/10] can: c_can: Handle state change correctly Thomas Gleixner
2014-04-04 15:24 ` [patch 05/10] can: c_can: Fix berr reporting Thomas Gleixner
2014-04-04 15:24 ` Thomas Gleixner [this message]
2014-04-04 15:24 ` [patch 07/10] can: c_can: Simplify buffer reenabling Thomas Gleixner
2014-04-04 16:14 ` Oliver Hartkopp
2014-04-04 16:33 ` Thomas Gleixner
2014-04-04 15:24 ` [patch 09/10] can: c_can: Get rid of pointless interrupts Thomas Gleixner
2014-04-04 15:24 ` [patch 08/10] can: c_can: Avoid status register update for D_CAN Thomas Gleixner
2014-04-04 15:24 ` [patch 10/10] can: c_can : Disable rx split as workaround Thomas Gleixner
2014-04-04 16:17 ` Mark
2014-04-04 16:38 ` Thomas Gleixner
2014-04-05 18:57 ` Thomas Gleixner
2014-04-04 16:43 ` Thomas Gleixner
2014-04-05 18:56 ` Thomas Gleixner
2014-04-05 19:38 ` Wolfgang Grandegger
2014-04-05 19:42 ` Wolfgang Grandegger
2014-04-05 19:48 ` Thomas Gleixner
2014-04-05 19:53 ` Wolfgang Grandegger
2014-04-04 17:41 ` Oliver Hartkopp
2014-04-04 18:55 ` Thomas Gleixner
2014-04-04 19:51 ` Thomas Gleixner
2014-04-04 20:54 ` [patch 10/10 V2] can: c_can: Disable rx buffer split to prevent packet loss Thomas Gleixner
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=20140404134857.333228984@linutronix.de \
--to=tglx@linutronix.de \
--cc=alexander.stein@systec-electronic.com \
--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.