All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
To: linux-can@vger.kernel.org
Cc: "Marc Kleine-Budde" <mkl@pengutronix.de>,
	"Frank Jungclaus" <frank.jungclaus@esd.eu>,
	"Stefan Mätje" <Stefan.Maetje@esd.eu>,
	"Vincent Mailhol" <mailhol.vincent@wanadoo.fr>
Subject: [PATCH v2 00/12] can: error: set of fixes and improvement on txerr and rxerr reporting
Date: Tue, 19 Jul 2022 23:35:38 +0900	[thread overview]
Message-ID: <20220719143550.3681-1-mailhol.vincent@wanadoo.fr> (raw)
In-Reply-To: <20220712153157.83847-1-mailhol.vincent@wanadoo.fr>

This series is a collection of patches targeting the CAN error
counter. The series is split in three blocks (with small relation to
each other).

Several drivers uses the data[6] and data[7] fields (both of type u8)
of the CAN error frame to report those values. However, the maximum
size an u8 can hold is 255 and the error counter can exceed this value
if bus-off status occurs. As such, the first nine patches of this
series make sure that no drivers try to report txerr or rxerr through
the CAN error frame when bus-off status is reached.

can_frame::data[5..7] are defined as being "controller
specific". Controller specific behaviors are not something desirable
(portability issue...) The tenth patch of this series specifies how
can_frame::data[5..7] should be use and remove any "controller
specific" freedom. The eleventh patch adds a flag to notify though
can_frame::can_id that data[6..7] were populated (in order to be
consistent with other fields).

Finally, the twelfth and last patch add three macro values to specify
the different error counter threshold with so far was hard-coded as
magic numbers in the drivers.

N.B.:
  * patches 1 to 10 are for net (stable).
  * patches 11 and 12 are for net-next (but depends on patches 1 to 10).


** Changelog **

v1 -> v2:
  * Fix typo in patch #10: data[7] of CAN error frames is for the RX
    error counter, not the TX one (this is litteraly a one byte
    change).

Vincent Mailhol (12):
  can: pch_can: do not report txerr and rxerr during bus-off
  can: rcar_can: do not report txerr and rxerr during bus-off
  can: sja1000: do not report txerr and rxerr during bus-off
  can: slcan: do not report txerr and rxerr during bus-off
  can: hi311x: do not report txerr and rxerr during bus-off
  can: sun4i_can: do not report txerr and rxerr during bus-off
  can: kvaser_usb_hydra: do not report txerr and rxerr during bus-off
  can: kvaser_usb_leaf: do not report txerr and rxerr during bus-off
  can: usb_8dev: do not report txerr and rxerr during bus-off
  can: error: specify the values of data[5..7] of CAN error frames
  can: add CAN_ERR_CNT flag to notify availability of error counter
  can: error: add definitions for the different CAN error thresholds

 drivers/net/can/c_can/c_can_main.c            |  6 +++---
 drivers/net/can/cc770/cc770.c                 |  1 +
 drivers/net/can/ctucanfd/ctucanfd_base.c      |  5 +++--
 drivers/net/can/grcan.c                       |  1 +
 drivers/net/can/ifi_canfd/ifi_canfd.c         |  4 ++--
 drivers/net/can/janz-ican3.c                  |  4 ++--
 drivers/net/can/kvaser_pciefd.c               |  2 +-
 drivers/net/can/m_can/m_can.c                 |  4 ++--
 drivers/net/can/pch_can.c                     |  7 ++++---
 drivers/net/can/peak_canfd/peak_canfd.c       |  6 +++---
 drivers/net/can/rcar/rcar_can.c               |  9 +++++----
 drivers/net/can/rcar/rcar_canfd.c             |  4 ++--
 drivers/net/can/sja1000/sja1000.c             |  8 +++++---
 drivers/net/can/slcan/slcan-core.c            | 13 ++++++------
 drivers/net/can/spi/hi311x.c                  |  6 ++++--
 .../net/can/spi/mcp251xfd/mcp251xfd-core.c    |  1 +
 drivers/net/can/sun4i_can.c                   | 10 +++++-----
 drivers/net/can/ti_hecc.c                     |  1 +
 drivers/net/can/usb/esd_usb.c                 |  3 ++-
 .../net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 14 +++++++++----
 .../net/can/usb/kvaser_usb/kvaser_usb_leaf.c  |  7 +++++--
 drivers/net/can/usb/peak_usb/pcan_usb.c       |  1 +
 drivers/net/can/usb/usb_8dev.c                |  8 +++++---
 drivers/net/can/xilinx_can.c                  |  1 +
 include/uapi/linux/can/error.h                | 20 ++++++++++++++++++-
 25 files changed, 94 insertions(+), 52 deletions(-)

