Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

can: m_can: tag current CAN FD controllers as non-ISO

During the CAN FD standardization process within the ISO it turned out that
the failure detection capability has to be improved.

The CAN in Automation organization (CiA) defined the already implemented CAN
FD controllers as 'non-ISO' and the upcoming improved CAN FD controllers as
'ISO' compliant. See at http://www.can-cia.com/index.php?id=1937

Finally there will be three types of CAN FD controllers in the future:

1. ISO compliant (fixed)
2. non-ISO compliant (fixed, like the M_CAN IP v3.0.1 in m_can.c)
3. ISO/non-ISO CAN FD controllers (switchable, like the PEAK USB FD)

So the current M_CAN driver for the M_CAN IP v3.0.1 has to expose its non-ISO
implementation by setting the CAN_CTRLMODE_FD_NON_ISO ctrlmode at startup.
As this bit cannot be switched at configuration time CAN_CTRLMODE_FD_NON_ISO
must not be set in ctrlmode_supported of the current M_CAN driver.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

authored by

Oliver Hartkopp and committed by
Marc Kleine-Budde
6cfda7fb 9b1087aa

+6
+5
drivers/net/can/m_can/m_can.c
··· 955 955 priv->can.data_bittiming_const = &m_can_data_bittiming_const; 956 956 priv->can.do_set_mode = m_can_set_mode; 957 957 priv->can.do_get_berr_counter = m_can_get_berr_counter; 958 + 959 + /* CAN_CTRLMODE_FD_NON_ISO is fixed with M_CAN IP v3.0.1 */ 960 + priv->can.ctrlmode = CAN_CTRLMODE_FD_NON_ISO; 961 + 962 + /* CAN_CTRLMODE_FD_NON_ISO can not be changed with M_CAN IP v3.0.1 */ 958 963 priv->can.ctrlmode_supported = CAN_CTRLMODE_LOOPBACK | 959 964 CAN_CTRLMODE_LISTENONLY | 960 965 CAN_CTRLMODE_BERR_REPORTING |
+1
include/uapi/linux/can/netlink.h
··· 98 98 #define CAN_CTRLMODE_BERR_REPORTING 0x10 /* Bus-error reporting */ 99 99 #define CAN_CTRLMODE_FD 0x20 /* CAN FD mode */ 100 100 #define CAN_CTRLMODE_PRESUME_ACK 0x40 /* Ignore missing CAN ACKs */ 101 + #define CAN_CTRLMODE_FD_NON_ISO 0x80 /* CAN FD in non-ISO mode */ 101 102 102 103 /* 103 104 * CAN device statistics