android_kernel_motorola_sm6225/drivers/net/can
Alexander Stein 24e5589791 can: flexcan: Always use last mailbox for TX
commit cbffaf7aa09edbaea2bc7dc440c945297095e2fd upstream.

Essentially this patch moves the TX mailbox to position 63, regardless
of timestamp based offloading or RX FIFO. So mainly the iflag register
usage regarding TX has changed. The rest is consolidating RX FIFO and
timestamp offloading as they now use both the same TX mailbox.

The reason is a very annoying behavior regarding sending RTR frames when
_not_ using RX FIFO:

If a TX mailbox sent a RTR frame it becomes a RX mailbox. For that
reason flexcan_irq disables the TX mailbox again. But if during the time
the RTR was sent and the TX mailbox is disabled a new CAN frames is
received, it is lost without notice. The reason is that so-called
"Move-in" process starts from the lowest mailbox which happen to be a TX
mailbox set to EMPTY.

Steps to reproduce (I used an imx7d):
1. generate regular bursts of messages
2. send a RTR from flexcan with higher priority than burst messages every
   1ms, e.g. cangen -I 0x100 -L 0 -g 1 -R can0
3. notice a lost message without notification after some seconds

When running an iperf in parallel this problem is occurring even more
frequently. Using filters is not possible as at least one single CAN-ID
is allowed. Handling the TX MB during RX is also not possible as there
is no race-free disable of RX MB.

There is still a slight window when the described problem can occur. But
for that all RX MB must be in use which is essentially next to an
overrun. Still there will be no indication if it ever occurs.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-01 09:37:30 +01:00
..
c_can can: c_can_pci: make c_can_pci_data const 2017-12-01 09:14:22 +01:00
cc770 can: cc770: fix spelling mistake: "comptibility" -> "compatibility" 2018-07-27 10:40:16 +02:00
ifi_canfd can: ifi: Repair the error handling 2018-03-12 09:55:12 +01:00
m_can can: m_can: Move accessing of message ram to after clocks are enabled 2018-07-23 14:34:45 +02:00
mscan can: mpc5xxx_can: check of_iomap return before use 2018-07-23 14:34:45 +02:00
peak_canfd can: peak_canfd: rearrange the way resources are released 2018-07-27 10:40:18 +02:00
rcar scripts/spelling.txt: add regsiter -> register spelling mistake 2017-05-08 17:15:13 -07:00
sja1000 can: sja1000: Replace mdelay with usleep_range in pcan_add_channels 2018-07-27 10:40:17 +02:00
softing drivers/net: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
spi can: hi311x: Use level-triggered interrupt 2018-12-01 09:37:30 +01:00
usb can: kvaser_usb: Fix potential uninitialized variable use 2018-11-27 16:13:09 +01:00
at91_can.c drivers/net: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
dev.c can: dev: __can_get_echo_skb(): print error message, if trying to echo non existing skb 2018-12-01 09:37:29 +01:00
flexcan.c can: flexcan: Always use last mailbox for TX 2018-12-01 09:37:30 +01:00
grcan.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
janz-ican3.c can: janz-ican3: fix ican3_xmit()'s return type 2018-07-27 10:40:16 +02:00
Kconfig can: mark led trigger as broken 2018-06-28 21:34:45 +02:00
led.c can: add combined rx/tx LED trigger support 2015-03-22 23:50:11 +01:00
Makefile can: remove bfin_can driver 2018-03-26 15:57:02 +02:00
pch_can.c can: fix assignment of error location in CAN error messages 2015-11-23 09:37:34 +01:00
rx-offload.c can: rx-offload: rename can_rx_offload_irq_queue_err_skb() to can_rx_offload_queue_tail() 2018-12-01 09:37:29 +01:00
slcan.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
sun4i_can.c can: sun4i: fix sun4ican_start_xmit()'s return type 2018-07-27 10:40:16 +02:00
ti_hecc.c can: ti_hecc: Fix napi poll return value for repoll 2017-12-01 11:20:52 +01:00
vcan.c drivers/net: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
vxcan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-01-09 10:37:00 -05:00
xilinx_can.c can: xilinx_can: add support for Xilinx CAN FD core 2018-07-27 10:40:17 +02:00