-- 
2.35.1


  parent reply	other threads:[~2022-07-19 14:40 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12 15:31 [PATCH v1 00/12] can: error: set of fixes and improvement on txerr and rxerr reporting Vincent Mailhol
2022-07-12 15:31 ` [PATCH v1 01/12] can: pch_can: do not report txerr and rxerr during bus-off Vincent Mailhol
2022-07-12 15:31 ` [PATCH v1 02/12] can: rcar_can: " Vincent Mailhol
2022-07-12 15:31 ` [PATCH v1 03/12] can: sja1000: " Vincent Mailhol
2022-07-12 15:31 ` [PATCH v1 04/12] can: slcan: " Vincent Mailhol
2022-07-12 15:31 ` [PATCH v1 05/12] can: hi311x: " Vincent Mailhol
2022-07-12 15:31 ` [PATCH v1 06/12] can: sun4i_can: " Vincent Mailhol
2022-07-12 15:31 ` [PATCH v1 07/12] can: kvaser_usb_hydra: " Vincent Mailhol
2022-07-12 15:31 ` [PATCH v1 08/12] can: kvaser_usb_leaf: " Vincent Mailhol
2022-07-12 15:31 ` [PATCH v1 09/12] can: usb_8dev: " Vincent Mailhol
2022-07-12 15:31 ` [PATCH v1 10/12] can: error: specify the values of data[5..7] of CAN error frames Vincent Mailhol
2022-07-19 10:44   ` Stefan Mätje
2022-07-19 14:14     ` Vincent MAILHOL
2022-07-12 15:31 ` [PATCH v1 11/12] can: add CAN_ERR_CNT flag to notify availability of error counter Vincent Mailhol
2022-07-12 15:31 ` [PATCH v1 12/12] can: error: add definitions for the different CAN error thresholds Vincent Mailhol
2022-07-19 14:35 ` Vincent Mailhol [this message]
2022-07-19 14:35   ` [PATCH v2 01/12] can: pch_can: do not report txerr and rxerr during bus-off Vincent Mailhol
2022-07-19 14:35   ` [PATCH v2 02/12] can: rcar_can: " Vincent Mailhol
2022-07-19 14:35   ` [PATCH v2 03/12] can: sja1000: " Vincent Mailhol
2022-07-19 14:35   ` [PATCH v2 04/12] can: slcan: " Vincent Mailhol
2022-07-19 14:35   ` [PATCH v2 05/12] can: hi311x: " Vincent Mailhol
2022-07-19 14:35   ` [PATCH v2 06/12] can: sun4i_can: " Vincent Mailhol
2022-07-19 14:35   ` [PATCH v2 07/12] can: kvaser_usb_hydra: " Vincent Mailhol
2022-07-19 14:35   ` [PATCH v2 08/12] can: kvaser_usb_leaf: " Vincent Mailhol
2022-07-19 14:35   ` [PATCH v2 09/12] can: usb_8dev: " Vincent Mailhol
2022-07-19 14:35   ` [PATCH v2 10/12] can: error: specify the values of data[5..7] of CAN error frames Vincent Mailhol
2022-07-19 14:35   ` [PATCH v2 11/12] can: add CAN_ERR_CNT flag to notify availability of error counter Vincent Mailhol
2022-07-19 14:35   ` [PATCH v2 12/12] can: error: add definitions for the different CAN error thresholds Vincent Mailhol
2022-07-20  7:17   ` [PATCH v2 00/12] can: error: set of fixes and improvement on txerr and rxerr reporting Marc Kleine-Budde
2022-07-20  7:24     ` Vincent MAILHOL

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=20220719143550.3681-1-mailhol.vincent@wanadoo.fr \
    --to=mailhol.vincent@wanadoo.fr \
    --cc=Stefan.Maetje@esd.eu \
    --cc=frank.jungclaus@esd.eu \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    /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.